Object Model¶
Q2Pix exposes an object model whose main objects are Image Document, Image Frame, Image Area, and XMP Metadata.
The following diagram illustrates the relations between these objects and some of their properties described later in detail. A circle is the origin of a relation; a single arrowhead denotes a to-one relation, a double arrowhead a to-many relation.
Image Document is the central object. It represents an image file of a certain format on disk or in memory.
Image Format is a secondary object that describes the characteristics and capabilities of the specific format.
Image Document contains one or more Image Frames.
Both Image Document and Image Frame may contain XMP Metadata.
At document level metadata is supported only in PDF
; all other formats support metadata
at frame level. XMP Metadata has XMP Properties.
Another main object is Image Area: a scrollable plug-in area that displays one frame of Image Document. The plug-in area holds a reference to the document and the index of the frame.
How objects are accessed from the 4D side¶
Image Document and XMP Metadata objects are accessed using object references
(ImgDocRef
and XMPDataRef
in the diagram). Object references are text 4D values,
created and managed using plug-in and component methods.
Image Frame objects are accessed using the Image Document reference and frame index.
XMP Property objects are accessed using the XMP Metadata reference and property path.
Image Area objects are accessed using the plug-in area reference, i.e. the value of the longint 4D variable assigned to the plug-in area in 4D’s Form Editor.
Note
Unlike QPix, the image area in Q2Pix is bare-bones minimal: just scrollbars – no menubar,
no tool, zoom, or navigation controls. All these are implemented in the rich,
customizable and extensible environment of the ImgControl
widget in the
Q2ImgControl component.
Lifecycle management of the main objects is discussed in Object Lifecycle.