Inheritance diagram for os::BitmapImage:
Public Member Functions | |
BitmapImage (uint32 nFlags=Bitmap::SHARE_FRAMEBUFFER) | |
Default constructor. | |
BitmapImage (const BitmapImage &cSource, uint32 nFlags=Bitmap::SHARE_FRAMEBUFFER) | |
Copy constructor. | |
BitmapImage (StreamableIO *pcSource, uint32 nFlags=Bitmap::SHARE_FRAMEBUFFER) | |
Constructor. | |
BitmapImage (const uint8 *pData, const IPoint &cSize, color_space eColorSpace, uint32 nFlags=Bitmap::SHARE_FRAMEBUFFER) | |
Constructor. | |
virtual | ~BitmapImage () |
virtual const String | ImageType (void) const |
Get object type. | |
virtual bool | IsValid (void) const |
Find out if the bitmap object is valid. | |
virtual status_t | Load (StreamableIO *pcSource, const String &cType="") |
Load bitmap from a stream (file, memory, resource etc. | |
virtual status_t | Save (StreamableIO *pcDest, const String &cType) |
Write bitmap to a stream. | |
virtual void | Draw (const Point &cPos, View *pcView) |
Draw an image to a View. | |
virtual void | Draw (const Rect &cSource, const Rect &cDest, View *pcView) |
Draw an image to a View. | |
virtual status_t | SetSize (const Point &cSize) |
Scale the bitmap. | |
virtual Point | GetSize (void) const |
Get bitmap size. | |
void | SetBitmapData (const uint8 *pData, const IPoint &cSize, color_space eColorSpace, uint32 nFlags=Bitmap::SHARE_FRAMEBUFFER) |
Set raw bitmap data. | |
color_space | GetColorSpace () const |
Get bitmap colour space. | |
virtual status_t | SetColorSpace (color_space eColorSpace) |
Set colour space. | |
virtual Bitmap * | LockBitmap (void) |
Lock the internal Bitmap object. | |
virtual void | UnlockBitmap (void) |
Unlock the internal Bitmap object. | |
virtual BitmapImage & | operator= (const BitmapImage &cSource) |
Copy the contents of another bitmap. | |
virtual View * | GetView () |
Obtain a View for rendering into the bitmap. | |
virtual void | ResizeCanvas (const Point &cSize) |
Change the size of the bitmap. | |
virtual uint32 * | operator[] (int row) |
Direct access to pixels. | |
void | Sync () |
Flush the render queue, and wait til the rendering is done. | |
void | Flush () |
Flush the render queue. | |
virtual status_t | ApplyFilter (const Message &cFilterData) |
status_t | GrayFilter (void) |
Create a greyed image. | |
status_t | HighlightFilter (void) |
Make the image highlighted. | |
status_t | AlphaToOverlay (uint32 cTransparentColor) |
Convert alpha channel to overlay. | |
status_t | GlowFilter (Color32_s cInnerColor, Color32_s cOuterColor, int nRadius) |
Add glow effect to the image. | |
status_t | ColorizeFilter (Color32_s cColor) |
Classes | |
class | Private |
File cFile( "picture.png" ); Image *pcImage; pcImage = new BitmapImage( &cFile ); // Load picture.png pcImage->GrayFilter();
BitmapImage::BitmapImage | ( | uint32 | nFlags = Bitmap::SHARE_FRAMEBUFFER |
) |
nFlags | Bitmap flags, see os::Bitmap. |
BitmapImage::BitmapImage | ( | const BitmapImage & | cSource, | |
uint32 | nFlags = Bitmap::SHARE_FRAMEBUFFER | |||
) |
cSource | Original BitmapImage object to copy. | |
nFlags | Bitmap flags, see os::Bitmap. |
BitmapImage::BitmapImage | ( | StreamableIO * | pcSource, | |
uint32 | nFlags = Bitmap::SHARE_FRAMEBUFFER | |||
) |
pcSource | A pointer to a StreamableIO object. Could be a file, a resource or any data source that can be represented as a stream of data. The Translator API is used to try to recognize the format and load it as bitmap data. If you need to explicitly specify the file format, use Load(). | |
nFlags | Bitmap flags, see os::Bitmap. |
BitmapImage::BitmapImage | ( | const uint8 * | pData, | |
const IPoint & | cSize, | |||
color_space | eColorSpace, | |||
uint32 | nFlags = Bitmap::SHARE_FRAMEBUFFER | |||
) |
pData | Pointer to an array of raw bitmap data. | |
cSize | The size of the bitmap in pixels. | |
eColorSpace | Color space, for instance CS_RGB32. | |
nFlags | Bitmap flags, see os::Bitmap. |
BitmapImage::~BitmapImage | ( | ) | [virtual] |
const String BitmapImage::ImageType | ( | void | ) | const [virtual] |
Implements os::Image.
bool BitmapImage::IsValid | ( | void | ) | const [virtual] |
Implements os::Image.
status_t BitmapImage::Load | ( | StreamableIO * | pcSource, | |
const String & | cType = "" | |||
) | [virtual] |
).
pcSource | A pointer to a StreamableIO object. Could be a file, a resource or any data source that can be represented as a stream of data. The Translator API is used to try to recognize the format and load it as bitmap data. | |
cType | Used to specify a specific file format, if the automatic recognition is not enough. |
File cFile( "picture.png" ); myImage->Load( &cFile, "image/png" );
Implements os::Image.
status_t BitmapImage::Save | ( | StreamableIO * | pcDest, | |
const String & | cType | |||
) | [virtual] |
pcDest | A pointer to a StreamableIO object. | |
cType | String that describes the file format, eg "image/png". |
File cFile( "picture.png" ); myImage->Save( &cFile, "image/png" );
Implements os::Image.
cSource | Rectangular region in the source Image to draw. | |
cDest | Rectangular region in the destination View to draw the image in. If the size of cDest is not equal to cSource, the image data from cSource will be scaled to fit. | |
pcView | The View to draw in. |
Implements os::Image.
status_t BitmapImage::SetSize | ( | const Point & | cSize | ) | [virtual] |
cSize | The new size. |
Reimplemented from os::Image.
Point BitmapImage::GetSize | ( | void | ) | const [virtual] |
void BitmapImage::SetBitmapData | ( | const uint8 * | pData, | |
const IPoint & | cSize, | |||
color_space | eColorSpace, | |||
uint32 | nFlags = Bitmap::SHARE_FRAMEBUFFER | |||
) |
pData | Pointer to an array of raw bitmap data. | |
cSize | The size of the bitmap in pixels. | |
eColorSpace | Color space, for instance CS_RGB32. | |
nFlags | Bitmap flags, see os::Bitmap. SHARE_FRAMEBUFFER is assumed. |
color_space BitmapImage::GetColorSpace | ( | ) | const |
The | bitmap's colour space, one of the values in os::color_space. |
status_t BitmapImage::SetColorSpace | ( | color_space | eColorSpace | ) | [virtual] |
eColorSpace | The colour space, eg. CS_RGB32. |
0 | for success, -1 for failure. |
Bitmap * BitmapImage::LockBitmap | ( | void | ) | [virtual] |
Bitmap *myBitmap = myImage->LockBitmap();
if( myBitmap ) {
...
myImage->UnlockBitmap();
}
Pointer | to the locked Bitmap. If the internal Bitmap is not valid, returns NULL (see IsValid()). |
void BitmapImage::UnlockBitmap | ( | void | ) | [virtual] |
BitmapImage & BitmapImage::operator= | ( | const BitmapImage & | cSource | ) | [virtual] |
View * BitmapImage::GetView | ( | ) | [virtual] |
The BitmapImage should be initialized with the flag ACCEPT_VIEWS. If it isn't, GetView() will try to re-allocate the bitmap, changing this flag.
void BitmapImage::ResizeCanvas | ( | const Point & | cSize | ) | [virtual] |
uint32 * BitmapImage::operator[] | ( | int | row | ) | [virtual] |
void BitmapImage::Sync | ( | void | ) |
void BitmapImage::Flush | ( | void | ) |
status_t BitmapImage::ApplyFilter | ( | const Message & | cFilterData | ) | [virtual] |
Reimplemented from os::Image.
status_t BitmapImage::GrayFilter | ( | void | ) |
status_t BitmapImage::HighlightFilter | ( | void | ) |
status_t BitmapImage::AlphaToOverlay | ( | uint32 | cTransparentColor | ) |
cTransparentColor | The colour that will be transparent. Typically you will use the default, TRANSPARENT_RGB32. |
cInnerColor | The colour nearest the edge of the picture. | |
cOuterColor | The colour at the edge of the glow. Tip: set a low opacity here, to blend the glow with the background. | |
nRadius | The width of the glow. |
status_t BitmapImage::ColorizeFilter | ( | Color32_s | cColor | ) |