coders
Class ProgressiveDivisibility

java.lang.Object
  extended by coders.ProgressiveDivisibility

public class ProgressiveDivisibility
extends java.lang.Object

Note: Scheme requires n >= 4 due to escape value requirements.

Author:
Jonathan L Dautrich Jr.

Field Summary
static int END_C
           
static int NEG_VALUE_CASE
          Constants to handle negative value case.
static int NON_NEG_VALUE_CASE
           
 
Constructor Summary
ProgressiveDivisibility()
           
 
Method Summary
static int bitsPerInteger(int n)
           
static java.util.ArrayList<PDPixel> getPixels(Bitmap bitmap, int n)
           
static java.util.ArrayList<Pixel> getPlainPixels(Bitmap bitmap, int n)
          In some cases (e.g.
static java.util.LinkedList<java.lang.Integer> payloadBitsToIntegers(BitSequence payload, int n)
          Converts a payload BitSequence to a sequence of integers that all satisfy 1 <= i <= n.
static BitSequence payloadIntegersToBits(java.util.LinkedList<java.lang.Integer> payload, int n)
          Converts a payload of integers satisfying 1 <= i <= n into a bit sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEG_VALUE_CASE

public static final int NEG_VALUE_CASE
Constants to handle negative value case. See PDPixel.adjust().

See Also:
Constant Field Values

NON_NEG_VALUE_CASE

public static final int NON_NEG_VALUE_CASE
See Also:
Constant Field Values

END_C

public static final int END_C
See Also:
Constant Field Values
Constructor Detail

ProgressiveDivisibility

public ProgressiveDivisibility()
Method Detail

getPixels

public static java.util.ArrayList<PDPixel> getPixels(Bitmap bitmap,
                                                     int n)

getPlainPixels

public static java.util.ArrayList<Pixel> getPlainPixels(Bitmap bitmap,
                                                        int n)
In some cases (e.g. for decoding) it will be necessary to have a list of the simple pixels from the bitmap from which the PDPixels can be constructed on the fly.

Parameters:
bitmap -
n -
Returns:

payloadBitsToIntegers

public static java.util.LinkedList<java.lang.Integer> payloadBitsToIntegers(BitSequence payload,
                                                                            int n)
Converts a payload BitSequence to a sequence of integers that all satisfy 1 <= i <= n. For now, each integer encodes a fixed integer number of bits. TODO: Not sure whether we should allow encoding across integers...does that even make sense?

Parameters:
payload -
n -
Returns:

payloadIntegersToBits

public static BitSequence payloadIntegersToBits(java.util.LinkedList<java.lang.Integer> payload,
                                                int n)
Converts a payload of integers satisfying 1 <= i <= n into a bit sequence. For now, each integer encodes a fixed integer number of bits.

Parameters:
payload -
n -
Returns:

bitsPerInteger

public static int bitsPerInteger(int n)