CIC iSign Version 1.2

InkTools
Class CicInkShrink

java.lang.Object
  |
  +--InkTools.CicInkShrink

public class CicInkShrink
extends java.lang.Object

This class provides methods for compressing ink data. In InkTools, ink data is stored in CicDoodle objects. This ink data can be serialized through the CicDoodle.streamIn and CicDoodle.streamOut methods. Methods to enable ink compression for these functions are provided (CicDoodle.setCompressionLevel). There is no need to use this class directly.

Version:
1.0
Author:
CIC

Constructor Summary
CicInkShrink()
          Constructs a new InkShrink object.
 
Method Summary
static boolean getDoodleFromSignature(SigInk.Signature sig, CicDoodle doodle)
          Converts a signature object into a doodle object
 byte[] Shrinkdata(CicDoodle doodle, int compLevel, Encrypt.EncryptParams encrypt)
          This function will compress the ink data in the doodle into a byte array.
 boolean unShrinkData(byte[] inStream, Encrypt.EncryptParams encrypt, CicDoodle doodle)
          This funtion takes a previously compressed byte stream and uncompresses it into a CicDoodle structure.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CicInkShrink

public CicInkShrink()
Constructs a new InkShrink object.

Method Detail

Shrinkdata

public byte[] Shrinkdata(CicDoodle doodle,
                         int compLevel,
                         Encrypt.EncryptParams encrypt)
This function will compress the ink data in the doodle into a byte array.

Parameters:
doodle - The doodle containing the ink data
compLevel - The compression level used for the compression: -1 = no compression, 0 = lossless compression 1 to 5 ink compresssion with 5 the highest compression
encrypt - The EncryptParams class for encryption settings or null for no encryption
Returns:
The compressed byte array with 'array.length' length or null if an error occured.

unShrinkData

public boolean unShrinkData(byte[] inStream,
                            Encrypt.EncryptParams encrypt,
                            CicDoodle doodle)
This funtion takes a previously compressed byte stream and uncompresses it into a CicDoodle structure. Note: The X and Y extent gets not restored in the doodle. Use the streamOut / streamIn function of the CicDoodle class instead this low level function for this purpose.

Parameters:
inStream - A byte array containing the ink data to get uncompressed.
encrypt - If the data is compressed with encryption, the encryption key must be set in this structure. The used encryption algorithm is stored within the compressed data.
doodle - The newly created CicDoodle structure containing the uncompressed ink data is return here.
Returns:
true if successfull, otherwise false

getDoodleFromSignature

public static boolean getDoodleFromSignature(SigInk.Signature sig,
                                             CicDoodle doodle)
Converts a signature object into a doodle object

Parameters:
sig - The signature object
Returns:
True or false

CIC iSign Version 1.2