SourceImage extends the Image class and provides some additional data and functions suitable for the source image for the photomosaic.
More...
#include <sourceimage.h>
SourceImage extends the Image class and provides some additional data and functions suitable for the source image for the photomosaic.
The default constructor will take a number of rows and columns to divide the image into. The image will then be processes to find the average color of each region.
◆ SourceImage()
SourceImage::SourceImage |
( |
const PNG & |
image, |
|
|
int |
resolution |
|
) |
| |
Default constructor.
- Parameters
-
image | The image data from GraphicsMagick |
resolution | The resolution of the sub-regions. This will be the number of tiles in the larger of the two dimensions of the SourceImage. If the given resolution is greater than the largest dimension of the image, it will be automatically set to the pixel dimensions |
◆ divide()
◆ getColumns()
int SourceImage::getColumns |
( |
| ) |
const |
Retreive the number of column sub-regions the source image is broken into.
- Returns
- The number of columns, or -1 if in an invalid state
◆ getRegionColor()
LUVAPixel SourceImage::getRegionColor |
( |
int |
row, |
|
|
int |
col |
|
) |
| const |
Get the average color of a particular region.
Note, the row and column should be specified with a 0-based index. i.e., The top-left corner is (row, column) (0,0).
- Parameters
-
row | The row of the particular region in the image |
col | The column of the particular region in the image |
- Returns
- The average color of the image
◆ getRows()
int SourceImage::getRows |
( |
| ) |
const |
Retreive the number of row sub-regions the source image is broken into.
- Returns
- The number of rows, or -1 if in an invalid state
◆ backingImage
PNG SourceImage::backingImage |
|
private |
◆ resolution
int SourceImage::resolution |
|
private |
The documentation for this class was generated from the following files: