P4 Software
/
BarcoderX English
Applies to: BarcoderX Basic and Ultimate
Status: Built, not yet released. The first part of the drawing engine exists and is tested, but nothing is released yet and there is nothing to download. It can work out what a filled shape covers. It cannot yet draw outlines, blend colors or place pictures. This page says what it does today and what comes later.
BarcoderX draws labels with its own drawing engine. It does not use the drawing functions of the operating system, so a label looks the same on Windows x64, Linux x64 and Linux arm64. This page describes the core of that engine, the part that works out what a filled shape covers. Everything else on a label, such as text, barcodes and pictures, is built on it.
A shape is a path: a series of moves, straight lines and curves. A path can hold several separate pieces, and each piece can be open or closed. You can build a path from these steps:
Four ready-made shapes save you the steps: a rectangle, a rectangle with rounded corners (each corner has its own horizontal and vertical radius), an ellipse and an arc of an ellipse.
A transform places a shape on the page. You can shift it, scale it by different amounts across and down, and turn it by any angle, around the origin or around a point you choose. Transforms combine in the order you give, and a transform that can be undone has an inverse. Turning by an angle that is not a multiple of 90 degrees is drawn directly, and the result is smooth.
Filling works out which pixels the inside of a shape covers, and by how much. Two rules decide what is inside when a path crosses itself or holds a piece inside another piece:
The edges are smooth. For every pixel, the engine works out how much of the pixel the shape covers, as a number from 0 (none) to 255 (all). Putting a color on a surface in that proportion is blending, which is not built yet (see the end of this page). A pixel that the shape covers completely is exactly 255, and one that it does not touch is exactly 0. A rectangle whose edges lie on pixel boundaries is therefore filled with no soft edge at all.
For printers that print in black and white, the engine can draw on a 1-bit surface instead. There it fills rectangles on whole printer dots, and it turns a shape's coverage into black where the coverage is 128 or more.
A surface is the grid of pixels that you draw on. Three kinds exist:
| Surface | What it holds |
|---|---|
| Color with transparency | Red, green, blue and opacity for each pixel, 8 bits each. |
| Gray | One 8-bit value for each pixel. |
| Black and white | One bit for each pixel, eight to a byte. |
Instead of drawing at once, you can record the steps in a list: fill a path, fill rectangles, start a clip area (a rectangle or a path) and end it. The list can be written out as plain text in one fixed form, so two lists can be compared exactly. Running a list is not built yet.
BarcoderX checks every limit before it allocates the memory it protects. A drawing that is too large or too complex is refused with a diagnostic code from 3001 to 3005. See Diagnostic codes.
| Limit | Value |
|---|---|
| Pixels in one surface, window or coverage area | 64,000,000 (64 million) |
| Longest side of a surface, window or coverage area | 262,144 pixels. This is a fixed property of the design and cannot be raised. |
| Steps in one path | 1,000,000 |
| Straight pieces that the curves of one fill are cut into | 4,000,000 |
| Work for one fill | 100,000,000 units, which is about five seconds on a recent desktop processor |
| Size of a coordinate after the transform | About one billion pixels (2 to the power 30) |
The drawing code checks for cancellation at every row and at every 1,024 pieces, so the program that calls it can enforce its own time limit, such as 2 seconds for one label. A coordinate that is not a number, or is too large, is refused.
BarcoderX is a product of P4 Software.
Was this page helpful?