Interface for IBaseImagePlugin wrapper.
More...
Go to the source code of this file.
|
| IBaseImagePlugin | IBaseImagePlugin_Create (PtrSaveImageFn ptrSaveImageFn, PtrCanLoadFileFn ptrCanLoadFileFn, PtrGetPageCountFn ptrGetPageCountFn, PtrLoadImageFn ptrLoadImageFn, PtrGetCapabilitiesFn ptrGetCapabilitiesFn, idrs_exception *pargException) |
| | Creates a new IBaseImagePlugin object.
|
| |
| void | IBaseImagePlugin_Destroy (IBaseImagePlugin argIBaseImagePlugin, idrs_exception *pargException) |
| | Destroys a IBaseImagePlugin handle.
|
| |
| IDRS_BOOL | IBaseImagePlugin_SaveImage (IBaseImagePlugin argIBaseImagePlugin, const CImage argImage, IByteStream argStream, const CImageSaveOptions argSaveOptions, idrs_exception *pargException) |
| | SaveImage saves a CImage object to a IByteStream object, using the file format parameters provided.
|
| |
| IDRS_BOOL | IBaseImagePlugin_CanLoadFile (const IBaseImagePlugin argIBaseImagePlugin, IByteStream argInputStream, idrs_exception *pargException) |
| | CanLoadFile is the function that allows the plugin to signal whether it recognizes a certain file and that it can load it.
|
| |
| IDRS_UINT | IBaseImagePlugin_GetPageCount (const IBaseImagePlugin argIBaseImagePlugin, IByteStream argInputStream, const CImageLoadOptions argLoadOptions, idrs_exception *pargException) |
| |
| IDRS_BOOL | IBaseImagePlugin_LoadImage (IBaseImagePlugin argIBaseImagePlugin, CImage argImage, IByteStream argInputStream, IDRS_UINT32 const uiImageIndex, const CImageLoadOptions argLoadOptions, idrs_exception *pargException) |
| | Loads a file or memory stream into the specified CImage object.
|
| |
| CImagePluginCapabilities | IBaseImagePlugin_GetCapabilities (const IBaseImagePlugin argIBaseImagePlugin, idrs_exception *pargException) |
| | GetCapabilities returns the capabilities of the plugin.
|
| |
Interface for IBaseImagePlugin wrapper.
◆ IBaseImagePlugin_CanLoadFile()
CanLoadFile is the function that allows the plugin to signal whether it recognizes a certain file and that it can load it.
The plugin can choose any algorithm for detecting the file type:
- based on file extension
- based on magic bytes inside the image header
- Parameters
-
| argIBaseImagePlugin | IBaseImagePlugin handle |
| argInputStream | The input stream to decode |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- IDRS_TRUE if the plugin recognizes the file type and it can load it. IDRS_FALSE otherwise
◆ IBaseImagePlugin_Create()
| IBaseImagePlugin IBaseImagePlugin_Create |
( |
PtrSaveImageFn |
ptrSaveImageFn, |
|
|
PtrCanLoadFileFn |
ptrCanLoadFileFn, |
|
|
PtrGetPageCountFn |
ptrGetPageCountFn, |
|
|
PtrLoadImageFn |
ptrLoadImageFn, |
|
|
PtrGetCapabilitiesFn |
ptrGetCapabilitiesFn, |
|
|
idrs_exception * |
pargException |
|
) |
| |
Creates a new IBaseImagePlugin object.
- Parameters
-
| ptrSaveImageFn | SaveImage function pointer |
| ptrCanLoadFileFn | CanLoadFile function pointer |
| ptrGetPageCountFn | GetPageCount function pointer |
| ptrLoadImageFn | LoadImage function pointer |
| ptrGetCapabilitiesFn | GetCapabilities function pointer |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The newly created IBaseImagePlugin
◆ IBaseImagePlugin_Destroy()
| void IBaseImagePlugin_Destroy |
( |
IBaseImagePlugin |
argIBaseImagePlugin, |
|
|
idrs_exception * |
pargException |
|
) |
| |
Destroys a IBaseImagePlugin handle.
- Parameters
-
| argIBaseImagePlugin | IBaseImagePlugin handle to destroy |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
◆ IBaseImagePlugin_GetCapabilities()
GetCapabilities returns the capabilities of the plugin.
The plugin can have multiple capabilities: loading and/or saving one or more type of files
- Returns
- An object containing all the capabilities supported by the plugin
- Parameters
-
| argIBaseImagePlugin | IBaseImagePlugin handle |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
◆ IBaseImagePlugin_GetPageCount()
\ brief GetPageCount Retrieves the number of pages of the given input image
The plugin can provide an implementation for retrieving the number of pages of the image used as an input
- Parameters
-
| argIBaseImagePlugin | IBaseImagePlugin handle |
| argInputStream | The input stream |
| argLoadOptions | Reference to a CImageLoadOptions class containing options for loading |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- The input page count
◆ IBaseImagePlugin_LoadImage()
Loads a file or memory stream into the specified CImage object.
- Parameters
-
| argIBaseImagePlugin | IBaseImagePlugin handle |
| argImage | Reference to the CImage object that will contain the data read from the disk |
| argInputStream | the input stream |
| uiImageIndex | The 0 based index of the image to load from the provided file |
| argLoadOptions | Reference to a CImageLoadOptions class containing options for loading |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- Returns
- IDRS_TRUE if the load operation is successful, IDRS_FALSE otherwise
- See also
- CImage
◆ IBaseImagePlugin_SaveImage()
SaveImage saves a CImage object to a IByteStream object, using the file format parameters provided.
- Parameters
-
| argIBaseImagePlugin | IBaseImagePlugin handle |
| argImage | CImage object to save |
| argStream | Stream where to store the image data |
| argSaveOptions | Image file format options |
| pargException | Pointer to exception structure that will be filled if an exception occurs |
- See also
- CImage
-
ImageFormat
-
CImageSaveOptions
- Returns
- IDRS_TRUE if the image was successfully saved, IDRS_FALSE otherwise