mp_mosaics
Monstrous Mosaics
TileImage Class Reference

Represents a Tile in the Photomosaic. More...

#include <tileimage.h>

Public Member Functions

 TileImage ()
 
 TileImage (const PNG &theImage)
 
LUVAPixel getAverageColor () const
 
int getResolution () const
 
void paste (PNG &canvas, int startX, int startY, int resolution)
 

Private Member Functions

void generateResizedImage (int startX, int startY, int resolution)
 
LUVAPixel calculateAverageColor () const
 
LUVAPixel calculateAverageColor (unsigned x0, unsigned y0, unsigned x1, unsigned y1) const
 
LUVAPixel getScaledPixelDouble (double startX, double endX, double startY, double endY) const
 
LUVAPixel getScaledPixelInt (int startX, int endX, int startY, int endY) const
 

Static Private Member Functions

static PNG cropSourceImage (const PNG &source)
 
static uint64_t divide (uint64_t a, uint64_t b)
 
static int divide (int a, int b)
 
static int fdivide (double a, double b)
 
static double frac (double x)
 

Private Attributes

PNG image_
 
PNG resized_
 
LUVAPixel averageColor_
 

Detailed Description

Represents a Tile in the Photomosaic.

Constructor & Destructor Documentation

◆ TileImage() [1/2]

TileImage::TileImage ( )

◆ TileImage() [2/2]

TileImage::TileImage ( const PNG &  theImage)
explicit

Member Function Documentation

◆ calculateAverageColor() [1/2]

LUVAPixel TileImage::calculateAverageColor ( ) const
private

◆ calculateAverageColor() [2/2]

LUVAPixel TileImage::calculateAverageColor ( unsigned  x0,
unsigned  y0,
unsigned  x1,
unsigned  y1 
) const
private

◆ cropSourceImage()

PNG TileImage::cropSourceImage ( const PNG &  source)
staticprivate

◆ divide() [1/2]

static uint64_t TileImage::divide ( uint64_t  a,
uint64_t  b 
)
inlinestaticprivate

◆ divide() [2/2]

static int TileImage::divide ( int  a,
int  b 
)
inlinestaticprivate

◆ fdivide()

static int TileImage::fdivide ( double  a,
double  b 
)
inlinestaticprivate

◆ frac()

static double TileImage::frac ( double  x)
inlinestaticprivate

◆ generateResizedImage()

void TileImage::generateResizedImage ( int  startX,
int  startY,
int  resolution 
)
private

◆ getAverageColor()

LUVAPixel TileImage::getAverageColor ( ) const
inline

◆ getResolution()

int TileImage::getResolution ( ) const
inline

◆ getScaledPixelDouble()

LUVAPixel TileImage::getScaledPixelDouble ( double  startX,
double  endX,
double  startY,
double  endY 
) const
private

◆ getScaledPixelInt()

LUVAPixel TileImage::getScaledPixelInt ( int  startX,
int  endX,
int  startY,
int  endY 
) const
private

◆ paste()

void TileImage::paste ( PNG &  canvas,
int  startX,
int  startY,
int  resolution 
)

Member Data Documentation

◆ averageColor_

LUVAPixel TileImage::averageColor_
private

◆ image_

PNG TileImage::image_
private

◆ resized_

PNG TileImage::resized_
private

The documentation for this class was generated from the following files: