|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbitmaps.PDPixel
public class PDPixel
Provides a wrapper and functionality for pixels used in the Progressive Divisibility (Coltuc's) method. Functionality included checking for constraints against another pixel, embedding a value, extracting a correction value, etc.
We define the operations of transforming (consisting of transforming the pixel but NOT embedding a value), embedding (adding a value to a transformed pixel), and adjusting (determining, subtracting, and returning the appropriate (ci) value to make the pixel divisible). After transforming and embedding, a pixel is guaranteed to be NOT divisible.
TODO: Having separate xi() and yi() calls may be confusing.
| Field Summary | |
|---|---|
private static boolean |
DEBUG
|
private int |
n
|
private boolean |
negativeValueCase
|
private Pixel |
nextPixel
|
private Pixel |
pixel
|
private boolean |
transformed
Transformed can be set during embedding when the pixel is actually transformed, or (perhaps) during decoding if a pixel is identified as having been transformed, though this may not be necessary. |
| Constructor Summary | |
|---|---|
PDPixel(Pixel pixel,
Pixel nextPixel,
int n)
|
|
| Method Summary | |
|---|---|
int |
adjust()
Should only be called on a pixel that cannot be transformed. |
void |
embed(int toEmbed)
Should only be done after a pixel has been transformed. |
int |
invert()
Extracts the value embedded in the pixel and inverts the transform to restore the original pixel value. |
boolean |
isDivisible()
Checks condition for divisibility by (n+1). |
boolean |
isNegativeValueCase()
Indicates whether the negative value case has occurred during adjustment. |
boolean |
isTransformable()
Checks constraints for transformability and embeddability. |
boolean |
isTransformed(boolean embedding)
If the call is made during the encoding phase, indicates whether this pixel has already been transformed. |
boolean |
isUnderThreshold()
Returns true if the current pixel is at/under the threshold for special handling due to the negative value case. |
void |
reduceValue()
Reduces the pixel value by (n+1). |
void |
restore(int ci)
Restores the pixel value by adding the appropriate (ci) value back in. |
java.lang.String |
toString()
|
void |
transform()
Transforms the pixel. |
private int |
xi()
Returns the integer value of the current pixel intensity. |
private int |
xi1()
Returns the integer value of the next pixel intensity. |
private int |
yi()
Returns the integer value of the current pixel intensity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final boolean DEBUG
private final Pixel pixel
private final Pixel nextPixel
private final int n
private boolean negativeValueCase
private boolean transformed
It is probably only relevant during the embedding phase, and thus is given a default value of false.
If a pixel does not get transformed, it will be adjusted instead.
| Constructor Detail |
|---|
public PDPixel(Pixel pixel,
Pixel nextPixel,
int n)
| Method Detail |
|---|
public boolean isTransformable()
public boolean isDivisible()
public void transform()
public void embed(int toEmbed)
public int invert()
public int adjust()
public void restore(int ci)
ci - public boolean isTransformed(boolean embedding)
embedding - true if check is made during encoding phase, false if made
during decoding phase
public boolean isNegativeValueCase()
adjust() method.
private int xi()
yi().
private int yi()
xi().
private int xi1()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isUnderThreshold()
adjust().
public void reduceValue()
adjust().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||