![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
visu_dumpvisu_dump — Some resources to add the ability to export the rendered data to an other format (usually image format). |
VisuDump; VisuDumpClass; enum VisuDumpErrorFlag; const VisuDump * (*VisuDumpInitFunc) (); gboolean (*VisuDumpWriteFunc) (ToolFileFormat *format
,const char *fileName
,int width
,int height
,VisuData *dataObj
,guchar *image
,GError **error
,ToolVoidDataFunc functionWait
,gpointer data
); void visu_dump_abort (GObject *obj
,gpointer data
); GList * visu_dump_getAllModules (); gboolean visu_dump_getAlphaStatus (VisuDump *dump
); gboolean visu_dump_getBitmapStatus (VisuDump *dump
); gboolean visu_dump_getGlStatus (VisuDump *dump
); gint visu_dump_getNModules (); GQuark visu_dump_getQuark (); VisuDump * visu_dump_new (const gchar *descr
,const gchar **patterns
,VisuDumpWriteFunc method
,gboolean bitmap
); void visu_dump_setGl (VisuDump *dump
,gboolean needGl
); void visu_dump_setHasAlpha (VisuDump *dump
,gboolean hasAlpha
); gboolean visu_dump_write (VisuDump *dump
,const char *fileName
,int width
,int height
,VisuData *dataObj
,GArray *image
,ToolVoidDataFunc functionWait
,gpointer data
,GError **error
);
V_Sim can export loaded data to othe formats. This module descibes the methods and structure to create a dumping extension. Basically, a dumping extension is just a FileFormat and a method that is called when exporting is required. No method exists to create a dumping extension, just allocate and initialize the DumpType structure.
The writeDumpFunc should suspend its process to allow the
calling program to refresh itself if the dump process is
slow. Ideally, the argument waitFunction
should be called exactly
100 times.
typedef enum { DUMP_ERROR_OPENGL, DUMP_ERROR_FILE, DUMP_ERROR_ENCODE } VisuDumpErrorFlag;
These are flags used when dumping to a file.
const VisuDump * (*VisuDumpInitFunc) ();
This protoype defines initializing function for dumping extension. Create such a function and add its name in the list listInitDumpModuleFunc defined in dumpModules/externalDumpModules.h thus the new dumping extension will be initialized on startup.
Returns : |
a newly allocated VisuDump. |
gboolean (*VisuDumpWriteFunc) (ToolFileFormat *format
,const char *fileName
,int width
,int height
,VisuData *dataObj
,guchar *image
,GError **error
,ToolVoidDataFunc functionWait
,gpointer data
);
This is a prototype of a method implemented by a dumping extension that is called when the current rendering must be dumped to a file.
|
a ToolFileFormat object, corresponding to the write method ; |
|
a string that defined the file to write to ; |
|
an integer ; |
|
an integer. |
|
the VisuData to be exported ; |
|
the data to be written ; |
|
a location to store some error (not NULL) ;. [allow-none] |
|
a method to call periodically during the dump ;. [allow-none][scope call] |
|
some pointer on object to be passed to the wait function. [closure] |
Returns : |
TRUE if everything went right. |
void visu_dump_abort (GObject *obj
,gpointer data
);
Does nothing for the moment.
|
an object ; |
|
some data. |
GList * visu_dump_getAllModules ();
All dumping extensions are stored in an opaque way in V_Sim. But they can be listed by a call to this method.
Returns : |
a list of all the known dumping extensions. This list is own by V_Sim and should be considered read-only. [transfer none][element-type VisuDump*] |
gboolean visu_dump_getAlphaStatus (VisuDump *dump
);
Retrieve if dump
use alpha channel or not.
|
a VisuDump method. |
Returns : |
TRUE if dump has an alpha channel. |
gboolean visu_dump_getBitmapStatus (VisuDump *dump
);
Retrieve if dump
is exporting a bitmap or not (like to a new input
file format...).
|
a VisuDump method. |
Returns : |
TRUE if the output is a bitmap indeed. |
gboolean visu_dump_getGlStatus (VisuDump *dump
);
Retrieve if dump
requires OpenGL to export or not.
|
a VisuDump method. |
Returns : |
TRUE if OpenGL is required. |
gint visu_dump_getNModules ();
A convenient way to know how many dumping extensions are registered.
Returns : |
the number of known dumping extensions. |
GQuark visu_dump_getQuark ();
Internal routine to get the GQuark to handle error related to dump actions.
VisuDump * visu_dump_new (const gchar *descr
,const gchar **patterns
,VisuDumpWriteFunc method
,gboolean bitmap
);
Create a new dump format.
|
an UTF8 translated string ; |
|
a NULL terminated list of pattern for this dump format ;. [array zero-terminated=1] |
|
a method used to dump the current VisuData ;. [scope call] |
|
a flag for bitmap export. |
Returns : |
a newly created dump format. |
Since 3.7
void visu_dump_setGl (VisuDump *dump
,gboolean needGl
);
Set if dump
requires OpenGL or not.
|
a VisuDump method. |
|
a boolean |
void visu_dump_setHasAlpha (VisuDump *dump
,gboolean hasAlpha
);
Set if dump
has an alpha channel or not.
|
a VisuDump method. |
|
a boolean. |
gboolean visu_dump_write (VisuDump *dump
,const char *fileName
,int width
,int height
,VisuData *dataObj
,GArray *image
,ToolVoidDataFunc functionWait
,gpointer data
,GError **error
);
Use the write function of dump
to export the current dataObj
to
file fileName
.
|
a VisuDump object ; |
|
a string that defined the file to write to ;. [type filename] |
|
an integer ; |
|
an integer ; |
|
the VisuData to be exported ; |
|
the data to be written ;. [allow-none][element-type gint8] |
|
a location to store some error (not NULL) ; |
|
a method to call periodically during the dump ;. [allow-none][closure data][scope call] |
|
some pointer on object to be passed to the wait function. [closure] |
Returns : |
TRUE if dump succeed. |
Since 3.6