![]() |
KSquare Utilities
|
Used by the Raster Class to represent the contents of one pixel. More...
#include <PixelValue.h>
Public Member Functions | |
| PixelValue () | |
| Constructs a 'PixelValue' instance from the the three provided values. More... | |
| PixelValue (uchar _r, uchar _g, uchar _b) | |
| Constructs a 'PixelValue' instance using the provided values for the color components. More... | |
| PixelValue (const PixelValue &pixelValue) | |
| bool | operator!= (const PixelValue &right) const |
| PixelValue | operator* (double fact) const |
| PixelValue & | operator= (const PixelValue &right) |
| bool | operator== (const PixelValue &right) const |
| void | ToHSI (float &hue, float &sat, float &intensity) const |
| Computes the equivalent HSI values; RGB -> HSI. More... | |
| KKStr | ToStr () const |
| Creates a displayable string reflecting the values of the three RGB components. More... | |
Static Public Member Functions | |
| static PixelValue | FromHSI (float hue, float sat, float intensity) |
| Will create an instance of PixelValue from the HSI values provided (HSI -> RGB). More... | |
Public Attributes | |
| uchar | b |
| uchar | g |
| uchar | r |
Static Public Attributes | |
| static PixelValue | Aqua |
| static PixelValue | Black |
| static PixelValue | Blue |
| static PixelValue | Brown |
| static PixelValue | Cyan |
| static PixelValue | FireBrick |
| static PixelValue | Green |
| static PixelValue | Indigo |
| static PixelValue | Magenta |
| static PixelValue | Orange |
| static PixelValue | Pink |
| static PixelValue | Purple |
| static PixelValue | Red |
| static PixelValue | Teal |
| static PixelValue | Violet |
| static PixelValue | White |
| static PixelValue | Yellow |
Used by the Raster Class to represent the contents of one pixel.
There are several predefined colors to pick from or you can work with the individual color channels separately.
Definition at line 22 of file PixelValue.h.
| PixelValue::PixelValue | ( | ) |
Constructs a 'PixelValue' instance from the the three provided values.
Definition at line 44 of file PixelValue.cpp.
Constructs a 'PixelValue' instance using the provided values for the color components.
Definition at line 60 of file PixelValue.cpp.
Referenced by KKB::SegmentorOTSU::ClassAverageRGB(), KKB::Chart::CreateRaster(), FromHSI(), operator*(), and KKB::Raster::ThresholdInHSI().
| PixelValue::PixelValue | ( | const PixelValue & | pixelValue | ) |
|
static |
Will create an instance of PixelValue from the HSI values provided (HSI -> RGB).
Used "http://www.codeguru.com/forum/archive/index.php/t-134892.html" for inspiration.
| [in] | hue | Angle between 0 and (2 x Pi). |
| [in] | sat | Saturation of color, a number between 0.0 and 1.0. |
| [in] | intensity | Intensity. |
Definition at line 133 of file PixelValue.cpp.
References Black, and PixelValue().
Referenced by KKB::Raster::CreateColor(), and KKB::Raster::CreateColorImageFromLabels().
| bool PixelValue::operator!= | ( | const PixelValue & | right | ) | const |
Definition at line 95 of file PixelValue.cpp.
| PixelValue PixelValue::operator* | ( | double | fact | ) | const |
Will multiply the individual color channels by the right operand and return the resultant new PixelValue.
Definition at line 78 of file PixelValue.cpp.
References b, g, PixelValue(), and r.
| PixelValue & PixelValue::operator= | ( | const PixelValue & | right | ) |
Definition at line 66 of file PixelValue.cpp.
Referenced by KKB::Raster::CreateColor(), KKB::Raster::CreateColorImageFromLabels(), and KKB::Raster::CreateColorWithBlobsLabeldByColor().
| bool PixelValue::operator== | ( | const PixelValue & | right | ) | const |
Definition at line 88 of file PixelValue.cpp.
| void PixelValue::ToHSI | ( | float & | hue, |
| float & | sat, | ||
| float & | intensity | ||
| ) | const |
Computes the equivalent HSI values; RGB -> HSI.
Used "http://www.codeguru.com/forum/archive/index.php/t-134892.html" for inspiration.
| [out] | hue | Angle in radians. |
| [out] | sat | Saturation between 0.0 and 1.0. |
| [out] | intensity | Intensity between 0.0 and 1.0. |
Definition at line 102 of file PixelValue.cpp.
Referenced by KKB::Raster::ThresholdInHSI().
| KKStr PixelValue::ToStr | ( | ) | const |
Creates a displayable string reflecting the values of the three RGB components.
Definition at line 237 of file PixelValue.cpp.
References b, KKB::KKStr::Concat(), g, KKB::KKStr::operator+(), KKB::operator+(), r, and KKB::StrFormatInt().
|
static |
Definition at line 34 of file PixelValue.h.
| uchar KKB::PixelValue::b |
Definition at line 54 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorImageFromLabels(), KKB::Raster::DrawConnectedPointList(), KKB::Raster::DrawLine(), KKB::Raster::DrawPointList(), KKB::Raster::FillRectangle(), KKB::Raster::GetPixelValue(), operator!=(), operator*(), operator=(), operator==(), PixelValue(), KKB::Raster::SetPixelValue(), ToHSI(), and ToStr().
|
static |
Definition at line 35 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorImageFromLabels(), and FromHSI().
|
static |
Definition at line 36 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorWithBlobsLabeldByColor().
|
static |
Definition at line 37 of file PixelValue.h.
|
static |
Definition at line 38 of file PixelValue.h.
|
static |
Definition at line 39 of file PixelValue.h.
| uchar KKB::PixelValue::g |
Definition at line 53 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorImageFromLabels(), KKB::Raster::DrawConnectedPointList(), KKB::Raster::DrawLine(), KKB::Raster::DrawPointList(), KKB::Raster::FillRectangle(), KKB::Raster::GetPixelValue(), operator!=(), operator*(), operator=(), operator==(), PixelValue(), KKB::Raster::SetPixelValue(), ToHSI(), and ToStr().
|
static |
Definition at line 40 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorWithBlobsLabeldByColor().
|
static |
Definition at line 41 of file PixelValue.h.
|
static |
Definition at line 42 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorWithBlobsLabeldByColor().
|
static |
Definition at line 43 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorWithBlobsLabeldByColor().
|
static |
Definition at line 44 of file PixelValue.h.
|
static |
Definition at line 45 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorWithBlobsLabeldByColor().
| uchar KKB::PixelValue::r |
Definition at line 52 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorImageFromLabels(), KKB::Raster::DrawConnectedPointList(), KKB::Raster::DrawLine(), KKB::Raster::DrawPointList(), KKB::Raster::FillRectangle(), KKB::Raster::GetPixelValue(), operator!=(), operator*(), operator=(), operator==(), PixelValue(), KKB::Raster::SetPixelValue(), ToHSI(), and ToStr().
|
static |
Definition at line 46 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorWithBlobsLabeldByColor().
|
static |
Definition at line 47 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorWithBlobsLabeldByColor().
|
static |
Definition at line 48 of file PixelValue.h.
|
static |
Definition at line 49 of file PixelValue.h.
Referenced by KKB::Raster::CreateColor().
|
static |
Definition at line 50 of file PixelValue.h.
Referenced by KKB::Raster::CreateColorWithBlobsLabeldByColor().