00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef HDRIMAGE_H
00022 #define HDRIMAGE_H
00023
00024 #include <QtGui>
00025 #include <Color.h>
00026
00027 class HdrImage
00028 {
00029
00030 public:
00031 enum ColorSpace
00032 {
00033 NONE,
00034 RGB,
00035 Yxy
00036 };
00037
00038 HdrImage();
00039 HdrImage(const HdrImage& im);
00040 HdrImage(const QString& fileName);
00041 ~HdrImage();
00042 QSize size() const;
00043 ColorSpace colorSpace() const;
00044 bool isNull() const;
00045 HdrImage* toRgb(const float mXyzToRgb[3][3]) const;
00046 void load(const QString &fileName);
00047 Color* operator[] (int i);
00048 const Color* operator[] (int i) const;
00049 bool hasY() const;
00050 int YIndex() const;
00051
00052 private:
00053 void resize(int width, int height);
00054 HdrImage* fromYxyToRgb(const float m[3][3]) const;
00055
00056 int width;
00057 int height;
00058 Color* data;
00059 bool null;
00060 ColorSpace space;
00061 float pMin;
00062 float pMax;
00063
00064 static int YIndices[];
00065 };
00066
00067 #endif