Sigcapboxapply() - VeriFone MX800 series Programmer's Manual

Hide thumbs Also See for MX800 series:
Table of Contents

Advertisement

D
D
EVICE
RIVERS

SigCapBoxApply()

SigCapBoxApply()
NOTE
126
M
X
800 S
P
ERIES
ROGRAMMERS
This function takes the results of SigCapGet() and applies a signature box to
the data. Data outside the box is replaced by PENUP. The data is also
compressed to remove adjacent duplicate points and adjacent PENUPs. The
function returns the new number of unique points. It is up to the application to
supply the signature box to the function call. The box coordinates are in screen
form, i.e. x 0...319 and y 0...239. Signature data is in touchpad coordinates
0...2047 and 0...1535 to maintain best resolution. It is not necessary to call this
function before calling SigCap2Tiff().
Extra notes on using this function with SigCapGet and SigCapCount:
By design, a single pen up (-1,-1,-1) is inserted at the beginning of the buffer as soon
as signature capture is started. That is why a count of 1 is returned and the point is
returned as (-1,-1,-1). As long as the pen stays up, no further points are inserted. Once
the pen goes down, new data (x,y,z) are added. A pen up is also always inserted at the
end of the buffer so that if the pen were able to go down and up again fast enough for
just one down point to be registered, the count would be 3 (initial pen up, the down
point, and another pen up). This mimics Omni 7X00 behavior and is not a bug.
SigCapGet and SigCapCount always return the total number of raw points collected.
The longer the pen is in contact with the keypad, the higher the count will be -- it does
not matter if the points are in the box or not. Part of this count will be the residue from
the initial pressing of the STROKES button in the test program. Those points will be
replaced by -1,-1,-1 when SigCapBoxApply is called — refer to the next bullet item.
The positive result of the above function should be passed as the count parameter to
SigCapBoxApply.
SigCapBoxApply does two things on the fly:
- It replaces all points outside the box by -1,-1,-1
- It compresses (shuffles toward the beginning of the buffer) the data so that all
adjacent duplicates (for example several -1,-1,-1 in a row after applying the box)
are replaced by a SINGLE copy of the data (in this case a single -1,-1,-1).
This function returns the new total number of points after compression.
The original and compressed counts will almost certainly differ.
When displaying the compressed data, the return value of SigCapBoxApply should
be used as the new size unless one deliberately wants to display the raw data.
Prototype
int SigCapBoxApply(xyz_t *Sig, int count, SigCapBox_t *box);
G
UIDE

Advertisement

Table of Contents
loading

Table of Contents