|
AGX Dynamics 2.42.3.1
|
#include <ImageValueInterpreter.h>
Inheritance diagram for agxIO::PNGImageValueInterpreter:Public Member Functions | |
| PNGImageValueInterpreter () | |
| Default constructor. | |
| PNGImageValueInterpreter (float minValue, float maxValue) | |
| Construct given minimum- and maximum value. | |
| agxIO::Image * | getImage () const |
| size_t | getImageHeight () const |
| size_t | getImageWidth () const |
| float | getMaxValue () const |
| float | getMinValue () const |
| float | getValue (size_t x, size_t y, GetValueFunction func=linearValueFunction) const |
| Reads image at pixel (x,y) and returns value between given minimum and maximum. | |
| float | getValueA (size_t x, size_t y, GetValueFunction func=linearValueFunction) const |
| Reads single "Alpha" channel at pixel (x,y) and returns value between given minimum and maximum. | |
| float | getValueB (size_t x, size_t y, GetValueFunction func=linearValueFunction) const |
| Reads single "Blue" channel at pixel (x,y) and returns value between given minimum and maximum. | |
| float | getValueG (size_t x, size_t y, GetValueFunction func=linearValueFunction) const |
| Reads single "Green" channel at pixel (x,y) and returns value between given minimum and maximum. | |
| float | getValueR (size_t x, size_t y, GetValueFunction func=linearValueFunction) const |
| Reads single "Red" channel at pixel (x,y) and returns value between given minimum and maximum. | |
| agx::Vec3f | getValueRGB (size_t x, size_t y, GetValueFunction func=linearValueFunction) const |
| Reads R, G, and B channels and returns Vec3f with result at pixel (x,y). | |
| agx::Vec4f | getValueRGBA (size_t x, size_t y, GetValueFunction func=linearValueFunction) const |
| Reads R, G, B and A channels and returns Vec4f with result at pixel (x,y). | |
| bool | read (const std::string &filename) |
| Read PNG image. | |
| void | setMaxValue (float maxValue) |
| Set new maximum value for the accessors methods (i.e., channel value = 255 => maximum value). | |
| void | setMinValue (float minValue) |
| Set new minimum value for the accessors methods (i.e., channel value = 0 => minimum value). | |
| void | setValueA (unsigned char val, size_t x, size_t y) |
| Set current value to the "Alpha" channel. | |
| void | setValueB (unsigned char val, size_t x, size_t y) |
| Set current value to the "Blue" channel. | |
| void | setValueG (unsigned char val, size_t x, size_t y) |
| Set current value to the "Green" channel. | |
| void | setValueR (unsigned char val, size_t x, size_t y) |
| Set current value to the "Red" channel. | |
| bool | valid () const |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Protected Member Functions | |
| virtual | ~PNGImageValueInterpreter () |
| Reference counted object. | |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Attributes | |
| agxIO::ImageRef | m_image |
| float | m_maxValue |
| float | m_minValue |
| ReadValue01Function | m_readFunction |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Definition at line 82 of file ImageValueInterpreter.h.
| agxIO::PNGImageValueInterpreter::PNGImageValueInterpreter | ( | ) |
Default constructor.
Minimum value set to 0 and maximum value to 1.
| agxIO::PNGImageValueInterpreter::PNGImageValueInterpreter | ( | float | minValue, |
| float | maxValue | ||
| ) |
Construct given minimum- and maximum value.
| minValue | - minimum value when image channel value is zero |
| maxValue | - maximum value when image channel value is 255 |
|
protectedvirtual |
Reference counted object.
Protected destructor.
| agxIO::Image * agxIO::PNGImageValueInterpreter::getImage | ( | ) | const |
| size_t agxIO::PNGImageValueInterpreter::getImageHeight | ( | ) | const |
| size_t agxIO::PNGImageValueInterpreter::getImageWidth | ( | ) | const |
| float agxIO::PNGImageValueInterpreter::getMaxValue | ( | ) | const |
| float agxIO::PNGImageValueInterpreter::getMinValue | ( | ) | const |
| float agxIO::PNGImageValueInterpreter::getValue | ( | size_t | x, |
| size_t | y, | ||
| GetValueFunction | func = linearValueFunction |
||
| ) | const |
Reads image at pixel (x,y) and returns value between given minimum and maximum.
Alpha channel is ignored for any PNG with alpha (i.e., 2 or 4). For 3 and 4 channels the RGB channels are merged to a gray scale single value and passed to GetValueFunction func.
| x | - pixel at column x |
| y | - pixel at row y |
| func | - function taking a value from 0 to 1 following a given mathematical function (e.g., linear, quadratic, cubic etc) |
| float agxIO::PNGImageValueInterpreter::getValueA | ( | size_t | x, |
| size_t | y, | ||
| GetValueFunction | func = linearValueFunction |
||
| ) | const |
Reads single "Alpha" channel at pixel (x,y) and returns value between given minimum and maximum.
The PNG has to have either two or four channels for the value to be valid. E.g., if three channels, value of G will be calculated (offset = numChannels - 1). Asserts if number of channels is 1 or 3, but make sure you have the correct number of channels when calling this method.
| x | - pixel at column x |
| y | - pixel at row y |
| func | - function taking a value from 0 to 1 following a given mathematical function (e.g., linear, quadratic, cubic etc) |
| float agxIO::PNGImageValueInterpreter::getValueB | ( | size_t | x, |
| size_t | y, | ||
| GetValueFunction | func = linearValueFunction |
||
| ) | const |
Reads single "Blue" channel at pixel (x,y) and returns value between given minimum and maximum.
The PNG has to have at least three channels for valid calls to this method.
| x | - pixel at column x |
| y | - pixel at row y |
| func | - function taking a value from 0 to 1 following a given mathematical function (e.g., linear, quadratic, cubic etc) |
| float agxIO::PNGImageValueInterpreter::getValueG | ( | size_t | x, |
| size_t | y, | ||
| GetValueFunction | func = linearValueFunction |
||
| ) | const |
Reads single "Green" channel at pixel (x,y) and returns value between given minimum and maximum.
If the PNG has two channels, the alpha channel will be used here (i.e., same result as calling getValueA).
| x | - pixel at column x |
| y | - pixel at row y |
| func | - function taking a value from 0 to 1 following a given mathematical function (e.g., linear, quadratic, cubic etc) |
| float agxIO::PNGImageValueInterpreter::getValueR | ( | size_t | x, |
| size_t | y, | ||
| GetValueFunction | func = linearValueFunction |
||
| ) | const |
Reads single "Red" channel at pixel (x,y) and returns value between given minimum and maximum.
| x | - pixel at column x |
| y | - pixel at row y |
| func | - function taking a value from 0 to 1 following a given mathematical function (e.g., linear, quadratic, cubic etc) |
| agx::Vec3f agxIO::PNGImageValueInterpreter::getValueRGB | ( | size_t | x, |
| size_t | y, | ||
| GetValueFunction | func = linearValueFunction |
||
| ) | const |
Reads R, G, and B channels and returns Vec3f with result at pixel (x,y).
| x | - pixel at column x |
| y | - pixel at row y |
| func | - function taking a value from 0 to 1 following a given mathematical function (e.g., linear, quadratic, cubic etc) |
| agx::Vec4f agxIO::PNGImageValueInterpreter::getValueRGBA | ( | size_t | x, |
| size_t | y, | ||
| GetValueFunction | func = linearValueFunction |
||
| ) | const |
Reads R, G, B and A channels and returns Vec4f with result at pixel (x,y).
I.e., the PNG has to have four channels for the values to be valid.
| x | - pixel at column x |
| y | - pixel at row y |
| func | - function taking a value from 0 to 1 following a given mathematical function (e.g., linear, quadratic, cubic etc) |
| bool agxIO::PNGImageValueInterpreter::read | ( | const std::string & | filename | ) |
Read PNG image.
Searches agx paths.
| void agxIO::PNGImageValueInterpreter::setMaxValue | ( | float | maxValue | ) |
Set new maximum value for the accessors methods (i.e., channel value = 255 => maximum value).
| maxValue | - maximum value |
| void agxIO::PNGImageValueInterpreter::setMinValue | ( | float | minValue | ) |
Set new minimum value for the accessors methods (i.e., channel value = 0 => minimum value).
| minValue | - minimum value |
| void agxIO::PNGImageValueInterpreter::setValueA | ( | unsigned char | val, |
| size_t | x, | ||
| size_t | y | ||
| ) |
Set current value to the "Alpha" channel.
| void agxIO::PNGImageValueInterpreter::setValueB | ( | unsigned char | val, |
| size_t | x, | ||
| size_t | y | ||
| ) |
Set current value to the "Blue" channel.
| void agxIO::PNGImageValueInterpreter::setValueG | ( | unsigned char | val, |
| size_t | x, | ||
| size_t | y | ||
| ) |
Set current value to the "Green" channel.
| void agxIO::PNGImageValueInterpreter::setValueR | ( | unsigned char | val, |
| size_t | x, | ||
| size_t | y | ||
| ) |
Set current value to the "Red" channel.
| bool agxIO::PNGImageValueInterpreter::valid | ( | ) | const |
|
protected |
Definition at line 246 of file ImageValueInterpreter.h.
|
protected |
Definition at line 248 of file ImageValueInterpreter.h.
|
protected |
Definition at line 247 of file ImageValueInterpreter.h.
|
protected |
Definition at line 249 of file ImageValueInterpreter.h.