Pyro higlevel API
|
Container for bitmap-image data. More...
Public Types | |
enum | { ACCEPT_VIEWS = 0x0001, SHARE_FRAMEBUFFER = 0x0002, NO_ALPHA_CHANNEL = 0x0004 } |
Public Member Functions | |
Bitmap (int nWidth, int nHeight, color_space eColorSpc, uint32 nFlags=SHARE_FRAMEBUFFER) | |
Bitmap constructor. More... | |
Bitmap (int hHandle) | |
Create a bitmap from a handle. More... | |
virtual | ~Bitmap () |
bool | IsValid (void) const |
int | GetHandle (void) const |
Returns the appserver handle. More... | |
color_space | GetColorSpace () const |
Returns the colorspace of the bitmap. More... | |
Rect | GetBounds (void) const |
Returns the bounds of the bitmap. More... | |
int | GetBytesPerRow () const |
Returns the numer of bytes in one bitmap row. More... | |
virtual void | AddChild (View *pcView) |
Adds a view to the bitmap. More... | |
virtual bool | RemoveChild (View *pcView) |
Removes a view from the bitmap. More... | |
View * | FindView (const char *pzName) const |
Returns the view with the given name. More... | |
void | Sync (void) |
Flush rendering operations and wait until they have been finished. More... | |
void | Flush (void) |
Flush rendering operations. More... | |
uint8 * | LockRaster (void) |
Get a pointer to the raw raster data. More... | |
void | UnlockRaster () |
Friends | |
class | View |
class | Window |
class | Sprite |
class | Desktop |
The bitmap class have two different ways to communicate with the application server. If the SHARE_FRAMEBUFFER flag is set the bitmaps raster memory is created in a memory-area shared between the application and the appserver. This makes it possible for the appserver to blit graphics written directly to the bitmaps raster buffer by the application into views on the screen (or inside other bitmaps). If the ACCEPT_VIEWS flag is set the bitmap will accept views to be added much like a os::Window object. All rendering performed by the views will then go into the bitmap's offscreen buffer rather than the screen. The rendered image can then be read out by the application (requiers the SHARE_FRAMEBUFFER flag to be set aswell) or it can be blited into other views. The NO_ALPHA_CHANNEL flag disables the alpha channel for 32 bit bitmaps. This can improve performance if you render to this bitmap.
Bitmap::Bitmap | ( | int | nWidth, |
int | nHeight, | ||
color_space | eColorSpc, | ||
uint32 | nFlags = SHARE_FRAMEBUFFER |
||
) |
nWidth | - Width of the bitmap. |
nHeight | - Height of the bitmap. |
eColorSpc | - ColorSpace of the bitmap |
nFlags | - See description of the class. |
References ACCEPT_VIEWS, os::Application::GetInstance(), SHARE_FRAMEBUFFER, os::Looper::Unlock(), and Window.
Bitmap::Bitmap | ( | int | hHandle | ) |
hHandle | - The appserver handle of the bitmap. |
References os::Application::GetInstance(), and SHARE_FRAMEBUFFER.
|
virtual |
References os::Application::GetInstance().
|
virtual |
pcView | - The view. |
References os::Window::AddChild().
Referenced by os::IconDirectoryView::DragSelection(), os::Slider::FrameSized(), os::BitmapImage::GetView(), os::BitmapImage::Private::SetBitmap(), os::Slider::Slider(), and os::TextEdit::UpdateBackBuffer().
View * Bitmap::FindView | ( | const char * | pzName | ) | const |
References os::Window::FindView().
void Bitmap::Flush | ( | void | ) |
References os::Window::Flush().
Referenced by os::BitmapImage::Flush().
Rect Bitmap::GetBounds | ( | void | ) | const |
Referenced by os::AlertView::AlertView(), os::BitmapImage::AlphaToOverlay(), os::BitmapImage::Private::AssertBitmapFlags(), os::BitmapImage::ColorizeFilter(), os::CheckMenu::Draw(), os::BitmapImage::GetSize(), os::BitmapImage::GetView(), os::BitmapImage::GrayFilter(), os::BitmapImage::HighlightFilter(), os::TreeViewCheckNode::Paint(), os::CheckRow::Paint(), os::AlertView::Paint(), os::TextEdit::Paint(), Scale(), os::BitmapImage::Private::SetBitmap(), and os::TextEdit::UpdateBackBuffer().
int Bitmap::GetBytesPerRow | ( | ) | const |
References os::BitsPerPixel(), os::Rect::left, and os::Rect::right.
Referenced by os::BitmapImage::AlphaToOverlay(), os::BitmapImage::Private::AssertBitmapFlags(), os::BitmapImage::ColorizeFilter(), os::DropdownMenu::DropdownMenu(), os::get_std_bitmap(), os::BitmapImage::GlowFilter(), os::BitmapImage::GrayFilter(), os::BitmapImage::HighlightFilter(), os::BitmapImage::Load(), os::BitmapImage::operator[](), Scale(), os::BitmapImage::SetBitmapData(), and os::Spinner::Spinner().
color_space Bitmap::GetColorSpace | ( | ) | const |
Referenced by os::BitmapImage::Private::AssertBitmapFlags(), and os::BitmapImage::GetColorSpace().
int Bitmap::GetHandle | ( | void | ) | const |
bool os::Bitmap::IsValid | ( | void | ) | const |
|
inline |
Returns | a pointer to the raster data, or NULL if the bitmap was not created with the SHARE_FRAMEBUFFER flag. |
Referenced by os::BitmapImage::AlphaToOverlay(), os::BitmapImage::Private::AssertBitmapFlags(), os::CheckMenu::CheckMenu(), os::CheckRow::CheckRow(), os::BitmapImage::ColorizeFilter(), os::DropdownMenu::DropdownMenu(), os::get_std_bitmap(), os::BitmapImage::GlowFilter(), os::BitmapImage::GrayFilter(), os::BitmapImage::HighlightFilter(), os::BitmapImage::Load(), os::BitmapImage::operator=(), os::BitmapImage::operator[](), os::RadioButton::RadioButton(), os::RadioMenuItem::RadioMenuItem(), os::BitmapImage::Save(), Scale(), os::BitmapImage::SetBitmapData(), os::Spinner::Spinner(), and os::TreeViewCheckNode::TreeViewCheckNode().
|
virtual |
pcView | - The view. |
References os::Window::RemoveChild().
Referenced by os::Slider::FrameSized(), os::BitmapImage::Private::SetBitmap(), os::TextEdit::UpdateBackBuffer(), and os::TextEdit::~TextEdit().
void Bitmap::Sync | ( | void | ) |
References os::Window::Sync().
Referenced by os::IconDirectoryView::DragSelection(), os::Slider::FrameSized(), and os::BitmapImage::Sync().
|
inline |
|
friend |
|
friend |
|
friend |