wxIA  0.0.3
SANE / TWAIN Add-on class library for wxWidgets.
 All Classes Files Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
wxIAProvider Class Reference

Image Acquisition Provider. More...

#include <wx/ia/ia.h>

Inheritance diagram for wxIAProvider:

Public Member Functions

 wxIAProvider ()
 Constructor. More...
 
virtual ~wxIAProvider ()
 Destructor.
 
virtual bool Ok ()
 
virtual wxString GetName ()
 Get name. More...
 
virtual int GetSourceCount ()
 Get source count. More...
 
virtual wxIASourceInfo GetSourceInfo (int i)
 
virtual wxIAReturnCode SelectSource (const wxString &name=wxEmptyString, wxIAUIMode uiMode=wxIA_UIMODE_NORMAL, wxWindow *parent=NULL)
 
virtual wxIAReturnCode SelectDefaultSource ()
 
virtual bool IsSourceSelected ()
 
virtual wxIASourceInfo GetSelSourceInfo ()
 
virtual wxIAReturnCode SetSelSourceConfig (const wxString &configString)
 Set selected source configuration. More...
 
virtual wxString GetSelSourceConfig ()
 Get the current configuration of the selected source. More...
 
virtual wxIAReturnCode AcquireImage (wxIAUIMode uiMode=wxIA_UIMODE_NORMAL, wxWindow *parent=NULL, wxIAMonitor *mon=NULL)
 Acquire an image. More...
 
virtual wxIAReturnCode AcquireImages (int numImages, wxIAUIMode uiMode=wxIA_UIMODE_NORMAL, wxWindow *parent=NULL, wxIAMonitor *mon=NULL)
 Acquire one or more images. More...
 
virtual void SetEvtHandler (wxEvtHandler *evtHandler)
 Set event handler. More...
 
virtual wxIAReturnCode SetTransferMode (wxIATransferMode mode)
 Set transfer mode. More...
 
virtual wxIATransferMode GetTransferMode ()
 Get the current transfer mode. More...
 
virtual wxIAReturnCode SetTransferFilename (const wxString &filename, wxIATransferFileType type)
 Set the transfer file name. More...
 
virtual wxString GetTransferFilename ()
 Get the transfer file name.
 
virtual wxIATransferFileType GetTransferFileType ()
 Get the transfer file type.
 
virtual wxIAReturnCode SetTransferBuffer (void *buffer, size_t size)
 Set the transfer buffer. More...
 
virtual void * GetTransferBuffer ()
 Get the transfer buffer. More...
 
virtual size_t GetTransferBufferSize ()
 Get the transfer buffer size.
 
wxEvtHandler * GetEvtHandler ()
 Get current event handler. More...
 
virtual wxImage GetImage ()
 Get the last image aqcuired as a wxImage. More...
 
virtual wxBitmap GetBitmap ()
 Get the last image acquired as a wxBitmap. More...
 
virtual bool SaveSettings (wxConfigBase *config)
 Save the current settings. More...
 
virtual bool LoadSettings (wxConfigBase *config)
 Load settings. More...
 

Detailed Description

Image Acquisition Provider.

Provides one or more image sources which may be selected and used to acquire images. Image sources represent devices such as scanners, cameras, etc. or anything else that can provide image data (like image file handlers or an image database).

Different platforms will provide different wxIAProvider's to allow access to platform specific image acquisition interfaces such as TWAIN on Windows and MacOS and SANE on Unix platforms.

A list of available wxIAProviders is maintained by the wxIAManager class.

Constructor & Destructor Documentation

wxIAProvider::wxIAProvider ( )

Constructor.

Default constructor

Member Function Documentation

virtual wxIAReturnCode wxIAProvider::AcquireImage ( wxIAUIMode  uiMode = wxIA_UIMODE_NORMAL,
wxWindow *  parent = NULL,
wxIAMonitor mon = NULL 
)
virtual

Acquire an image.

Aquire an image from the currently selected source. Returns true on success or false on failure or if the user aborted.

Parameters
uiModeUser interface mode.
parentParent window for any dialog or user interface element that many be created. Used to disable the parent (and possibly the entire app) if required by the user interface. May be NULL.
monPointer to a wxIAMonitor that will be notified as progress is made. May be NULL.
virtual wxIAReturnCode wxIAProvider::AcquireImages ( int  numImages,
wxIAUIMode  uiMode = wxIA_UIMODE_NORMAL,
wxWindow *  parent = NULL,
wxIAMonitor mon = NULL 
)
virtual

Acquire one or more images.

Aquire images from the currently selected source. Returns true on success or false on failure or if the user aborted.

Parameters
numImagesNumber of images to be acquired.
uiModeUser interface mode.
parentParent window for any dialog or user interface element that many be created. Used to disable the parent (and possibly the entire app) if required by the user interface. May be NULL.
monPointer to a wxIAMonitor that will be notified as progress is made. May be NULL.
virtual wxBitmap wxIAProvider::GetBitmap ( )
virtual

Get the last image acquired as a wxBitmap.

Returns
The last image acquired as a wxBitmap. Image data is destroyed after calling this method.
wxEvtHandler* wxIAProvider::GetEvtHandler ( )

Get current event handler.

Returns
Current event handler.
virtual wxImage wxIAProvider::GetImage ( )
virtual

Get the last image aqcuired as a wxImage.

Returns
The last image acquired as a wxImage. Image data is destroyed after calling this method.
virtual wxString wxIAProvider::GetName ( )
virtual

Get name.

Returns
the name of this provider
virtual wxString wxIAProvider::GetSelSourceConfig ( )
virtual

Get the current configuration of the selected source.

Returns
The configuration of the currently selected source encoded as a wxString. The format of the configuration string is defined by the source and should not be edited or modified.
virtual wxIASourceInfo wxIAProvider::GetSelSourceInfo ( )
virtual

Get source info for the currently selected source.

Returns
the source info for the currently selected source. If no source is currently selected, wxIAEmptySourceInfo will be returned.
virtual int wxIAProvider::GetSourceCount ( )
virtual

Get source count.

Returns
The number of sources available or -1 if the sources cannot be enumerated. If the sources cannot be enumerated, the only way to select a source is by a call to SelectSource() with the default args.
virtual wxIASourceInfo wxIAProvider::GetSourceInfo ( int  i)
virtual

Get the source info for the specified source.

Parameters
iIndex of the source to retrieve info for. Must be >= 0 and < GetSourceCount()
Returns
the source info for the specified source.
virtual void* wxIAProvider::GetTransferBuffer ( )
virtual

Get the transfer buffer.

Returns
a pointer to the transfer buffer
virtual wxIATransferMode wxIAProvider::GetTransferMode ( )
virtual

Get the current transfer mode.

Returns
the current transfer mode for the selected source.
virtual bool wxIAProvider::IsSourceSelected ( )
virtual

Is a source selected?

Returns
wxIA_RC_SUCCESS on success another return code on failure.
virtual bool wxIAProvider::LoadSettings ( wxConfigBase *  config)
virtual

Load settings.

Load saved settings for this provider from the specified config object.

Returns
True on success or false on failure.
virtual bool wxIAProvider::Ok ( )
virtual

Used to determine if the provider is initialized and ready for use.

Returns
True if the provider is ready for use or false if not.
virtual bool wxIAProvider::SaveSettings ( wxConfigBase *  config)
virtual

Save the current settings.

Save the current settings for this provider to the specified config object.

Returns
True on success or false on failure.
virtual wxIAReturnCode wxIAProvider::SelectDefaultSource ( )
virtual

Select the default source.

Returns
wxIA_RC_SUCCESS if a source was selected or another return code on failure.
virtual wxIAReturnCode wxIAProvider::SelectSource ( const wxString &  name = wxEmptyString,
wxIAUIMode  uiMode = wxIA_UIMODE_NORMAL,
wxWindow *  parent = NULL 
)
virtual

Select a source.

Parameters
nameName of the source to select or "" to select the default source.
uiModeUser interface mode.
parentWindow to be parent of any dialog or user interface element that may be created. Used to disable the parent (and possibly the entire app) if required by the user interface. May be NULL.
Returns
wxIA_RC_SUCCESS if a source was selected or another return code on failure.
virtual void wxIAProvider::SetEvtHandler ( wxEvtHandler *  evtHandler)
virtual

Set event handler.

Set the event handler to be notified when wxIAEvent's occur. Currently there are two events generated: wxEVT_IA_GETIMAGE event that is sent when an image has been acquired and wxEVT_IA_UPDATESTATUS that is sent to allow the application to update the status of the acquisition. The method handling the wxEVT_IA_GETIMAGE event should call GetImage() or GetBitmap() to retrieve the image data.

Parameters
evtHandlerPointer to the event handler.
virtual wxIAReturnCode wxIAProvider::SetSelSourceConfig ( const wxString &  configString)
virtual

Set selected source configuration.

Configure the currently selected source from the configuration encoded in a wxString.

Parameters
configStringConfiguration value encoded in a wxString by GetSelSourceConfig().
Returns
True on success or false on failure.
virtual wxIAReturnCode wxIAProvider::SetTransferBuffer ( void *  buffer,
size_t  size 
)
virtual

Set the transfer buffer.

Parameters
bufferpointer to buffer in which to store image data
sizesize in bytes of buffer
Note
buffer must be valid during the entire transfer
Returns
wxIA_RC_SUCCESS on success or another return code on failure
virtual wxIAReturnCode wxIAProvider::SetTransferFilename ( const wxString &  filename,
wxIATransferFileType  type 
)
virtual

Set the transfer file name.

Parameters
filenamename of file in which to store image data
typetransfer file type
Returns
wxIA_RC_SUCCESS on success or another return code on failure
virtual wxIAReturnCode wxIAProvider::SetTransferMode ( wxIATransferMode  mode)
virtual

Set transfer mode.

Set the image data transfer mode. The default transfer mode is wxIA_TRANSFERMODE_NATIVE.

Parameters
modedesired mode

The documentation for this class was generated from the following file: