void RegisterImageSaver(struct SaveImageReg *reg)
RegisterImageSaver()
has to
tell Hollywood whether it wants to register another image saver. Hollywood
will pass a pointer to a struct SaveImageReg
to this function.
This structure looks like this:
struct SaveFormatReg { ULONG CapsMask; [out] ULONG FormatID; [in/out] STRPTR FormatName; [out] }; struct SaveImageReg { struct SaveFormatReg hdr; }; |
Your implementation has to do the following with the individual structure members:
CapsMask:
HWSAVEIMGCAPS_ARGB:
HWSAVEIMGCAPS_CLUT:
HWSAVEIMGCAPS_ALPHA:
HWSAVEIMGCAPS_ARGB
.
HWSAVEIMGCAPS_MORE:
RegisterImageSaver()
again so that
you can register another saver. If you don't want to register another saver,
don't set this flag. (V5.3)
Note that HWSAVEIMGCAPS_ARGB
and HWSAVEIMGCAPS_CLUT
are not mutually exclusive. You can set them both if the target image format
supports both true colour and palette-based pixel data storage.
FormatID:
FormatID
you have specified
must not be changed or you will break compatibility with applets or executables
that have been compiled with previous versions. If you are registering more
than one image saver using HWSAVEIMGCAPS_MORE
, you can look at the
FormatID
member to tell how many times Hollywood has already called
RegisterImageSaver()
because FormatID
will contain the identifier
of the last image saver you registered. If FormatID
is 0, then this
is the first call to RegisterImageSaver()
. Note that it is not recommended
to keep your own counter because Hollywood might call RegisterImageSaver()
multiple times, i.e. it might first loop over RegisterImageSaver()
to determine
how many image savers there are in total and then it might loop over
RegisterImageSaver()
again to actually register their names.
FormatName:
#IMGFMT_
prefix must not be included
in the string you pass. Hollywood will add this automatically, i.e. if you
pass the string "TESTFORMAT" here, Hollywood will make your image saver
available under the constant #IMGFMT_TESTFORMAT
.
struct SaveImageReg
to be filled out by your implementation