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 }; |
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:
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