int ok = SaveImage(STRPTR filename, struct SaveImageCtrl *ctrl);
struct SaveImageCtrl to this function. This structure looks like this:
struct SaveImageCtrl
{
APTR Data; // [in]
ULONG *Palette; // [in]
int Width; // [in]
int Height; // [in]
int Modulo; // [in]
int Format; // [in]
int Quality; // [in]
int Colors; // [in]
ULONG TransIndex; // [in]
ULONG Flags; // [in]
ULONG FormatID; // [in] -- V5.3
STRPTR Adapter; // [in] -- V10.0
struct hwUserTagList *UserTags; // [in] -- V10.0
};
|
In this structure Hollywood passes the following information to your SaveImage() function:
Data:Format member.
Width:
Height:
Modulo:
Format:Data. May be one
of the following constants:
HWSAVEIMGFMT_ARGB:
HWSAVEIMGFMT_CLUT:Palette below.
You will only have to handle those formats here that you have explicitly declared as supported when Hollywood called your RegisterImageSaver() function.
Quality:
Colors:Palette
member. This member is only used if Format is HWSAVEIMGFMT_CLUT.
Palette:Colors
member. Note that Palette is only used if Format is HWSAVEIMGFMT_CLUT.
TransIndex:Format is HWSAVEIMGFMT_CLUT this member specifies the index of
the color that should appear transparent in the image. The value specified here is only
valid if the HWSAVEIMGFLAGS_TRANSINDEX flag has been set (see below).
Flags:
HWSAVEIMGFLAGS_ALPHA:
HWSAVEIMGFLAGS_TRANSINDEX:TransIndex member contains the index of a palette entry that should be
made transparent in the output image.
FormatID:
Adapter:NULL, Hollywood wants your plugin to
use the file adapter specified in Adapter to save the image. This means that you
have to use hw_FOpenExt() instead of hw_FOpen()
to save the image. Make sure to check for Hollywood 10.0 before trying to access
this member because it isn't there in previous versions. See hw_FOpenExt for details. (V10.0)
UserTags:UserTags could
also be intended for another plugin, namely the file adapter plugin passed
in Adapter. See User tags for details. Make sure to check for Hollywood 10.0
before trying to access this member because it isn't there in previous versions.
(V10.0)
This function has to return True if the image has been successfully saved or False
in case of an error.
struct SaveImageCtrl containing the image to be savedTrue or False indicating success or failure