Clarisse 4.0 SP9 SDK  4.0.0.0.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Friends | List of all members
IOHelpersDisplayDriver Class Reference
Inheritance diagram for IOHelpersDisplayDriver:
CoreBaseObject CoreBaseType

Public Member Functions

 IOHelpersDisplayDriver ()
 
virtual ~IOHelpersDisplayDriver ()
 
bool connect (ModuleImage &image)
 
void disconnect ()
 
bool is_connected ()
 
ModuleImageget_image () const
 
virtual void on_image_level_update (const ModuleImage::Quality &quality, ImageHandle image)
 
virtual void on_init_render (const ModuleImageProgressInitInfo &init_data)
 
virtual void on_highlight_region (const CoreVector< GMathVec4i > &regions)
 
virtual void on_draw_region (ImageHandle *progress_image, const CoreVector< GMathVec4i > &regions)
 
virtual void on_end_render ()
 
virtual void on_progress_update (const float &progress)
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
virtual size_t get_memory_size () const
 
CoreString get_class_info_name () const
 
CoreString get_class_interface () const
 
const unsigned long & get_class_info_id () const
 
bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
bool operator== (const CoreBaseObject &obj) const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Friends

class IOHelpersDisplayDriverImpl
 

Additional Inherited Members

- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
template<class T >
static T * cast (CoreBaseObject *object)
 
template<class T >
static const T * cast (const CoreBaseObject *object)
 

Detailed Description

This class is designed to retrieve real-time data from a rendering image.

To use this class, you should first connect to an image. If the display driver is already connected, you need to disconnect first, otherwise the connection will fail.

When the connected image is rendered, IOHelpersDisplayDriver::on_image_level_update is systematically called when it ends. Then depending on the rendering speed, the following methods can be called:

Note
Be extra careful as most of those methods are asynchronous!

Constructor & Destructor Documentation

IOHelpersDisplayDriver::IOHelpersDisplayDriver ( )

Constructor.

IOHelpersDisplayDriver::~IOHelpersDisplayDriver ( )
virtual

Destructor. Disconnects automatically from the image.

Member Function Documentation

bool IOHelpersDisplayDriver::connect ( ModuleImage image)

Connects to the specified image.

If the display driver is already connected, the connection will fail and return false. Before connecting to a new image you must disconnect from any previously connect image.

Parameters
imageThe ModuleImage to connect to.
Returns
true if connection succeeded, false otherwise (already connected to an image).
void IOHelpersDisplayDriver::disconnect ( )

Disconnects from the currently connected image if any.

ModuleImage* IOHelpersDisplayDriver::get_image ( ) const
inline

Returns the image the display driver is connected to.

bool IOHelpersDisplayDriver::is_connected ( )
inline

Returns true if connected to an image.

virtual void IOHelpersDisplayDriver::on_draw_region ( ImageHandle progress_image,
const CoreVector< GMathVec4i > &  regions 
)
inlinevirtual

Called by the rendering thread when new regions are available to display.

Note
Asynchronous method called from a rendering thread. If the rendering is too quick, this method may not be called at all by the caller thread.
Parameters
progress_imagePointer to the image currently being rendered. This image is incomplete. Make sure to work only on the data of the received regions.
regionsArray of completed regions that have just been rendered.
virtual void IOHelpersDisplayDriver::on_end_render ( )
inlinevirtual

Called by the rendering thread when the image is completed.

Note
Asynchronous method called from a rendering thread. If the rendering is fast, this method may not be called at all by the caller thread.
virtual void IOHelpersDisplayDriver::on_highlight_region ( const CoreVector< GMathVec4i > &  regions)
inlinevirtual

Called by the rendering thread when starting to render new regions in the image.

Note
Asynchronous method called from a rendering thread. If the rendering is too quick, this method may not be called at all by the caller thread.
Parameters
regionsArray of regions that will be rendered.
virtual void IOHelpersDisplayDriver::on_image_level_update ( const ModuleImage::Quality quality,
ImageHandle  image 
)
inlinevirtual

Called by the rendering thread when the connected image completes a render quality.

Note
Asynchronous method called from a rendering thread.
Parameters
qualityQuality of the rendered image.
imageHandle to the rendered image.
virtual void IOHelpersDisplayDriver::on_init_render ( const ModuleImageProgressInitInfo init_data)
inlinevirtual

Called by the rendering thread when it starts to render the image.

Note
Asynchronous method called from a rendering thread. If the rendering is too quick, this method may not be called at all by the caller thread.
Parameters
init_dataStructure containing the data that can be needed to initialize the display.
virtual void IOHelpersDisplayDriver::on_progress_update ( const float &  progress)
inlinevirtual

Called by the rendering thread when image rendering progress is updated. Progress goes from 0.0 (start) to 1.0 (finish).

Note
Asynchronous method called from a rendering thread. If the rendering is too quick, this method may not be called at all by the caller thread.