int ok = SaveIcon(STRPTR filename, struct hwIconList *list, struct hwTagList *tags);
SaveIcon()
in the form of a struct hwIconList
that
contains one node per image.
struct hwIconList
looks like this:
struct hwIconList { struct hwIconList *Succ; APTR Data; int Width; int Height; ULONG Flags; ULONG *Palette; ULONG TransPen; int Depth; APTR UserData; }; |
For each node in the list, struct hw_IconList
will be initialized as
follows:
Succ:
NULL
if this node is the last one.
Data:
Palette
member
(see below) will be set. The pixel buffer's size will be exactly width * height * bpp
.
No row padding will be used.
Width:
Height:
Flags:
HWICONFLAGS_DEFAULT:
HWICONFLAGS_SELECTED:
HWICONFLAGS_OPAQUE:
Palette:
ULONGs
which contains the palette colors for the image. The palette
colors are stored as raw RGB values.
TransPen:
HWPEN_NONE
.
Depth:
The tags
argument will be set to a tag list that can contain the following
tags:
HWSVICONTAG_FORMAT:
HWSVICONTAG_COMPRESSION:
SaveIcon()
function allows scripts to specify a compression level
between 0 and 100 because some icon formats might use lossy compression.
HWSVICONTAG_COMPRESSION
will simply forward the specified compression level
to your plugin.
HWSVICONTAG_AMIGAEXT:
pData
member of it will be set to a struct hwIconAmigaExt
pointer. This structure is used for storing metadata that is present in every
Amiga icon. See LoadIcon for a detailed description of this structure.
HWSVICONTAG_ADAPTER:
pData
member of the tag to save the icon. This means that you
have to use hw_FOpenExt() instead of hw_FOpen()
to save the icon. See hw_FOpenExt for details. (V10.0)
HWSVICONTAG_USERTAGS:
pData
will point to a struct hwUserTagList
containing
a list of user tags passed by the Hollywood script. User tags are a way of passing additional information
from Hollywood scripts to plugin functions. Note that even if your plugin doesn't
support any user tags, you should still look for this tag and pass the user
tags to hw_FOpenExt because the user tags passed in UserTags
could
also be intended for another plugin, namely the file adapter plugin passed
in Adapter
. See User tags for details. (V10.0)
This function has to return True
if the image has been successfully saved or False
in case of an error.
True
or False
indicating success or failure