00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #if !defined(SO_HDR_IMAGERW_H)
00026 #define SO_HDR_IMAGERW_H
00027
00028 #include <Inventor/image/SoRasterImageRW.h>
00029 #include <Inventor/threads/SbThreadMutex.h>
00030
00031
00051 class SoHDRImageRW : public SoRasterImageRW {
00052
00053 SO_IMAGE_RASTER_RW_HEADER()
00054
00055 public:
00056
00060 SoHDRImageRW();
00061
00065 virtual ~SoHDRImageRW();
00066
00070 virtual SbBool open(SoRasterImageIO* rasterImageIO, OpenMode openMode);
00071
00077 virtual SbBool write(SbRasterImage* rasterImage, unsigned int xPos = 0, unsigned int yPos = 0);
00078
00082 virtual SbBool writeFooter();
00083
00089 virtual SbBool read(SbRasterImage* rasterImage, SbBool infoOnly = FALSE);
00096 virtual SbBool isMultipleBufferInverted() const;
00097
00101 virtual SoRasterImageRW::WriteCapability getWriteCapability() const;
00102
00106 virtual SoRasterImageRW::ReadCapability getReadCapability() const;
00107
00108 private:
00109 virtual bool supportsAlpha() const;
00110
00111 private:
00112
00113 virtual void createSuffixList();
00114
00115 private:
00117 static SbThreadMutex s_mutex;
00118
00122 static SbBool readHDRIBuffer(FILE* file, unsigned char* scan, int xmax);
00123
00127 static SbBool checkHDRIHeader(FILE* file, int &ymax, int &xmax);
00128
00133 static SbBool writeData(FILE* file, SbRasterImage* rasterImage );
00134
00139 static SbBool writePixels(FILE* file, unsigned char* data, unsigned long size);
00140
00144 static SbBool writePixelsRLE(FILE* file, unsigned char* data, unsigned long size);
00145 };
00146
00147 #endif // SO_HDR_IMAGERW_H
00148