The HdrImage class is a representation of an HDR image. More...
Public Types | |
enum | ColorSpace { NONE, RGB, Yxy } |
Public Member Functions | |
HdrImage () | |
HdrImage (const HdrImage &im) | |
HdrImage (const QString &fileName) | |
QSize | size () const |
ColorSpace | colorSpace () const |
bool | isNull () const |
HdrImage * | toRgb (const float mXyzToRgb[3][3]) const |
void | load (const QString &fileName) |
Color * | operator[] (int i) |
const Color * | operator[] (int i) const |
bool | hasY () const |
int | YIndex () const |
Private Member Functions | |
void | resize (int width, int height) |
HdrImage * | fromYxyToRgb (const float m[3][3]) const |
Private Attributes | |
int | width |
int | height |
Color * | data |
bool | null |
ColorSpace | space |
float | pMin |
float | pMax |
Static Private Attributes | |
static int | YIndices [] |
The HdrImage class is a representation of an HDR image.
The image data is stored as an array of Color and is accessible through the operator [].
This class can handle several color spaces and provides transformations between them. At the moment, only RGB and Yxy color spaces are available.
Definition at line 27 of file HdrImage.h.
HdrImage::HdrImage | ( | ) |
Constructs an empty image.
Definition at line 50 of file HdrImage.cpp.
HdrImage::HdrImage | ( | const HdrImage & | im ) |
Constructs a copy of im.
Definition at line 63 of file HdrImage.cpp.
HdrImage::HdrImage | ( | const QString & | fileName ) |
Constructs an image and tries to load the image from the file with the given fileName.
Definition at line 78 of file HdrImage.cpp.
HdrImage::ColorSpace HdrImage::colorSpace | ( | ) | const |
Returns the color space of the image.
Definition at line 104 of file HdrImage.cpp.
HdrImage * HdrImage::fromYxyToRgb | ( | const float | matrix[3][3] ) | const [private] |
Returns a RGB copy of a Yxy image.
Definition at line 133 of file HdrImage.cpp.
bool HdrImage::hasY | ( | ) | const |
Returns true if the image color space contains luminance data, otherwise returns false.
Definition at line 240 of file HdrImage.cpp.
bool HdrImage::isNull | ( | ) | const |
Returns true if it is a null image, otherwise returns false.
Definition at line 216 of file HdrImage.cpp.
void HdrImage::load | ( | const QString & | fileName ) |
Loads an image from the file with the given fileName or throw an Exception if the file cannot be loaded.
Definition at line 184 of file HdrImage.cpp.
const Color * HdrImage::operator[] | ( | int | i ) | const |
Returns a constant pointer to the row i of data.
Definition at line 232 of file HdrImage.cpp.
Color * HdrImage::operator[] | ( | int | i ) |
Returns a pointer to the row i of data.
Definition at line 224 of file HdrImage.cpp.
void HdrImage::resize | ( | int | w, |
int | h | ||
) | [private] |
Deletes current image data and creates new ones of given width and height.
Definition at line 170 of file HdrImage.cpp.
QSize HdrImage::size | ( | ) | const |
Returns the size of the image.
Definition at line 96 of file HdrImage.cpp.
HdrImage * HdrImage::toRgb | ( | const float | toRgbMatrix[3][3] ) | const |
Returns a RGB copy of the image or throw an Exception if the transformation from the current color space is not implemented.
Definition at line 112 of file HdrImage.cpp.
int HdrImage::YIndex | ( | ) | const |
Returns the luminance index of the image color space.
Definition at line 248 of file HdrImage.cpp.
int HdrImage::YIndices [static, private] |
{ -1, -1, 0 }
Position of Y element for each color space.
Definition at line 64 of file HdrImage.h.