#include </home/evins/glbarcode/glbarcode/Barcode1dBase.hpp>
|
| | Barcode1dBase () |
| |
| virtual bool | validate (const std::string &rawData)=0 |
| |
| virtual std::string | preprocess (const std::string &rawData) |
| |
| virtual std::string | encode (const std::string &cookedData)=0 |
| |
| virtual std::string | prepareText (const std::string &rawData) |
| |
| virtual void | vectorize (const std::string &encodedData, const std::string &displayText, const std::string &cookedData, double &w, double &h)=0 |
| |
| | Barcode () |
| |
| void | clear () |
| |
| void | addLine (double x, double y, double w, double h) |
| |
| void | addBox (double x, double y, double w, double h) |
| |
| void | addText (double x, double y, double size, const std::string &text, HAlign halign=H_ALIGN_CENTER) |
| |
| void | addRing (double x, double y, double r, double w) |
| |
| void | addHexagon (double x, double y, double h) |
| |
| void | setIsEmpty (bool value) |
| |
| void | setIsDataValid (bool value) |
| |
| void | setWidth (double w) |
| |
| void | setHeight (double h) |
| |
The Barcode1dBase class is the base class for all 1D barcode implementations. This class provides a common framework for the implementation of 1D barcodes. Creating 1D barcode types (or symbologies) would be typically accomplished by implementing this class rather than directly implementing the Barcode class.
◆ Barcode1dBase()
| glbarcode::Barcode1dBase::Barcode1dBase |
( |
| ) |
|
|
protected |
◆ ~Barcode1dBase()
| glbarcode::Barcode1dBase::~Barcode1dBase |
( |
| ) |
|
|
override |
◆ build()
| Barcode & glbarcode::Barcode1dBase::build |
( |
const std::string & |
data, |
|
|
double |
w = 0, |
|
|
double |
h = 0 |
|
) |
| |
|
overridevirtual |
◆ encode()
| virtual std::string glbarcode::Barcode1dBase::encode |
( |
const std::string & |
cookedData | ) |
|
|
protectedpure virtual |
Data encoder.
Required virtual method to encode data such that it can be later vectorized. The encoded data is usually a list of characters that represent an atomic barcode element (e.g. 'w' = a wide line & 'n' = a narrow line).
- Parameters
-
| [in] | cookedData | Data to encode |
- Returns
- Encoded data
◆ prepareText()
| virtual std::string glbarcode::Barcode1dBase::prepareText |
( |
const std::string & |
rawData | ) |
|
|
protectedvirtual |
Prepare text.
Optional virtual method to prepare text to be displayed as part of barcode.
- Parameters
-
| [in] | rawData | Data to prepare |
- Returns
- text in display form
◆ preprocess()
| virtual std::string glbarcode::Barcode1dBase::preprocess |
( |
const std::string & |
rawData | ) |
|
|
protectedvirtual |
Data preprocessor.
Optional virtual method to perform any transformation of the data needed before encoding. (E.g. encoding an extended alphabet into a simpler one).
- Parameters
-
| [in] | rawData | Data to preprocess |
- Returns
- Preprocessed data
◆ validate()
| virtual bool glbarcode::Barcode1dBase::validate |
( |
const std::string & |
rawData | ) |
|
|
protectedpure virtual |
Data validator.
Required virtual method to test if data is valid for encoding with barcode type.
- Parameters
-
| [in] | rawData | Data to validate |
- Returns
- True if data is valid data for barcode type
-
False if data is not valid data for barcode type
◆ vectorize()
| virtual void glbarcode::Barcode1dBase::vectorize |
( |
const std::string & |
encodedData, |
|
|
const std::string & |
displayText, |
|
|
const std::string & |
cookedData, |
|
|
double & |
w, |
|
|
double & |
h |
|
) |
| |
|
protectedpure virtual |
Vectorize encoded data.
Required virtual method to convert encoded data into a list of drawing primitives which can later be rendered.
- Parameters
-
| [in] | encodedData | Data to vectorize |
| [in] | displayText | Text to display |
| [in] | cookedData | Original data prior to encoding (may be needed for sizing) |
| [in,out] | w | Requested width of barcode (0 = auto size), vectorize will overwrite with actual width |
| [in,out] | h | Requested height of barcode (0 = auto size), vectorize will overwrite with actual width |
The documentation for this class was generated from the following file: