17 #ifndef AGXIO_IMAGEVALUEINTERPRETER_H 18 #define AGXIO_IMAGEVALUEINTERPRETER_H 45 size_t pos = (size_t)image->
getWidth() * y + x;
47 return 0.00392156863f * image->
getData()[ pos ];
52 const unsigned char* data = image->
getData();
53 size_t pos = (size_t)image->
getWidth() * y + x;
55 return 0.00392156863f * float(( 77 * data[ pos ] + 150 * data[ pos + 1 ] + 29 * data[ pos + 2 ] ) >> 8);
60 const unsigned char* data = image->
getData();
61 size_t pos = (size_t)image->
getWidth() * y + x;
63 return 0.00392156863f * float(( 77 * data[ pos ] + 150 * data[ pos + 1 ] + 29 * data[ pos + 2 ] ) >> 8);
68 const unsigned char* data = image->
getData();
69 size_t pos = (size_t)image->
getWidth() * y + x;
71 return 0.00392156863f * data[ pos + channel ];
76 unsigned char* data = image->
getData();
77 size_t pos = (size_t)image->
getWidth() * y + x;
79 data[ pos + channel ] = val;
101 bool read(
const std::string& filename );
112 void setMaxValue(
float maxValue );
118 void setMinValue(
float minValue );
123 float getMaxValue()
const;
128 float getMinValue()
const;
138 size_t getImageHeight()
const;
143 size_t getImageWidth()
const;
219 void setValueR(
unsigned char val,
size_t x,
size_t y );
225 void setValueG(
unsigned char val,
size_t x,
size_t y );
231 void setValueB(
unsigned char val,
size_t x,
size_t y );
237 void setValueA(
unsigned char val,
size_t x,
size_t y );
bool AGXPHYSICS_EXPORT read(const std::string &filename, agxStream::SerializablePtrVector &readObjects)
Open and read serializable objects from a file on disk with previously stored objects.
float readSingleChannelValue01(agxIO::Image *image, size_t x, size_t y, size_t channel)
The agxIO namespace contains classes for reading, writing and finding files.
float(* ReadValue01Function)(agxIO::Image *image, size_t x, size_t y)
agx::ref_ptr< PNGImageValueInterpreter > PNGImageValueInterpreterRef
A class holding 4 dimensional vectors and providing basic arithmetic.
ReadValue01Function m_readFunction
#define AGXPHYSICS_EXPORT
Base class providing referencing counted objects.
float cubicValueFunction(float val)
unsigned char * getData()
unsigned int getChannels() const
float quadraticValueFunction(float val)
unsigned int getWidth() const
float readThreeChannelMergedValue01(agxIO::Image *image, size_t x, size_t y)
float readFourChannelMergedValue01(agxIO::Image *image, size_t x, size_t y)
float(* GetValueFunction)(float val)
float linearValueFunction(float val)
float readOneOrTwoChannelValue01(agxIO::Image *image, size_t x, size_t y)
Class to represent Images.
void writeSingleChannelValue01(unsigned char val, agxIO::Image *image, size_t x, size_t y, size_t channel)