Pebble Foundation Classes  0.2.0
C++ for Pebble
Pebble::GBitmapBase Class Reference
Inheritance diagram for Pebble::GBitmapBase:
Collaboration diagram for Pebble::GBitmapBase:

Public Member Functions

 operator::GBitmap * () const
 Instances of this class can be automatically converted to Pebble gbitmap pointer.
 
virtual ~GBitmapBase ()
 Destructor.
 
uint16_t GetBytesPerRow () const
 
GBitmapFormat GetFormat () const
 
uint8_t * GetData () const
 
GRect GetBounds () const
 
GColorGetPalette () const
 

Protected Member Functions

 GBitmapBase ()
 Cannot construct.
 
 GBitmapBase (::GBitmap *gbitmap)
 Wrap a Pebble bitmap.
 

Protected Attributes

::GBitmapgbitmap_
 

Friends

class GBitmap
 

Member Function Documentation

◆ GetBounds()

GRect Pebble::GBitmapBase::GetBounds ( ) const
inline

Gets the bounds of the content for the GBitmap. This is set when loading the image or if changed by gbitmap_set_bounds.

Returns
The bounding box for the GBitmap.
See also
SetBounds

◆ GetBytesPerRow()

uint16_t Pebble::GBitmapBase::GetBytesPerRow ( ) const
inline

Get the number of bytes per row in the bitmap data for the given GBitmap. On rectangular displays, this can be used as a safe way of iterating over the rows in the bitmap, since bytes per row should be set according to format. On circular displays with pixel format of GBitmapFormat8BitCircular this will return 0, and should not be used for iteration over frame buffer pixels. Instead, use GBitmapDataRowInfo, which provides safe minimum and maximum x values for a given row's y value.

Returns
The number of bytes per row of the GBitmap
See also
GetData

◆ GetData()

uint8_t* Pebble::GBitmapBase::GetData ( ) const
inline

Get a pointer to the raw image data section of the given GBitmap as specified by the format of the bitmap.

Returns
pointer to the raw image data for the GBitmap
See also
GetBytesPerRow
GBitmap

◆ GetFormat()

GBitmapFormat Pebble::GBitmapBase::GetFormat ( ) const
inline

Get the GBitmapFormat for the GBitmap.

Returns
The format of the given GBitmap.

◆ GetPalette()

GColor* Pebble::GBitmapBase::GetPalette ( ) const
inline

Get the palette for the given GBitmap.

Returns
Pointer to a GColor array containing the palette colors.
See also
gbitmap_set_palette

The documentation for this class was generated from the following file: