The main characteristic of glbarcode++ that contributes to its extensibility is that barcodes are internally represented in a format that is independent of both symbology and output format. This format is a collection of atomic drawing elements or "Drawing Primitives."
All drawing primitives are derived from the glbarcode::DrawingPrimitive class. This class provides the following properties:
x
– X coordinate of the drawing primitives origin (points) as measured from the upper left corner of the barcode. y
– Y coordinate of the drawing primitives origin (points) as measured from the upper left corner of the barcode.The line primitive is the primary building block for 1-D barcodes and describes a simple vertical line. It is represented by the glbarcode::DrawingPrimitiveLine class. This class extends glbarcode::DrawingPrimitive and provides the following properties:
w
– Line width (points) h
– Height or length of the line (points)The following illustrates these properties:
The box primitive is intended to be the primary building block for 2-D barcodes and describes a solid box. It is represented by the glbarcode::DrawingPrimitiveBox class. This class extends glbarcode::DrawingPrimitive and provides the following properties:
w
– Box width (points) h
– Box height (points)The following illustrates these properties:
The text primitive is intended to provide a human readable text representing the encoded data. It is represented by the glbarcode::DrawingPrimitiveText class. This class extends glbarcode::DrawingPrimitive and provides the following properties:
fsize
– Font size (points) s
– String containing the text to renderThe following illustrates these properties:
The ring primitive is a special-purpose drawing element which is intended to be used by the Maxicode symbology, which is not currently implemented by glbarcode++. This primitive exists because glabels supports it indirectly with its zint backend.
The hexagon primitive is a special-purpose drawing element which is intended to be used by the Maxicode symbology, which is not currently implemented by glbarcode++. This primitive exists because glabels supports it indirectly with its zint backend.