 |
AGX Dynamics
2.38.0.2
|
Go to the documentation of this file.
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 );
unsigned int getChannels() const
float readThreeChannelMergedValue01(agxIO::Image *image, size_t x, size_t y)
float readSingleChannelValue01(agxIO::Image *image, size_t x, size_t y, size_t channel)
unsigned char * getData()
float(* GetValueFunction)(float val)
unsigned int getWidth() const
A class holding 4 dimensional vectors and providing basic arithmetic.
float linearValueFunction(float val)
ReadValue01Function m_readFunction
#define AGXPHYSICS_EXPORT
void writeSingleChannelValue01(unsigned char val, agxIO::Image *image, size_t x, size_t y, size_t channel)
float cubicValueFunction(float val)
float readFourChannelMergedValue01(agxIO::Image *image, size_t x, size_t y)
Class to represent Images.
Base class providing referencing counted objects.
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 readOneOrTwoChannelValue01(agxIO::Image *image, size_t x, size_t y)
float(* ReadValue01Function)(agxIO::Image *image, size_t x, size_t y)
float quadraticValueFunction(float val)
agx::ref_ptr< PNGImageValueInterpreter > PNGImageValueInterpreterRef
The agxIO namespace contains classes for reading, writing and finding files.