#include <mrpt/utils/CMRPTImageFloat.h>
Public Member Functions | |
void | setPixel (int x, int y, size_t color) |
Changes the value of the pixel (x,y). | |
void | resize (size_t width, size_t height) |
Resize the buffer "img" to accomodate a new image size. | |
void | setSize (size_t width, size_t height) |
Resize the buffer "img" to accomodate a new image size. | |
CMRPTImageFloat (size_t width=1, size_t height=1) | |
Default constructor:. | |
CMRPTImageFloat (const CMRPTImageFloat &o) | |
Copy constructor:. | |
CMRPTImageFloat (const math::CMatrixFloat &o) | |
Copy constructor from a matrix with values in the range [0,1]:. | |
CMRPTImageFloat (const math::CMatrixDouble &o) | |
Copy constructor from a matrix with values in the range [0,1]:. | |
CMRPTImageFloat (const CMRPTImage &o) | |
Copy constructor from a CMRPTImage. | |
void | operator= (const CMRPTImageFloat &o) |
Copy operator. | |
void | operator= (const CMRPTImage &o) |
Copy operator. | |
void | operator= (const math::CMatrixFloat &o) |
Copy operator from a float matrix. | |
void | operator= (const math::CMatrixDouble &o) |
Copy operator from a double matrix. | |
virtual | ~CMRPTImageFloat () |
Destructor:. | |
size_t | getWidth () const |
Returns the width of the image in pixels. | |
size_t | getHeight () const |
Returns the height of the image in pixels. | |
void | getAsMatrix (math::CMatrixFloat &outMatrix) const |
Returns a matrix CMatrix representation of the image. | |
bool | loadFromFile (const std::string &fileName) |
Loads the image from a gray-scale image file. | |
bool | saveToFile (const std::string &fileName, bool verticalFlip=false) const |
Save the image to a file in a format given by the file extension. | |
void | saveToTextFile (const std::string &fileName) const |
Save to a text file, loadable from matlab. | |
void | adjustImageRange (float min=0.0f, float max=1.0f) |
Adjusts the range of the values in the image, such as the minimum and maximum values are the given ones. | |
float * | operator() (size_t col, size_t row) const |
Returns a pointer to a given pixel. | |
CMRPTImageFloat | operator* (const CMRPTImageFloat &im2) |
Point-wise product of CMRPTImageFloat images by FAMD, JAN-2007. | |
CMRPTImageFloat | operator+ (const CMRPTImageFloat &im2) |
Point-wise addition of CMRPTImageFloat images by FAMD, JAN-2007. | |
CMRPTImageFloat | operator- (const CMRPTImageFloat &im2) |
Point-wise substraction of CMRPTImageFloat images by FAMD, JAN-2007. | |
CMRPTImageFloat | operator^ (int exp) |
Point-wise scalar power of CMRPTImageFloat images by FAMD, JAN-2007. | |
void | scaleHalf () |
Substitutes this image with a new one scaled down to half its original size. | |
Protected Attributes | |
float * | m_img |
Data members. | |
size_t | m_width |
The image size:. | |
size_t | m_height |
Friends | |
class | CMRPTImage |
I/O is supported as conversion to a byte-type pixels "CMRPTImage", and as binary dump using the CSerializable interface(<< and >> operators), just as most objects in the MRPT library. This format is not compatible with any standarized image format.
Additional notes:
There is a "=" operator for converting between the classes "CMRPTImage" and "CMRPTImageFloat".
Definition at line 57 of file CMRPTImageFloat.h.
mrpt::utils::CMRPTImageFloat::CMRPTImageFloat | ( | size_t | width = 1 , |
|
size_t | height = 1 | |||
) |
Default constructor:.
mrpt::utils::CMRPTImageFloat::CMRPTImageFloat | ( | const CMRPTImageFloat & | o | ) |
Copy constructor:.
mrpt::utils::CMRPTImageFloat::CMRPTImageFloat | ( | const math::CMatrixFloat & | o | ) |
Copy constructor from a matrix with values in the range [0,1]:.
mrpt::utils::CMRPTImageFloat::CMRPTImageFloat | ( | const math::CMatrixDouble & | o | ) |
Copy constructor from a matrix with values in the range [0,1]:.
mrpt::utils::CMRPTImageFloat::CMRPTImageFloat | ( | const CMRPTImage & | o | ) |
Copy constructor from a CMRPTImage.
virtual mrpt::utils::CMRPTImageFloat::~CMRPTImageFloat | ( | ) | [virtual] |
Destructor:.
void mrpt::utils::CMRPTImageFloat::adjustImageRange | ( | float | min = 0.0f , |
|
float | max = 1.0f | |||
) |
Adjusts the range of the values in the image, such as the minimum and maximum values are the given ones.
void mrpt::utils::CMRPTImageFloat::getAsMatrix | ( | math::CMatrixFloat & | outMatrix | ) | const |
Returns a matrix CMatrix representation of the image.
The output matrix will contain at its (r,c) element the pixel at the r'th row (y coordinate), and c'th column (x coordinate)
size_t mrpt::utils::CMRPTImageFloat::getHeight | ( | ) | const [virtual] |
size_t mrpt::utils::CMRPTImageFloat::getWidth | ( | ) | const [virtual] |
bool mrpt::utils::CMRPTImageFloat::loadFromFile | ( | const std::string & | fileName | ) |
Loads the image from a gray-scale image file.
See CMRPTImage::loadFromFile for supported formats
float* mrpt::utils::CMRPTImageFloat::operator() | ( | size_t | col, | |
size_t | row | |||
) | const |
Returns a pointer to a given pixel.
The coordinate origin is pixel(0,0)=top-left corner of the image.
std::exception | On pixel coordinates out of bounds |
CMRPTImageFloat mrpt::utils::CMRPTImageFloat::operator* | ( | const CMRPTImageFloat & | im2 | ) |
Point-wise product of CMRPTImageFloat images by FAMD, JAN-2007.
CMRPTImageFloat mrpt::utils::CMRPTImageFloat::operator+ | ( | const CMRPTImageFloat & | im2 | ) |
Point-wise addition of CMRPTImageFloat images by FAMD, JAN-2007.
CMRPTImageFloat mrpt::utils::CMRPTImageFloat::operator- | ( | const CMRPTImageFloat & | im2 | ) |
Point-wise substraction of CMRPTImageFloat images by FAMD, JAN-2007.
void mrpt::utils::CMRPTImageFloat::operator= | ( | const math::CMatrixDouble & | o | ) |
Copy operator from a double matrix.
void mrpt::utils::CMRPTImageFloat::operator= | ( | const math::CMatrixFloat & | o | ) |
Copy operator from a float matrix.
void mrpt::utils::CMRPTImageFloat::operator= | ( | const CMRPTImage & | o | ) |
Copy operator.
void mrpt::utils::CMRPTImageFloat::operator= | ( | const CMRPTImageFloat & | o | ) |
Copy operator.
CMRPTImageFloat mrpt::utils::CMRPTImageFloat::operator^ | ( | int | exp | ) |
Point-wise scalar power of CMRPTImageFloat images by FAMD, JAN-2007.
void mrpt::utils::CMRPTImageFloat::resize | ( | size_t | width, | |
size_t | height | |||
) |
Resize the buffer "img" to accomodate a new image size.
bool mrpt::utils::CMRPTImageFloat::saveToFile | ( | const std::string & | fileName, | |
bool | verticalFlip = false | |||
) | const |
Save the image to a file in a format given by the file extension.
If "verticalFlip" is true, the image is inverted vertically See CMRPTImage::saveToFile for supported formats
void mrpt::utils::CMRPTImageFloat::saveToTextFile | ( | const std::string & | fileName | ) | const |
Save to a text file, loadable from matlab.
void mrpt::utils::CMRPTImageFloat::scaleHalf | ( | ) |
Substitutes this image with a new one scaled down to half its original size.
void mrpt::utils::CMRPTImageFloat::setPixel | ( | int | x, | |
int | y, | |||
size_t | color | |||
) | [virtual] |
Changes the value of the pixel (x,y).
Pixel coordinates starts at the left-top corner of the image, and start in (0,0). The meaning of the parameter "color" depends on the implementation: it will usually be a 24bit RGB value (0x00RRGGBB), but it can also be just a 8bit gray level. This method must support (x,y) values OUT of the actual image size without neither raising exceptions, nor leading to memory access errors.
Implements mrpt::utils::CMRPTCanvas.
void mrpt::utils::CMRPTImageFloat::setSize | ( | size_t | width, | |
size_t | height | |||
) |
Resize the buffer "img" to accomodate a new image size.
Initialize all images pixels to zero. by AJOGD @ JAN-2007
friend class CMRPTImage [friend] |
Definition at line 59 of file CMRPTImageFloat.h.
size_t mrpt::utils::CMRPTImageFloat::m_height [protected] |
Definition at line 70 of file CMRPTImageFloat.h.
float* mrpt::utils::CMRPTImageFloat::m_img [protected] |
size_t mrpt::utils::CMRPTImageFloat::m_width [protected] |
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:14:51 EST 2009 |