This is the actual mosaic data-structure which will hold the matrix of sub-images to be written.
More...
#include <mosaiccanvas.h>
|
static bool | enableOutput = false |
|
This is the actual mosaic data-structure which will hold the matrix of sub-images to be written.
This is effectively just a 2-D array of TileImage objects which can be accessed via convenience methods.
MosaicCanvas::MosaicCanvas |
( |
int |
theRows, |
|
|
int |
theColumns |
|
) |
| |
Default constructor.
Constructor.
- Parameters
-
theRows | Number of rows to divide the canvas into |
theColumns | Number of columns to divide the canvas into |
Copy constructor.
- Parameters
-
inline const TileImage& MosaicCanvas::images(int row, int col) const { return myImages[row * columns + col]; }
PNG MosaicCanvas::drawMosaic |
( |
int |
pixelsPerTile | ) |
|
Save the current MosaicCanvas as a file with the following pixels per tile.
- Parameters
-
pixelsPerTile | pixels per Photomosaic tile |
- Returns
- the Photomosaic as a PNG object
int MosaicCanvas::getColumns |
( |
| ) |
const |
Retrieve the number of columns of images.
- Returns
- The number of columns in the mosaic, or -1 on error
-
The number of columns in the mosaic, or -1 or error
int MosaicCanvas::getRows |
( |
| ) |
const |
Retrieve the number of rows of images.
- Returns
- The number of rows in the mosaic, or -1 on error
-
The number or rows in the mosaic, or -1 on error
const TileImage & MosaicCanvas::getTile |
( |
int |
row, |
|
|
int |
column |
|
) |
| |
Retrieve the current TileImage for a particular row and column.
If the row or column is out of bounds, the default TileImage is returned. Note that row and tile indices should be zero-based.
- Parameters
-
row | The row |
column | The column |
- Returns
- The current TileImage for a particular, or the default TileImage if none is set.
void MosaicCanvas::setTile |
( |
int |
row, |
|
|
int |
column, |
|
|
TileImage * |
img |
|
) |
| |
Set the TiledImage for a particular region.
Note that row and tile indices should be zero-based.
- Parameters
-
row | The row |
column | The column |
img | The TileImage to set |
- Returns
- 0 on success, or non-zero otherwise
int MosaicCanvas::columns |
|
private |
Number of image columns in the Mosaic.
The actual matrix of Image data.
Number of image rows in the Mosaic.
The documentation for this class was generated from the following files: