iDRS™ SDK 16
Loading...
Searching...
No Matches
IBaseImagePlugin_interface.h File Reference

Interface for IBaseImagePlugin wrapper. More...

Go to the source code of this file.

Functions

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.
 

Detailed Description

Interface for IBaseImagePlugin wrapper.

Function Documentation

◆ IBaseImagePlugin_CanLoadFile()

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.

The plugin can choose any algorithm for detecting the file type:

  • based on file extension
  • based on magic bytes inside the image header
Parameters
argIBaseImagePluginIBaseImagePlugin handle
argInputStreamThe input stream to decode
pargExceptionPointer 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
ptrSaveImageFnSaveImage function pointer
ptrCanLoadFileFnCanLoadFile function pointer
ptrGetPageCountFnGetPageCount function pointer
ptrLoadImageFnLoadImage function pointer
ptrGetCapabilitiesFnGetCapabilities function pointer
pargExceptionPointer 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
argIBaseImagePluginIBaseImagePlugin handle to destroy
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ IBaseImagePlugin_GetCapabilities()

CImagePluginCapabilities IBaseImagePlugin_GetCapabilities ( const IBaseImagePlugin  argIBaseImagePlugin,
idrs_exception *  pargException 
)

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
argIBaseImagePluginIBaseImagePlugin handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ IBaseImagePlugin_GetPageCount()

IDRS_UINT IBaseImagePlugin_GetPageCount ( const IBaseImagePlugin  argIBaseImagePlugin,
IByteStream  argInputStream,
const CImageLoadOptions  argLoadOptions,
idrs_exception *  pargException 
)

\ 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
argIBaseImagePluginIBaseImagePlugin handle
argInputStreamThe input stream
argLoadOptionsReference to a CImageLoadOptions class containing options for loading
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The input page count

◆ IBaseImagePlugin_LoadImage()

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.

Parameters
argIBaseImagePluginIBaseImagePlugin handle
argImageReference to the CImage object that will contain the data read from the disk
argInputStreamthe input stream
uiImageIndexThe 0 based index of the image to load from the provided file
argLoadOptionsReference to a CImageLoadOptions class containing options for loading
pargExceptionPointer 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()

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.

Parameters
argIBaseImagePluginIBaseImagePlugin handle
argImageCImage object to save
argStreamStream where to store the image data
argSaveOptionsImage file format options
pargExceptionPointer 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