|
| Image () |
| default constructor
|
|
| Image (unsigned int width, unsigned int height, ColorCode encoding, PixelDepth depth) |
| constructor More...
|
|
| Image (char *imgData, unsigned int width, unsigned int height, ColorCode encoding, PixelDepth depth) |
| constructor More...
|
|
virtual | ~Image () |
| destructor
|
|
void | resize (unsigned int width, unsigned int height) |
| resizes the current image. More...
|
|
char * | getImageData () |
| returns a char pointer to the image data More...
|
|
const char * | getImageData () const |
| returns a char pointer to the image data More...
|
|
void | setImageData (char *data) |
| sets the data array of this image. Make sure to change the height and width accordingly.
|
|
size_t | getDataSize () const |
| returns the size of the char data array More...
|
|
std::pair< unsigned int, unsigned int > | getImageDimension () |
| returns the dimensions (width and height) of this image More...
|
|
unsigned int | getWidth () const |
| returns the width of this image More...
|
|
unsigned int | getHeight () const |
| returns the height of this image More...
|
|
ColorCode | getColorEncoding () const |
| returns color encoding/type of this image More...
|
|
unsigned int | getBitsPerPixel () const |
| returns the number of bits per pixel. This is the number of bits used per pixel per channel. More...
|
|
bool | saveAsPGM (const std::string &fileName) const |
| saves this image to a file in the PGM (grayscale) format More...
|
|
bool | saveAsPGMAscii (const std::string &fileName) const |
| saves this image to a file in the ascii PGM (grayscale) format More...
|
|
bool | saveAsPPM (const std::string &fileName) const |
| saves this image to a file in the PPM (color) format More...
|
|
unsigned int | getWidthStep () const |
| the size of an aligned image row in bytes. This may not be the same as the width if extra bytes are padded to each row for alignment purposes. More...
|
|
PixelDepth | getPixelDepth () const |
| bits per pixel encoded as a PixelDepth type. More...
|
|
unsigned int | getNrOfChannels () const |
| The number of channels that this image has. More...
|
|
Pixel4f | getPixel (size_t x, size_t y) const |
| generic but inefficient access to pixel information. The float value is between [0;1] which means non float images are scaled according to their pixel depth (bits per pixel). More...
|
|
Pixel4f | getPixelf (size_t x, size_t y) const |
|
void | getPixel (size_t x, size_t y, Pixel4f &dst) const |
| generic but inefficient access to pixel information. The float value is between [0;1] which means non float images are scaled according to their pixel depth (bits per pixel). More...
|
|
Pixel4i | getPixeli (size_t x, size_t y) const |
| generic access to pixel information, however user must take care of the pixel depth himself. If image is a Depth8U then the maximum value is 254. Also float images are scaled accordingly. More...
|
|
void | getPixel (size_t x, size_t y, Pixel4i &dst) const |
| generic access to pixel information, however user must take care of the pixel depth himself. If image is a Depth8U then the maximum value is 254. Also float images are scaled accordingly. More...
|
|
float | getPixelValue (size_t x, size_t y, size_t channel) const |
| generic but inefficient access to a specific channel of a pixel. More...
|
|
float | getPixelValuef (size_t x, size_t y, size_t channel) const |
|
int | getPixelValuei (size_t x, size_t y, size_t channel) const |
|
template<typename T > |
void | getPixelValue (size_t x, size_t y, size_t channel, T &dst) const |
|
void | setPixel (size_t x, size_t y, const Pixel4f &value) |
|
void | setPixel8U (const int x, const int y, uint8_t value) |
| sets the gray tone in a 1-channel gray tone image with More...
|
|
void | setPixel8U (const int x, const int y, uint8_t ch0, uint8_t ch1, uint8_t ch2) |
|
void | setPixel8U (const int x, const int y, uint8_t ch0, uint8_t ch1, uint8_t ch2, uint8_t ch3) |
|
void | setPixel8S (const int x, const int y, int8_t value) |
|
void | setPixel8S (const int x, const int y, int8_t ch0, int8_t ch1, int8_t ch2) |
|
void | setPixel8S (const int x, const int y, int8_t ch0, int8_t ch1, int8_t ch2, int8_t ch3) |
|
void | setPixel16U (const int x, const int y, uint16_t value) |
|
void | setPixel16U (const int x, const int y, uint16_t ch0, uint16_t ch1, uint16_t ch2) |
|
void | setPixel16U (const int x, const int y, uint16_t ch0, uint16_t ch1, uint16_t ch2, uint16_t ch3) |
|
void | setPixel16S (const int x, const int y, int16_t value) |
|
void | setPixel16S (const int x, const int y, int16_t ch0, int16_t ch1, int16_t ch2) |
|
void | setPixel16S (const int x, const int y, int16_t ch0, int16_t ch1, int16_t ch2, int16_t ch3) |
|
void | setPixel32S (const int x, const int y, int32_t value) |
|
void | setPixel32S (const int x, const int y, int32_t ch0, int32_t ch1, int32_t ch2) |
|
void | setPixel32S (const int x, const int y, int32_t ch0, int32_t ch1, int32_t ch2, int32_t ch3) |
|
void | setPixel32F (const int x, const int y, float value) |
|
void | setPixel32F (const int x, const int y, float ch0, float ch1, float ch2) |
|
void | setPixel32F (const int x, const int y, float ch0, float ch1, float ch2, float ch3) |
|
template<PixelDepth DT> |
void | setPixel (const int x, const int y, int value) |
|
template<PixelDepth DT> |
void | setPixel (const int x, const int y, float value) |
|
template<PixelDepth DT> |
void | setPixel (const int x, const int y, const int ch0, const int ch1, const int ch2) |
|
template<PixelDepth DT> |
void | setPixel (const int x, const int y, const int ch0, const int ch1, const int ch2, const int ch3) |
|
Image::Ptr | copyFlip (bool horizontal, bool vertical) const |
| copies this image and flips it around horizontal or vertical axis or both. More...
|
|
The image class is a simple wrapper around a char data array. This Image wrapper contain information of width, height and encoding.
The image class is somewhat inspired by the IplImage of opencv.
The coordinate system has its origin located at the top-left position, where from X increases to the left and Y-increases downwards.
setting pixel values in an efficient manner has been enabled using some template joggling. It requires that the user know what type of image he/she is working with.