Class represents packed image plane.
Public Types |
enum | tagFormat {
ImgUNKNOWN = 0,
ImgGray = 1,
ImgRGB,
ImgBGR,
ImgRGB32,
ImgBGR32,
ImgRGBA,
ImgBGRA,
ImgGrayF,
ImgRGBF,
ImgBGRF,
ImgRGBAF,
ImgBGRAF
} |
| This enumeration define packed image plane formats. More...
|
typedef enum
Image_PixMap::tagFormat | ImgFormat |
| This enumeration define packed image plane formats.
|
Public Member Functions |
ImgFormat | Format () const |
Standard_Size | Width () const |
Standard_Size | Height () const |
Standard_Size | SizeX () const |
Standard_Size | SizeY () const |
Standard_Real | Ratio () const |
bool | IsEmpty () const |
| Image_PixMap () |
| Empty constructor. Initialize the NULL image plane.
|
virtual | ~Image_PixMap () |
| Destructor.
|
Quantity_Color | PixelColor (const Standard_Integer theX, const Standard_Integer theY) const |
| Returns the pixel color. This function is relatively slow.
|
Quantity_Color | PixelColor (const Standard_Integer theX, const Standard_Integer theY, Quantity_Parameter &theAlpha) const |
| Returns the pixel color. This function is relatively slow. theAlpha argument is set to color intensity (0 - transparent, 1 - opaque)
|
virtual bool | InitWrapper (ImgFormat thePixelFormat, Standard_Byte *theDataPtr, const Standard_Size theSizeX, const Standard_Size theSizeY, const Standard_Size theSizeRowBytes=0) |
| Initialize image plane as wrapper over alien data. Data will not be copied! Notice that caller should ensure that data pointer will not be released during this wrapper lifetime. You may call InitCopy() to perform data copying.
|
virtual bool | InitTrash (ImgFormat thePixelFormat, const Standard_Size theSizeX, const Standard_Size theSizeY, const Standard_Size theSizeRowBytes=0) |
| Initialize image plane with required dimensions. Memory will be left uninitialized (performance trick).
|
virtual bool | InitCopy (const Image_PixMap &theCopy) |
| Initialize by copying data. If you want to copy alien data you should create wrapper using InitWrapper() before.
|
bool | InitZero (ImgFormat thePixelFormat, const Standard_Size theSizeX, const Standard_Size theSizeY, const Standard_Size theSizeRowBytes=0, const Standard_Byte theValue=0) |
| Initialize image plane with required dimensions. Buffer will be zeroed (black color for most formats).
|
virtual void | Clear (ImgFormat thePixelFormat=ImgGray) |
| Method correctly deallocate internal buffer.
|
bool | IsTopDown () const |
| Returns true if image data stored from Top to the Down (default). Some external APIs can return bottom-up data instead (topmost scanlines starts from the bottom in memory). Notice that access methods within this class automatically convert input row-index to apply this flag! You should use this flag only if interconnect with alien APIs and buffers.
|
void | SetTopDown (bool theIsTopDown) |
| Setup scanlines order in memory - top-down or bottom-up. Drawers should explicitly specify this value if current state IsTopDown() was ignored!
|
Standard_Size | TopDownInc () const |
| Returns +1 if scanlines ordered in Top->Down order in memory and -1 otherwise.
|
const Standard_Byte * | Data () const |
Standard_Byte * | ChangeData () |
const Standard_Byte * | Row (const Standard_Size theRow) const |
Standard_Byte * | ChangeRow (const Standard_Size theRow) |
Standard_Size | SizePixelBytes () const |
Standard_Size | SizeRowBytes () const |
Standard_Size | RowExtraBytes () const |
Standard_Size | MaxRowAligmentBytes () const |
| Compute the maximal row alignment for current row size.
|
Standard_Size | SizeBytes () const |
template<typename ColorType_t > |
Image_PixMapData< ColorType_t > & | EditData () |
| Access image buffer for write/read operations with specified color type.
|
template<typename ColorType_t > |
const Image_PixMapData
< ColorType_t > & | ReadData () const |
| Access image buffer for read operations with specified color type.
|
template<typename ColorType_t > |
const ColorType_t & | Value (const Standard_Size theRow, const Standard_Size theCol) const |
| Access image pixel with specified color type.
|
Static Public Member Functions |
static bool | IsBigEndianHost () |
| Determine Big-Endian at runtime.
|
static Standard_Size | SizePixelBytes (const Image_PixMap::ImgFormat thePixelFormat) |
Protected Member Functions |
void | setFormat (ImgFormat thePixelFormat) |
| Setup pixel format.
|
void | setTopDown () |
| Auxiliary method to setup myTopRowPtr.
|
Protected Attributes |
Image_PixMapData< Standard_Byte > | myData |
ImgFormat | myImgFormat |
| pixel format
|
bool | myIsOwnPointer |
| if data was allocated by this class - flag is true
|