The BIconUtils class provide utility methods for managing and drawing vector icons. More...
Static Public Member Functions | |
static status_t | ConvertFromCMAP8 (BBitmap *source, BBitmap *result) |
Converts an old-style icon to another colorspace. | |
static status_t | ConvertFromCMAP8 (const uint8 *data, uint32 width, uint32 height, uint32 bytesPerRow, BBitmap *result) |
Convert raw data in B_CMAP8 colorspace to a B_RGBA32 BBitmap. | |
static status_t | ConvertToCMAP8 (BBitmap *source, BBitmap *result) |
Converts a true-color icon to CMAP8 colorspace. | |
static status_t | ConvertToCMAP8 (const uint8 *data, uint32 width, uint32 height, uint32 bytesPerRow, BBitmap *result) |
Convert B_RGBA32 raw data into a B_CMAP8 BBitmap. | |
static status_t | GetCMAP8Icon (BNode *node, const char *smallIconAttrName, const char *largeIconAttrName, icon_size size, BBitmap *icon) |
Utility function to import an "old" BeOS icon in B_CMAP8 colorspace. | |
static status_t | GetIcon (BNode *node, const char *vectorIconAttrName, const char *smallIconAttrName, const char *largeIconAttrName, icon_size size, BBitmap *result) |
Utility function to import an icon from a node. | |
static status_t | GetVectorIcon (BNode *node, const char *attrName, BBitmap *result) |
Utility function to import a vector icon in "flat icon" format. | |
static status_t | GetVectorIcon (const uint8 *buffer, size_t size, BBitmap *result) |
Utility function to import a vector icon in "flat icon" format. | |
The BIconUtils class provide utility methods for managing and drawing vector icons.
Haiku icons are stored in the HVIF (Haiku Vector Icon Format). This format was designed specifically for this purpose, and allows the icon data to be small enough to fit in file's inodes. This way, the icon can be displayed like any other file attribute, without extra disk access.
This class provide only static methods to allow access to the icon data and rendering to BBitmaps for later use in an application. It also supports older icons in bitmap format. These may still be useful at very small sizes. Note you can't create an instance of BIconUtils, just call the static methods.
Converts an old-style icon to another colorspace.
Utility function to convert from old icon colorspace into colorspace of BBitmap result
|
static |
Convert raw data in B_CMAP8 colorspace to a B_RGBA32 BBitmap.
Converts a true-color icon to CMAP8 colorspace.
Utility function to convert data from source into result colorspace. Call this to convert a picture to a format suitable for storage as an old-style icon.
|
static |
Convert B_RGBA32 raw data into a B_CMAP8 BBitmap.
|
static |
Utility function to import an "old" BeOS icon in B_CMAP8 colorspace.
Utility function to import an "old" BeOS icon in B_CMAP8 colorspace from either the small icon attribute or the large icon attribute as given in smallIconAttrName and largeIconAttrName. Which icon is loaded depends on the given size.
|
static |
Utility function to import an icon from a node.
Utility function to import an icon from the node that has either of the provided attribute names. Which icon type is preferred (vector, small or large B_CMAP8 icon) depends on the colorspace of the provided bitmap.
|
static |
Utility function to import a vector icon in "flat icon" format.
Utility function to import a vector icon in "flat icon" format from a BNode attribute into the preallocated BBitmap result. The colorspace of result needs to be B_RGBA32 or at least B_RGB32 (though that makes less sense). The icon will be scaled from its "native" size of 64x64 to the size of the bitmap.
|
static |
Utility function to import a vector icon in "flat icon" format.
Utility function to import a vector icon in "flat icon" format from the given buffer into the preallocated BBitmap result. The colorspace of result needs to be B_RGBA32 or at least B_RGB32 (though that makes less sense). The icon will be scaled from its "native" size of 64x64 to the size of the bitmap.