Patch by John Scipione again : fix the new BIconUtils documentation.
thanks! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42609 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -3,30 +3,31 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Documentation by:
|
* Documentation by:
|
||||||
* Adrien Destugues <[email protected]>
|
* Adrien Destugues <[email protected]>
|
||||||
* Corresponds to:
|
* Corresponds to:
|
||||||
* /trunk/headers/os/interface/IconUtils.h rev 42600
|
* /trunk/headers/os/interface/IconUtils.h rev 42600
|
||||||
* /trunk/src/kits/interface/IconUtils.cpp rev 42600
|
* /trunk/src/kits/interface/IconUtils.cpp rev 42600
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file IconUtils.h
|
\file IconUtils.h
|
||||||
\brief Vector icon handling utility class
|
\brief Vector icon handling utility class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \class BIconUtils
|
/*!
|
||||||
|
\class BIconUtils
|
||||||
\ingroup interface
|
\ingroup interface
|
||||||
\ingroup libbe
|
\ingroup libbe
|
||||||
\brief The BIconUtils class provide utility methods for managing and
|
\brief The BIconUtils class provide utility methods for managing and
|
||||||
drawing vector icons.
|
drawing vector icons.
|
||||||
|
|
||||||
Haiku icons are stored in the HVIF (Haiku Vector Icon Format). This format
|
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
|
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
|
small enough to fit in file's inodes. This way, the icon can be displayed
|
||||||
like any other file attribute, without extra disk access.
|
like any other file attribute, without extra disk access.
|
||||||
|
|
||||||
This class provide only static methods to allow access to the icon data and
|
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
|
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
|
older icons in bitmap format. These may still be useful at very small
|
||||||
@@ -35,60 +36,64 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn static status_t BIconUtils::GetIcon(BNode* node,
|
/*!
|
||||||
|
\fn static status_t BIconUtils::GetIcon(BNode* node,
|
||||||
const char* vectorIconAttrName, const char* smallIconAttrName,
|
const char* vectorIconAttrName, const char* smallIconAttrName,
|
||||||
const char* largeIconAttrName, icon_size size, BBitmap* result)
|
const char* largeIconAttrName, icon_size size, BBitmap* result)
|
||||||
\brief Utility function to import an icon from a node.
|
\brief Utility function to import an icon from a node.
|
||||||
|
|
||||||
Utility function to import an icon from the node that
|
Utility function to import an icon from the node that
|
||||||
has either of the provided attribute names. Which icon type
|
has either of the provided attribute names. Which icon type
|
||||||
is preferred (vector, small or large B_CMAP8 icon) depends
|
is preferred (vector, small or large B_CMAP8 icon) depends
|
||||||
on the colorspace of the provided bitmap.
|
on the colorspace of the provided bitmap.
|
||||||
|
|
||||||
\note If the colorspace is B_CMAP8, B_CMAP8 icons are preferred. In that
|
\note If the colorspace is B_CMAP8, B_CMAP8 icons are preferred. In that
|
||||||
case, the bitmap size must also match the provided icon_size "size"!
|
case, the bitmap size must also match the provided icon_size "size"!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn static status_t BIconUtils::GetVectorIcon(BNode* node,
|
/*!
|
||||||
|
\fn static status_t BIconUtils::GetVectorIcon(BNode* node,
|
||||||
const char* attrName, BBitmap* result)
|
const char* attrName, BBitmap* result)
|
||||||
\brief Utility function to import a vector icon in "flat icon" format.
|
\brief Utility function to import a vector icon in "flat icon" format.
|
||||||
|
|
||||||
Utility function to import a vector icon in "flat icon"
|
Utility function to import a vector icon in "flat icon"
|
||||||
format from a BNode attribute into the preallocated BBitmap \a result.
|
format from a BNode attribute into the preallocated BBitmap \a result.
|
||||||
The colorspace of result needs to be B_RGBA32 or at
|
The colorspace of result needs to be B_RGBA32 or at
|
||||||
least B_RGB32 (though that makes less sense). The icon
|
least B_RGB32 (though that makes less sense). The icon
|
||||||
will be scaled from it's "native" size of 64x64 to the
|
will be scaled from it's "native" size of 64x64 to the
|
||||||
size of the bitmap.
|
size of the bitmap.
|
||||||
|
|
||||||
\note The scale is derived from the bitmap width, the bitmap should have
|
\note The scale is derived from the bitmap width, the bitmap should have
|
||||||
square dimension, or the icon will be cut off at the bottom (or have
|
square dimension, or the icon will be cut off at the bottom (or have
|
||||||
room left).
|
room left).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn static status_t BIconUtils::GetVectorIcon(const uint8* buffer,
|
/*!
|
||||||
|
\fn static status_t BIconUtils::GetVectorIcon(const uint8* buffer,
|
||||||
size_t size, BBitmap* result)
|
size_t size, BBitmap* result)
|
||||||
\brief Utility function to import a vector icon in "flat icon" format.
|
\brief Utility function to import a vector icon in "flat icon" format.
|
||||||
|
|
||||||
Utility function to import a vector icon in "flat icon"
|
Utility function to import a vector icon in "flat icon"
|
||||||
format from the given \a buffer into the preallocated BBitmap \a result.
|
format from the given \a buffer into the preallocated BBitmap \a result.
|
||||||
The colorspace of result needs to be B_RGBA32 or at
|
The colorspace of result needs to be B_RGBA32 or at
|
||||||
least B_RGB32 (though that makes less sense). The icon
|
least B_RGB32 (though that makes less sense). The icon
|
||||||
will be scaled from it's "native" size of 64x64 to the
|
will be scaled from it's "native" size of 64x64 to the
|
||||||
size of the bitmap.
|
size of the bitmap.
|
||||||
|
|
||||||
\note The scale is derived from the bitmap width, the bitmap should have
|
\note The scale is derived from the bitmap width, the bitmap should have
|
||||||
square dimension, or the icon will be cut off at the bottom (or have
|
square dimension, or the icon will be cut off at the bottom (or have
|
||||||
room left).
|
room left).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn static status_t BIconUtils::GetCMAP8Icon(BNode* node,
|
/*!
|
||||||
|
\fn static status_t BIconUtils::GetCMAP8Icon(BNode* node,
|
||||||
const char* smallIconAttrName, const char* largeIconAttrName,
|
const char* smallIconAttrName, const char* largeIconAttrName,
|
||||||
icon_size size, BBitmap* icon)
|
icon_size size, BBitmap* icon)
|
||||||
\brief Utility function to import an "old" BeOS icon in B_CMAP8 colorspace.
|
\brief 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
|
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
|
either the small icon attribute or the large icon attribute as given in
|
||||||
\a smallIconAttrName and \a largeIconAttrName. Which icon is loaded depends
|
\a smallIconAttrName and \a largeIconAttrName. Which icon is loaded depends
|
||||||
@@ -96,32 +101,40 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn static status_t BIconUtils::ConvertFromCMAP8(BBitmap* source, BBitmap* result)
|
/*!
|
||||||
|
\fn static status_t BIconUtils::ConvertFromCMAP8(BBitmap* source,
|
||||||
|
BBitmap* result)
|
||||||
\brief Converts an old-style icon to another colorspace.
|
\brief Converts an old-style icon to another colorspace.
|
||||||
|
|
||||||
Utility function to convert from old icon colorspace into colorspace of
|
Utility function to convert from old icon colorspace into colorspace of
|
||||||
BBitmap \a result
|
BBitmap \a result
|
||||||
|
|
||||||
\note result should be in B_RGBA32 colorspace, and source in B_CMAP8.
|
\note result should be in B_RGBA32 colorspace, and source in B_CMAP8.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \fn static status_t BIconUtils::ConvertToCMAP8(BBitmap* source, BBitmap* result)
|
/*!
|
||||||
|
\fn static status_t BIconUtils::ConvertToCMAP8(BBitmap* source,
|
||||||
|
BBitmap* result)
|
||||||
\brief Converts a true-color icon to CMAP8 colorspace.
|
\brief Converts a true-color icon to CMAP8 colorspace.
|
||||||
|
|
||||||
Utility function to convert data from source into \a result colorspace.
|
Utility function to convert data from source into \a result colorspace.
|
||||||
Call this to convert a picture to a format suitable for storage as an
|
Call this to convert a picture to a format suitable for storage as an
|
||||||
old-style icon.
|
old-style icon.
|
||||||
|
|
||||||
\note result should be in B_CMAP8 colorspace, and source in B_RGBA32.
|
\note result should be in B_CMAP8 colorspace, and source in B_RGBA32.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn static status_t BIconUtil::ConvertFromCMAP8(const uint8* data, uint32 width,
|
|
||||||
uint32 height, uint32 bytesPerRow, BBitmap* result);
|
/*!
|
||||||
|
\fn static status_t BIconUtils::ConvertFromCMAP8(const uint8* data,
|
||||||
|
uint32 width, uint32 height, uint32 bytesPerRow, BBitmap* result);
|
||||||
\brief Convert raw data in B_CMAP8 colorspace to a B_RGBA32 BBitmap.
|
\brief Convert raw data in B_CMAP8 colorspace to a B_RGBA32 BBitmap.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \fn static status_t BIconUtils::ConvertToCMAP8(const uint8* data, uint32 width,
|
|
||||||
uint32 height, uint32 bytesPerRow, BBitmap* result);
|
/*!
|
||||||
|
\fn static status_t BIconUtils::ConvertToCMAP8(const uint8* data,
|
||||||
|
uint32 width, uint32 height, uint32 bytesPerRow, BBitmap* result);
|
||||||
\brief Convert B_RGBA32 raw data into a B_CMAP8 BBitmap.
|
\brief Convert B_RGBA32 raw data into a B_CMAP8 BBitmap.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user