|
ADTF Display Toolbox
|
Image and bitmap handling. More...
Public Types | |
| enum | tPixelFormat { PF_UNKNOWN = 0 , PF_8BIT = 10 , PF_GREYSCALE_8 = 11 , PF_RGB_8 = 12 , PF_16BIT = 20 , PF_GREYSCALE_10 = 21 , PF_GREYSCALE_12 = 22 , PF_GREYSCALE_14 = 23 , PF_GREYSCALE_16 = 24 , PF_RGB_444 = 25 , PF_RGB_555 = 26 , PF_RGB_565 = 27 , PF_RGBA_4444 = 28 , PF_ABGR_4444 = 29 , PF_RIII_10 = 30 , PF_RIII_12 = 31 , PF_RIII_14 = 32 , PF_RIII_16 = 33 , PF_BGR_555 = 34 , PF_BGR_565 = 35 , PF_24BIT = 40 , PF_GREYSCALE_18 = 41 , PF_GREYSCALE_20 = 42 , PF_GREYSCALE_22 = 43 , PF_GREYSCALE_24 = 44 , PF_RGB_888 = 45 , PF_BGR_888 = 46 , PF_32BIT = 50 , PF_ARGB_8888 = 51 , PF_ABGR_8888 = 52 , PF_RGBA_8888 = 53 , PF_BGRA_8888 = 54 , PF_GREYSCALE_32 = 55 , PF_GREYSCALE_FLOAT32 = 56 , PF_YUV420P_888 = 60 , PF_xRGB_8888 = 70 , PF_xBGR_8888 = 71 , PF_RGBx_8888 = 72 , PF_BGRx_8888 = 73 , PF_ARGB_1555 = 74 , PF_RGBA_5551 = 75 , PF_ABGR_1555 = 76 , PF_BGRA_5551 = 77 , PF_CUSTOM = 1000 } |
| The enum ePixelFormat specifies some common pixel formats, that is, descriptions of a byte to color mapping. More... | |
| enum | tLoadFlags { LF_SWAP_RGB = 0x0001 , LF_FLIP_VERTICAL = 0x0002 } |
| The enum tLoadFlags specifies options available for image transformation. More... | |
| enum | tBlitFlags { BLIT_VerticalFlip = 0x01 , BLIT_DontStretch = 0x02 } |
| This enumeration is used for the Blit function. More... | |
Public Member Functions | |
| virtual tVoid | Destroy ()=0 |
| Destroy the instance. | |
| virtual tInt | GetPixelFormat () const =0 |
| Returns the pixel format. More... | |
| virtual tInt | GetWidth () const =0 |
| Returns the width of the image. More... | |
| virtual tInt | GetHeight () const =0 |
| Returns the height of the image. More... | |
| virtual tInt | GetBitsPerPixel () const =0 |
| Returns the bits per pixel of the image. More... | |
| virtual tInt | GetBytesPerLine () const =0 |
| Returns the bytes per line of the image. More... | |
| virtual tInt | GetSize () const =0 |
| Returns the size of the image in bytes. More... | |
| virtual tFloat64 | GetRatio () const =0 |
| Returns the aspect ratio of the image. More... | |
| virtual const tBitmapFormat * | GetFormat () const =0 |
| Returns the current bitmap format of the image. More... | |
| virtual tWin32BitmapInfo * | GetBitmapInfo ()=0 |
| Generates a Win32 image descriptor. More... | |
| virtual tColor * | GetPalette () const =0 |
| Returns the color palette. More... | |
| virtual tInt | GetPaletteSize () const =0 |
| Returns the color palette size. More... | |
| virtual tColor | GetPaletteEntry (tInt nIdx) const =0 |
| Returns a color palette entry. More... | |
| virtual tUInt8 * | GetBitmap () const =0 |
| Returns a pointer to the raw data. More... | |
| virtual tUInt8 * | GetBitmapLine (tInt nY) const =0 |
| Returns a pointer to raw data of a line. More... | |
| virtual tResult | GetBits (tUInt8 *pDestBitmapData, const tBitmapFormat *psDestBitmapFormat, tInt nFlags=0)=0 |
| Retrieves the image's bitmap data. More... | |
Image and bitmap handling.
The Image class encapsulates basic image handling methods.
Definition at line 28 of file image_intf.h.
| enum tBlitFlags |
This enumeration is used for the Blit function.
It specifies additional operations to perform during blit
| Enumerator | |
|---|---|
| BLIT_VerticalFlip | Blit with vertical flip. |
| BLIT_DontStretch | Blit with no stretch and keep width-height-relation of image. |
Definition at line 177 of file image_intf.h.
| enum tLoadFlags |
The enum tLoadFlags specifies options available for image transformation.
| Enumerator | |
|---|---|
| LF_SWAP_RGB | this flag is ignored, since it is not longer needed |
| LF_FLIP_VERTICAL | perform a vertical flip |
Definition at line 166 of file image_intf.h.
| enum tPixelFormat |
The enum ePixelFormat specifies some common pixel formats, that is, descriptions of a byte to color mapping.
Most functions of IImage rely on the pixelformat for pixelconversions and access. Some need a special pixelformat in order to work correctly. Please refer to the documentation of the individual member functions.
Important: You have to know the tPixelformat flips intern the red and blue value of the tPixelformat.
This is because of Little-Endian, so a RGB is intern saved as BGR (Alpha-Channel is seperated).
This is just neccessary if you use methods with tUInt32 as RGBA value.
In the default settings, ADTF uses tPixelformat PF_BGRA_8888 so you can define your color (tUInt32) as RGBA-Type with Byte0=Red, Byte1=Green, Byte2=Blue and Byte3=Alpha_Channel.
Examples for color BlueViolet with RGB(138,43,226) or 0x8A2BE2 (=9055202 dec)
(1) cColor(138, 43, 226) // with default PF_BGRA_8888
(2) cColor::SetRGBA(cColor(138, 43, 226).GetRGBA()) // with default PF_BGRA_8888
(3) cColor::SetRGBA(9055202) // with default PF_BGRA_8888
(4) cColor::SetRGBA(9055202, PF_BGRA_8888)
(5) cColor::SetRGBA(14822282, PF_RGBA_8888)
| Enumerator | |
|---|---|
| PF_UNKNOWN | unknown / not set |
| PF_8BIT | 8 bit |
| PF_GREYSCALE_8 | 8 bit greyscale - default format for 8 bpp |
| PF_RGB_8 | 8 bit RGB (R: 3 bit, G: 3 bit, B: 2 Bit) - palletized 8 bpp format |
| PF_16BIT | 16 bit This definition is a placeholder a 16 Bit format, bitorder is undefined. |
| PF_GREYSCALE_10 | 10 bit greyscale To setup Format use tBitmapFormat::nBitsPerPixel = 16 ! the most significant (upper) bits are valid (11111111 11000000) A_UTILS convert just 8bit greyscales to display this format |
| PF_GREYSCALE_12 | 12 bit greyscale To setup Format use tBitmapFormat::nBitsPerPixel = 16 ! the most significant (upper) bits are valid (11111111 11110000) A_UTILS convert just 8bit greyscales to display this format |
| PF_GREYSCALE_14 | 14 bit greyscale To setup Format use tBitmapFormat::nBitsPerPixel = 16 ! the most significant (upper) bits are valid (11111111 11111100) A_UTILS convert just 8bit greyscales to display this format |
| PF_GREYSCALE_16 | 16 bit greyscale |
| PF_RGB_444 | 12 bit RGB (R: 4 bit, G: 4 bit, B: 4 bit) |
| PF_RGB_555 | 15 bit RGB (R: 5 bit, G: 5 bit, B: 5 bit) - default format for 16 bpp |
| PF_RGB_565 | 16 bit RGB (R: 5 bit, G: 6 bit, B: 5 bit) |
| PF_RGBA_4444 | 16 bit RGBA (R: 4 bit, G: 4 bit, B: 4 bit, A: 4 bit) with alpha value |
| PF_ABGR_4444 | 16 bit ABGR (A: 4 bit, B: 4 bit, G: 4 bit, R: 4 bit) with alpha value - inverted RGBA |
| PF_24BIT | 24 bit This definition is a placeholder a 24 Bit format, bitorder is undefined. |
| PF_GREYSCALE_24 | 24 bit greyscale |
| PF_RGB_888 | 24 bit RGB (R: 8 bit, G: 8 bit, B: 8 bit) - default format for 24 bpp |
| PF_BGR_888 | 24 bit BGR (B: 8 bit, G: 8 bit, R: 8 bit) - inverted RGB |
| PF_32BIT | 32 bit This definition is a placeholder a 32 Bit format, bitorder is undefined. |
| PF_ARGB_8888 | 32 bit ARGB (A: 8 bit, R: 8 bit, G: 8 bit, B: 8 bit) with alpha value |
| PF_ABGR_8888 | 32 bit ABGR (A: 8 bit, B: 8 bit, G: 8 bit, R: 8 bit) with alpha value - inverted RGBA |
| PF_RGBA_8888 | 32 bit RGBA (R: 8 bit, G: 8 bit, B: 8 bit, A: 8 bit) with alpha value - default format for 32 bpp |
| PF_BGRA_8888 | 32 bit BGRA (B: 8 bit, G: 8 bit, R: 8 bit, A: 8 bit) with alpha value - inverted RGB + A |
| PF_GREYSCALE_32 | 32 bit greyscale |
| PF_GREYSCALE_FLOAT32 | 32 bit greyscale float value |
| PF_YUV420P_888 | 24 bit YUV (Y: 8 bit, U: 8 bit, V: 8 bit) - Y = luminance, U+V = chrominance If using this format in the VideoDisplay a conversion to RBG will be done. This is not very performant! |
| PF_xRGB_8888 | 32 bit aligned memory with only 24 Bit valid RGB data. A=255. |
| PF_xBGR_8888 | 32 bit aligned memory with only 24 Bit valid RGB data. A=255. |
| PF_RGBx_8888 | 32 bit aligned memory with only 24 Bit valid RGB data. A=255. |
| PF_BGRx_8888 | 32 bit aligned memory with only 24 Bit valid RGB data. A=255. |
| PF_ARGB_1555 | 16 bit ARGB (R: 5 bit, G: 5 bit, B: 5 bit, Alpha:1bit) |
| PF_RGBA_5551 | 16 bit RGBA (R: 5 bit, G: 5 bit, B: 5 bit, Alpha:1bit) |
| PF_ABGR_1555 | 16 bit ABGR (R: 5 bit, G: 5 bit, B: 5 bit, Alpha:1bit) |
| PF_BGRA_5551 | 16 bit BGRA (R: 5 bit, G: 5 bit, B: 5 bit, Alpha:1bit) |
| PF_CUSTOM | custom |
Definition at line 54 of file image_intf.h.
|
pure virtual |
Returns a pointer to the raw data.
| tUInt8* | pointer to the raw data. |
| NULL | image is not initialised. |
Implemented in cImage.
|
pure virtual |
Generates a Win32 image descriptor.
The GetBitmapInfo method generates a Win32 image descriptor structure.
Implemented in cImage.
|
pure virtual |
Returns a pointer to raw data of a line.
Get the specified line of the bitmap. Use this function rather than calculating the line yourself, since the actual linewidth might vary due to stuffing bytes!
| nY | [in] The line number, starting at 0. |
| tUInt8* | pointer to raw data of a line |
| NULL | if index is out of bounds |
Implemented in cImage.
|
pure virtual |
Retrieves the image's bitmap data.
The GetBits method retrieves the image's bitmap data.
| pDestBitmapData | [in] Specifies the destination bitmap data. |
| psDestBitmapFormat | [in] Specifies the destination bitmap format. |
| nFlags | [in] Flags, see cImage::tBlitFlags |
| ERR_NOERROR | all went well. |
| ERR_POINTER | oSrcBitmapData or pSrcBitmapFormat is NULL |
Implemented in cImage.
|
pure virtual |
Returns the bits per pixel of the image.
Implemented in cImage.
|
pure virtual |
Returns the bytes per line of the image.
Since the actual linewidth may be bigger than the with of the image * bytesperpixel, use this function to retrieve the actual line width including stuffing bytes
Implemented in cImage.
|
pure virtual |
Returns the current bitmap format of the image.
Implemented in cImage.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Returns a color palette entry.
| nIdx | [in] The index of the entry, starting at 0. |
Implemented in cImage.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Returns the size of the image in bytes.
Implemented in cImage.
|
pure virtual |