Pebble Foundation Classes
0.2.0
C++ for Pebble
|
26 inline bool operator!= (
const ::GSize& size)
const {
return !(*
this == size); }
95 GRect(int16_t x, int16_t y, int16_t w, int16_t h) {
226 operator ::GBitmap*()
const {
return gbitmap_; }
302 gbitmap_ = that.gbitmap_;
314 inline bool IsValid() {
return gbitmap_ !=
nullptr; }
330 that.gbitmap_ =
nullptr;
336 std::swap(gbitmap_, that.gbitmap_);
343 std::swap(gbitmap_, that.gbitmap_);
GBitmap(::GBitmap *gbitmap)
Wrap a Pebble bitmap.
Definition: pebble_graphics_types.hpp:290
void grect_clip(GRect *const rect_to_clip, const GRect *const rect_clipper)
static GOwnedBitmap CreateFromPngData(const uint8_t *png_data, size_t png_data_size)
Definition: pebble_graphics_types.hpp:385
GRect(GPoint origin, GSize size)
Definition: pebble_graphics_types.hpp:114
GBitmap * gbitmap_create_with_data(const uint8_t *data)
GRect()
Constructs an empty GRect.
Definition: pebble_graphics_types.hpp:79
GRect(int16_t x, int16_t y, int16_t w, int16_t h)
Definition: pebble_graphics_types.hpp:95
GOwnedBitmap(::GBitmap *bitmap)
Create bitmap as sub bitmap.
Definition: pebble_graphics_types.hpp:475
bool operator==(const ::GRect &rect) const
Definition: pebble_graphics_types.hpp:132
uint16_t GetBytesPerRow() const
Definition: pebble_graphics_types.hpp:241
GBitmap * gbitmap_create_blank(GSize size, GBitmapFormat format)
GRect CenterFromPolar(GOvalScaleMode scale_mode, int32_t angle, GSize size)
Definition: pebble_graphics_types.hpp:215
GBitmapBase(::GBitmap *gbitmap)
Wrap a Pebble bitmap.
Definition: pebble_graphics_types.hpp:272
static GOwnedBitmap CreateWithData(const uint8_t *data)
Definition: pebble_graphics_types.hpp:419
virtual ~GOwnedBitmap()
Destroy the bitmap if pointer provided.
Definition: pebble_graphics_types.hpp:348
bool gsize_equal(const GSize *size_a, const GSize *size_b)
GRect grect_crop(GRect rect, const int32_t crop_size_px)
void Clip(const GRect &rect_clipper)
Definition: pebble_graphics_types.hpp:178
void Align(const ::GRect &inside_rect, const GAlign alignment, const bool clip)
Definition: pebble_graphics_types.hpp:147
static GOwnedBitmap CreatePalettizedFrom1bit(const ::GBitmap *src_bitmap)
Definition: pebble_graphics_types.hpp:468
GRect(const ::GRect &rect)
Converts from Pebble GRect.
Definition: pebble_graphics_types.hpp:82
void SetData(uint8_t *data, GBitmapFormat format, uint16_t row_size_bytes, bool free_on_destroy)
Definition: pebble_graphics_types.hpp:360
GBitmap * gbitmap_create_blank_with_palette(GSize size, GBitmapFormat format, GColor *palette, bool free_on_destroy)
GRect(::GPoint origin, ::GSize size)
Definition: pebble_graphics_types.hpp:105
Definition: pebble.h:3804
bool ContainsPoint(const GPoint &point)
Definition: pebble_graphics_types.hpp:183
GOvalScaleMode
Definition: pebble.h:4099
GBitmap & operator=(::GBitmap *gbitmap)
Assign the bitmap.
Definition: pebble_graphics_types.hpp:307
GAlign
Definition: pebble.h:3713
An unowned bitmap.
Definition: pebble_graphics_types.hpp:286
GPoint CenterPoint() const
Definition: pebble_graphics_types.hpp:152
GOwnedBitmap(GOwnedBitmap &&that)
Move constructor.
Definition: pebble_graphics_types.hpp:328
GPoint()
Constructs a new GPoint.
Definition: pebble_graphics_types.hpp:36
GOwnedBitmap & operator=(GOwnedBitmap &that)
Swap assignment operator.
Definition: pebble_graphics_types.hpp:341
GBitmap * gbitmap_create_from_png_data(const uint8_t *png_data, size_t png_data_size)
uint8_t * gbitmap_get_data(const GBitmap *bitmap)
void SetPalette(GColor *palette, bool free_on_destroy)
Definition: pebble_graphics_types.hpp:376
GBitmap(const GBitmapBase &that)
Copy bitmap reference.
Definition: pebble_graphics_types.hpp:295
int16_t y
The y-coordinate.
Definition: pebble.h:3320
GRect grect_inset(GRect rect, GEdgeInsets insets)
struct GSize GSize
Represents a 2-dimensional size.
GBitmapFormat
The format of a GBitmap can either be 1-bit or 8-bit.
Definition: pebble.h:3428
GPoint(int16_t x, int16_t y)
Definition: pebble_graphics_types.hpp:48
GPoint FromPolar(GOvalScaleMode scale_mode, int32_t angle)
Definition: pebble_graphics_types.hpp:200
bool IsEmpty()
Definition: pebble_graphics_types.hpp:166
GRect GetBounds() const
Definition: pebble_graphics_types.hpp:258
GRect grect_centered_from_polar(GRect rect, GOvalScaleMode scale_mode, int32_t angle, GSize size)
void grect_standardize(GRect *rect)
GBitmap * gbitmap_create_palettized_from_1bit(const GBitmap *src_bitmap)
GPoint origin
The coordinate of the upper-lefthand corner point of the rectangle.
Definition: pebble_graphics_types.hpp:74
void SetBounds(const GRect &bounds)
Definition: pebble_graphics_types.hpp:368
uint16_t gbitmap_get_bytes_per_row(const GBitmap *bitmap)
void gbitmap_destroy(GBitmap *bitmap)
A bitmap that destroys the underlying reference when destructed.
Definition: pebble_graphics_types.hpp:319
GPoint(const ::GPoint &point)
Converts from a Pebble GPoint.
Definition: pebble_graphics_types.hpp:39
GSize size
The size of the rectangle.
Definition: pebble_graphics_types.hpp:76
Definition: pebble_graphics_types.hpp:5
GBitmapFormat GetFormat() const
Definition: pebble_graphics_types.hpp:245
bool operator==(const ::GPoint &point) const
Definition: pebble_graphics_types.hpp:61
int16_t x
The x-coordinate.
Definition: pebble.h:3318
Definition: pebble_graphics_types.hpp:222
GBitmap * gbitmap_create_as_sub_bitmap(const GBitmap *base_bitmap, GRect sub_rect)
GBitmapFormat gbitmap_get_format(const GBitmap *bitmap)
int16_t w
The width.
Definition: pebble.h:3338
Definition: pebble_graphics_types.hpp:71
GPoint grect_center_point(const GRect *rect)
static GOwnedBitmap CreateBlank(GSize size, GBitmapFormat format, GColor *palette, bool free_on_destroy)
Definition: pebble_graphics_types.hpp:456
void gbitmap_set_palette(GBitmap *bitmap, GColor *palette, bool free_on_destroy)
void gbitmap_set_data(GBitmap *bitmap, uint8_t *data, GBitmapFormat format, uint16_t row_size_bytes, bool free_on_destroy)
GColor * GetPalette() const
Definition: pebble_graphics_types.hpp:263
void gbitmap_set_bounds(GBitmap *bitmap, GRect bounds)
GBitmap * gbitmap_create_with_resource(uint32_t resource_id)
GRect gbitmap_get_bounds(const GBitmap *bitmap)
static GOwnedBitmap CreateWithResource(uint32_t resource_id)
Definition: pebble_graphics_types.hpp:427
int16_t h
The height.
Definition: pebble.h:3340
bool operator!=(const ::GRect &rect) const
Definition: pebble_graphics_types.hpp:137
bool grect_equal(const GRect *const rect_a, const GRect *const rect_b)
virtual ~GBitmapBase()
Destructor.
Definition: pebble_graphics_types.hpp:229
GRect Inset(GEdgeInsets insets) const
Definition: pebble_graphics_types.hpp:160
GPoint gpoint_from_polar(GRect rect, GOvalScaleMode scale_mode, int32_t angle)
bool grect_is_empty(const GRect *const rect)
void grect_align(GRect *rect, const GRect *inside_rect, const GAlign alignment, const bool clip)
bool gpoint_equal(const GPoint *const point_a, const GPoint *const point_b)
Definition: pebble_graphics_types.hpp:33
uint8_t * GetData() const
Definition: pebble_graphics_types.hpp:252
GRect Crop(int32_t crop_size_px)
Definition: pebble_graphics_types.hpp:192
GOwnedBitmap & operator=(GOwnedBitmap that)
Swap assignment operator.
Definition: pebble_graphics_types.hpp:334
bool grect_contains_point(const GRect *rect, const GPoint *point)
void Standardize()
Definition: pebble_graphics_types.hpp:173
bool IsValid()
Returns true if the bitmap is valid and can be used.
Definition: pebble_graphics_types.hpp:314
Definition: pebble.h:3268
static GOwnedBitmap CreateBlank(GSize size, GBitmapFormat format)
Definition: pebble_graphics_types.hpp:438
GBitmapBase()
Cannot construct.
Definition: pebble_graphics_types.hpp:267
GColor * gbitmap_get_palette(const GBitmap *bitmap)
bool operator!=(const ::GPoint &point) const
Definition: pebble_graphics_types.hpp:66
GBitmap & operator=(const GBitmapBase &that)
Assign the bitmap.
Definition: pebble_graphics_types.hpp:300
static GOwnedBitmap CreateSubBitmap(const ::GBitmap *base_bitmap, ::GRect sub_rect)
Definition: pebble_graphics_types.hpp:402