picofuse

bitmap.h
Go to the documentation of this file.
1 
10 #pragma once
11 #include "types.h"
12 #include <stddef.h>
13 
19 
26 typedef struct {
27  void *data;
28  pix_size_t size;
31  size_t stride;
34  pix_op_t op;
36 } pix_bitmap_t;
39 
41 // METHODS
42 
55 
70  pix_color_t color);
71 
84 void pix_bitmap_fill_rect(pix_bitmap_t *bitmap, pix_point_t origin,
85  pix_size_t size, pix_color_t color);
86 
100  pix_color_t color);
101 
108 void pix_bitmap_set_op(pix_bitmap_t *bitmap, pix_op_t op);
109 
void * data
Pointer to bitmap memory, or NULL if the backend keeps no direct memory representation, or the bitmap hasn&#39;t been retained for drawing on.
Definition: bitmap.h:27
pix_color_t pix_bitmap_get_pixel(const pix_bitmap_t *bitmap, pix_point_t point)
Read a single pixel&#39;s color.
uint32_t pix_color_t
Color value type for pixel operations.
Definition: color.h:17
Plain in-memory pixel bitmap descriptor.
Definition: bitmap.h:26
void pix_bitmap_fill_rect(pix_bitmap_t *bitmap, pix_point_t origin, pix_size_t size, pix_color_t color)
Fill a rectangle with a single color.
void pix_bitmap_set_op(pix_bitmap_t *bitmap, pix_op_t op)
Change a bitmap&#39;s compositing mode.
void pix_bitmap_draw_line(pix_bitmap_t *bitmap, pix_point_t a, pix_point_t b, pix_color_t color)
Draw a straight line between two points.
struct pix_bitmap_ops_t pix_bitmap_ops_t
Backend-specific bitmap operations - opaque to public API callers.
Definition: bitmap.h:18
Point structure representing X,Y coordinates.
Definition: types.h:17
const pix_bitmap_ops_t * ops
Backend-specific operations, or NULL -.
Definition: bitmap.h:33
void pix_bitmap_set_pixel(pix_bitmap_t *bitmap, pix_point_t point, pix_color_t color)
Write a single pixel&#39;s color.
pix_op_t
Compositing mode for drawing operations.
Definition: types.h:46
size_t stride
Byte pitch between adjacent major-axis elements.
Definition: bitmap.h:31
pix_format_t fmt
Pixel format used by data.
Definition: bitmap.h:32
pix_format_t
Pixel format enumeration defining color depth and layout.
Definition: types.h:35
Size structure representing width and height dimensions.
Definition: types.h:26