Name
IsImage -- check if a file is in a supported image format (V5.0)
Synopsis
int ok = IsImage(STRPTR filename, struct LoadImageCtrl *ctrl);
Function
This function has to check whether the specified file is in an image format that the plugin wants to handle. If it is, the plugin has to return True and provide information about the image's size and whether or not it has an alpha channel. This is done by setting the following members of the struct LoadImageCtrl pointer that is passed to IsImage() in the second argument:

Width:
Must be set to the image width in pixels.

Height:
Must be set to the image height in pixels.

Depth:
Set this to the bit depth of the image. (V9.0)

AlphaChannel:
Must be set to True or False, depending on whether or not this image has an alpha channel.

Flags:
Your implementation may set the following flags:

HWIMGFLAGS_TRANSPARENCY:
Set this flag to tell Hollywood that the image has a monochrome transparency channel (e.g. a transparent pen in a palette-based image). (V6.0)

The following members of struct LoadImageCtrl are set by Hollywood before it calls your implementation of IsImage():

Adapter:
Starting with Hollywood 6.0 users can specify the file adapter that should be used to open certain files. If this member is non-NULL, Hollywood wants your plugin to use the file adapter specified in Adapter to open the file. This means that you have to use hw_FOpenExt() instead of hw_FOpen() to open the file. Make sure to check for Hollywood 6.0 before trying to access this member because it isn't there in previous versions. See hw_FOpenExt for details. (V6.0)

You must not touch any other members of the struct LoadImageCtrl pointer that is passed to this function. See LoadImage for details on this structure.

Inputs
filename
filename to examine
ctrl
pointer to a struct LoadImageCtrl for storing information about the image
Results
ok
True if the plugin wants to handle this file, False otherwise

Show TOC