#include <GrayValue.hpp>
Public Member Functions | |
GrayValue (const GrayValue &value) | |
GrayValue (const Color &c_value) | |
GrayValue (unsigned char value) | |
GrayValue (float_t value) | |
GrayValue & | operator= (GrayValue gray_value) |
GrayValue & | operator= (unsigned char value) |
GrayValue & | operator= (float_t value) |
operator unsigned char () const | |
operator float_t () const |
Objects of this class represent 8-bit pixel values, which are internally stored as an integer from 0 to 255. If GrayValue objects are evalued as floating point objects (by calling operator float_t() or GrayValue(float_t) the value is scaled to the interval [0, 1].
imaging::GrayValue::GrayValue | ( | const GrayValue & | value | ) | [inline] |
Copy constructor.
imaging::GrayValue::GrayValue | ( | const Color & | c_value | ) | [explicit] |
Construct a gray value from the colour value c_value. This function sets the gray value to the average of the red, green and blue values of c_value.
imaging::GrayValue::GrayValue | ( | unsigned char | value | ) | [inline, explicit] |
Construct a gray value from value.
imaging::GrayValue::GrayValue | ( | float_t | value | ) | [inline, explicit] |
Construct a gray value from value. The input value is multiplied by 255 and then converted to an 8-bit value.
Assignement operator.
References _value.
GrayValue& imaging::GrayValue::operator= | ( | unsigned char | value | ) | [inline] |
Assignement operator.
imaging::GrayValue::operator unsigned char | ( | ) | const [inline] |
Type cast to unsigned char.
imaging::GrayValue::operator float_t | ( | ) | const [inline] |
Type cast to float_t. The grayscale value is converted to floating point precision and divided by 255.