25 #ifndef _OPENEXRINTERFACE_hh_
26 #define _OPENEXRINTERFACE_hh_
29 #include "bias_config.h"
30 #ifdef BIAS_HAVE_OPENEXR
32 # pragma warning( push, 1)
33 # define PLATFORM_WINDOWS
35 # include <ImfPixelType.h>
36 # include <ImfCompression.h>
37 # include <ImfHeader.h>
38 # include <ImfFrameBuffer.h>
41 # pragma warning( pop)
45 #include "ImageBase.hh"
73 int Export(
const std::string& FileName,
75 const Imf::Compression& compression = Imf::ZIP_COMPRESSION);
77 int Import(
const std::string& FileName,
ImageBase& result);
82 void SetOverridePixelTypeEXR(Imf::PixelType overridePT);
90 ChannelData() : ifFloat_(NULL), ifHalf_(NULL), ifUInt_(NULL) {};
91 ChannelData(
float* ifFloat) : ifFloat_(ifFloat), ifHalf_(NULL), ifUInt_(NULL) {};
92 ChannelData(half* ifHalf) : ifFloat_(NULL), ifHalf_(ifHalf), ifUInt_(NULL) {};
93 ChannelData(
unsigned int* ifUInt) : ifFloat_(NULL), ifHalf_(NULL), ifUInt_(ifUInt) {};
103 enum TypeID {isFloat=0, isHalf, isUInt, empty};
104 TypeID Get(
float*& ifFloat, half*& ifHalf,
unsigned int*& ifUInt)
const {
108 if(ifFloat!=NULL)
return isFloat;
109 if(ifHalf!=NULL)
return isHalf;
110 if(ifUInt!=NULL)
return isUInt;
116 unsigned int* ifUInt_;
124 const unsigned int& numChannels,
125 std::vector<std::string>& channelNames);
129 Imf::Header& outHeader,
130 Imf::FrameBuffer& fb,
134 int AddSlice_(Imf::PixelType pt,
136 const int& exrheight,
137 const std::string& channelName,
138 Imf::FrameBuffer& fb,
139 unsigned int channel = 0,
142 void ClearChannels_();
EColorModel
These are the most often used color models.
Imf::PixelType overridePT_
ChannelData(unsigned int *ifUInt)
ChannelData(float *ifFloat)
Methods for reading and writing OpenEXR files into and from BIAS ImageBase.
ChannelData(half *ifHalf)
TypeID Get(float *&ifFloat, half *&ifHalf, unsigned int *&ifUInt) const
std::map< std::string, ChannelData > channels_
This is the base class for images in BIAS.
Used to maintain control of the heap when generating slices.