![]() |
BSB Developer Docs
|
A widget that displays a static image. More...
#include <gui/widget.h>Go to the source code of this file.
Typedefs | |
| typedef struct Image | Image |
| Image opaque structure. | |
Enumerations | |
| enum | ImageColorFormat { ImageColorFormatL8 , ImageColorFormatLA88 , ImageColorFormatBGR888 , ImageColorFormatBGRA8888 , ImageColorFormatsCount } |
| Pixel format of raw image data passed to image_set_source_raw(). More... | |
Functions | |
| Image * | image_alloc (Widget *parent) |
| Create a new Image instance. | |
| void | image_free (Image *instance) |
| Delete an Image instance. | |
| Widget * | image_get_base (Image *instance) |
| Get a pointer to the base class instance. | |
| bool | image_set_source (Image *instance, const char *file_path) |
| Load and show an image from a file. | |
| bool | image_set_source_no_cache (Image *instance, const char *file_path) |
| Load and show an image from a file with invalidating previously cached one. | |
| void | image_set_source_raw (Image *instance, ImageColorFormat format, size_t width, size_t height, const void *data, size_t data_size) |
| Show an image from a raw pixel buffer. | |
| void | image_set_opacity (Image *instance, uint8_t opacity) |
| Set the opacity of an Image instance. | |
A widget that displays a static image.
| enum ImageColorFormat |
Create a new Image instance.
| [in,out] | parent | pointer to the parent Widget instance |
| void image_free | ( | Image * | instance | ) |
Delete an Image instance.
| [in,out] | instance | pointer to the Image instance to be deleted |
Get a pointer to the base class instance.
The return value can be used in all Widget methods.
| [in,out] | instance | pointer to the Image instance to be queried |
| void image_set_opacity | ( | Image * | instance, |
| uint8_t | opacity ) |
Set the opacity of an Image instance.
| [in,out] | instance | pointer to the Image instance to be modified |
| [in] | opacity | new opacity value (0-255) |
| bool image_set_source | ( | Image * | instance, |
| const char * | file_path ) |
Load and show an image from a file.
| [in,out] | instance | pointer to the Image instance to be modified |
| [in] | file_path | zero-terminated string containing the full path to image file |
| bool image_set_source_no_cache | ( | Image * | instance, |
| const char * | file_path ) |
Load and show an image from a file with invalidating previously cached one.
| [in,out] | instance | pointer to the Image instance to be modified |
| [in] | file_path | zero-terminated string containing the full path to image file |
| void image_set_source_raw | ( | Image * | instance, |
| ImageColorFormat | format, | ||
| size_t | width, | ||
| size_t | height, | ||
| const void * | data, | ||
| size_t | data_size ) |
Show an image from a raw pixel buffer.
The data is copied internally; the caller's buffer does not need to outlive the call. Switching to a file source by image_set_source() or calling this function again frees the previous buffer automatically.
| [in,out] | instance | pointer to the Image instance to be modified |
| [in] | format | pixel format of the data |
| [in] | width | image width in pixels |
| [in] | height | image height in pixels |
| [in] | data | raw pixel data of size data_size |
| [in] | data_size | raw pixel data size |