Difference between revisions of "BackendLib"

From Scantegrity Wiki

(Invisible Ink Symbol Printing Module)
(Invisible Ink Symbol Generator Module)
Line 7: Line 7:
 
[[Image:InvisibleInkBlockExample.png|thumb|right|The reactive ink (yellow) and dummy ink (magenta) are base inks in the printer that are printed in contiguous blocks. When printed, the inks are indistinguishable from each other.]]
 
[[Image:InvisibleInkBlockExample.png|thumb|right|The reactive ink (yellow) and dummy ink (magenta) are base inks in the printer that are printed in contiguous blocks. When printed, the inks are indistinguishable from each other.]]
  
 +
IISG provides the following functions:
 +
* Generate {{mdash}} Generates an Invisible Ink Image using the specified size, font, and other formatting data.
 +
* GenBlocks {{mdash}} Takes a generated image and creates contiguous blocks of a given size, with a given amount of horizontal and vertical white spaces on each block. See the diagram for an illustration. '''N.B.''' Should not be used with anti-aliased fonts.
 +
* Munge {{mdash}} On a pixel by pixel basis, randomly add or subtract from the "brightness" of a given image.
 +
* BlockMunge {{mdash}} On a block by block basis, randomly add or subtract from the "brightness" of a given image.
 +
* Mask {{mdash}} On a pixel by pixel basis, apply a random amount of cyan.
 +
* BlockMask {{mdash}} On a block by block basis, apply a random amount of cyan.
 +
* GetBMP {{mdash}} Return a bitmap of the generated image.
  
 
+
Any function above that relies on a random function is assumed to be taking as a parameter a pre-keyed cryptographically secure pseudo-random number generator. Also, white is considered a "null" color and any operations on it should return white.
 
 
We need a module or set of functions that can takes font attributes, height/width, text data, and threshold values, then produces a bitmap where each pixel color is a random value within the given threshold for that pixel type.  
 
 
 
Another desired functionality is an overlay for a whitespace grid over an image with grid squares being a specified height and width in pixels, and the lines being a specified thickness.
 
 
 
  
 
[[Image:Scantegrity_II_Ballot.jpg|thumb|right|Scantegrity II ballot and decoder pen.<br> <b>Left:</b> Unmarked optical scan bubble. <br><b>Right:</b> Marked optical scan bubble revealing confirmation code "FY".]]
 
[[Image:Scantegrity_II_Ballot.jpg|thumb|right|Scantegrity II ballot and decoder pen.<br> <b>Left:</b> Unmarked optical scan bubble. <br><b>Right:</b> Marked optical scan bubble revealing confirmation code "FY".]]

Revision as of 19:51, 29 September 2008

Printing Module

Invisible Ink Symbol Generator Module

The Invisible Ink Symbol Generator (IISG) Module processes symbols and produces an image of the symbols with a background of reactive ink and a foreground (font color) or non-reactive (dummy) ink. The images produced by this module are embedded into ballot files that are printed on an invisible ink-capable printer. The generated images is straightforward, but the module has a number of extra functions to increase the security properties of the printed ink.

Error creating thumbnail: Unable to save thumbnail to destination
The reactive ink (yellow) and dummy ink (magenta) are base inks in the printer that are printed in contiguous blocks. When printed, the inks are indistinguishable from each other.

IISG provides the following functions:

  • Generate  — Generates an Invisible Ink Image using the specified size, font, and other formatting data.
  • GenBlocks  — Takes a generated image and creates contiguous blocks of a given size, with a given amount of horizontal and vertical white spaces on each block. See the diagram for an illustration. N.B. Should not be used with anti-aliased fonts.
  • Munge  — On a pixel by pixel basis, randomly add or subtract from the "brightness" of a given image.
  • BlockMunge  — On a block by block basis, randomly add or subtract from the "brightness" of a given image.
  • Mask  — On a pixel by pixel basis, apply a random amount of cyan.
  • BlockMask  — On a block by block basis, apply a random amount of cyan.
  • GetBMP  — Return a bitmap of the generated image.

Any function above that relies on a random function is assumed to be taking as a parameter a pre-keyed cryptographically secure pseudo-random number generator. Also, white is considered a "null" color and any operations on it should return white.

Error creating thumbnail: Unable to save thumbnail to destination
Scantegrity II ballot and decoder pen.
Left: Unmarked optical scan bubble.
Right: Marked optical scan bubble revealing confirmation code "FY".