3.3. AbstractTrackingDataExporter¶
Inherited by: TrackingDataExporter
3.3.1. Synopsis¶
3.3.1.1. Functions¶
def
register
()def
unregister
()
3.3.1.2. Virtual functions¶
def
do_export
(project, layer, tracking_file_path, time, view, options)def
error_string
()
3.3.1.3. Static functions¶
def
registered_exporters
()
3.3.1.4. Properties¶
property
exports_interlaced
[read-only] of boolproperty
exports_multiple_views
[read-only] of boolproperty
exports_removed_lens_distortion
[read-only] of boolproperty
registered
[read-only] of bool
3.3.2. Detailed Description¶
Abstract tracking data exporter class. Inherit the class to create own exporter formats. Method do_export must be overloaded.
-
class
mocha.exporters.
AbstractTrackingDataExporter
(name, extension[, number_of_data_streams=1[, export_interlaced=false[, remove_lens_distortion=false[, export_multiple_views=false]]]])¶ - Parameters
name (str) – name of the exporter which will be displayed in the Export Tracking Data dialog drop-down list. Should contain a file mask in brackets e.g. Foo (*.bar)
extension (str) – additional extension.
number_of_data_streams (uint) – number of result files. If it equals to 1 then the Copy to Clipboard button will be enabled.
remove_lens_distortion (bool) – whether the exporter supports removing of a lens distortion.
export_multiple_views (bool) – whether the exporter supports multiple views.
export_interlaced (bool) – whether the exporter supports interlaced footage.
Create an exporter instance. The instance ownership is delegated to Python. To register the exporter inside mocha exporters system, call register() method. Before deleting the object unregisters itself.
-
AbstractTrackingDataExporter.
do_export
(project, layer, tracking_file_path, time, view, options)¶ - Return type
Dictionary with keys of type QString and values of type QByteArray.
- Parameters
project (Project) – mocha project instance.
layer (Layer) – layer instance.
tracking_file_path (str) – absolute file path to save which has been chosen by a user in a file dialog.
time (double) – frame index.
view (View) – view.
options (Dictionary with keys of type QString and values of type bool.) –
dict
of options {string_option: bool}.
- Returns
dict
of {file_name: QByteArray}
Performs main exporter operations. Must return a map (
dict
) of absolute file path and appropriate contents. The exporter should not create those files.There are 3 available
options
:Invert
- whether the Invert checkbox is checked.Stabilize
- whether the exporter will be called from the Stabilize page.RemoveLensDistortion
- whether the Remove lens distortion checkbox is checked.
-
AbstractTrackingDataExporter.
error_string
()¶ - Return type
str
-
AbstractTrackingDataExporter.
register
()¶ Registers the exporter instance inside mocha exporters system. The exporter will be registered as a stabilize one as well.
-
static
AbstractTrackingDataExporter.
registered_exporters
()¶ - Return type
Dictionary with keys of type QString and values of type TrackingDataExporter.
- Returns
dict
of {str:TrackingDataExporter
}
Returns a dict of registered exporters including custom user exporters.
-
AbstractTrackingDataExporter.
unregister
()¶ Unregisters the exporter instance inside mocha exporters system.
-
AbstractTrackingDataExporter.
exports_multiple_views
¶ - Type
bool
- Access
read-only Whether the exporter supports multiple views.
-
AbstractTrackingDataExporter.
exports_interlaced
¶ - Type
bool
- Access
read-only Whether the exporter supports interlaced footage.
-
AbstractTrackingDataExporter.
exports_removed_lens_distortion
¶ - Type
bool
- Access
read-only Whether the exporter supports removing of a lens distortion.
-
AbstractTrackingDataExporter.
registered
¶ - Type
bool
- Access
read-only Whether the exporter registered.