|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbitmaps.Bitmap
public class Bitmap
Note that the use of integers prevents images from being used if they have more than Integer.MAX_VALUE pixels either vertically or horizontally. Note: Pixel rows must always be a multiple of four in length and residual spaces are padded with zeroes...these should not be modified by any steganography implementations.
| Field Summary | |
|---|---|
(package private) int |
bitsPerPixel
|
(package private) int |
byteRowPadding
|
(package private) int |
bytesPerPixel
|
(package private) int |
colorTableCount
|
(package private) long |
dataStartLocation
|
private static int |
FILE_HEADER_LENGTH
|
private byte[] |
fileHeader
|
(package private) long |
fileSize
|
(package private) int |
fillerLength
|
private byte[] |
fillerSpace
|
private byte[] |
infoHeader
|
(package private) int |
infoHeaderLength
|
private static int |
IOS
|
private static int |
MIN_INFO_HEADER_LENGTH
|
(package private) int |
pixelHeight
|
private Pixel[][] |
pixels
|
(package private) int |
pixelWidth
|
(package private) int |
rowByteCount
|
private byte[][] |
rowPadding
|
private byte[] |
trailingData
|
private boolean |
verbose
|
| Constructor Summary | |
|---|---|
Bitmap(Bitmap bitmap)
Creates a new Bitmap from the specified bitmap, deep cloning it down to the primitive fields. |
|
Bitmap(java.io.File file)
|
|
Bitmap(int bitsPerPixel,
int pixelHeight,
int pixelWidth)
Creates a new bitmap, setting header values based on parameters. |
|
| Method Summary | |
|---|---|
private void |
extractHeaderData()
Populates the global header fields with the appropriate values from the byte arrays. |
private void |
extractPixelData(java.io.FileInputStream inStream)
Stores the pixel data from the file in the 2-D pixels Pixel object array |
static long |
getDataValue(byte[] bytes,
int start,
int end)
Bytes are expected to be in little endian format. |
int |
getPixelCount()
|
int |
getPixelHeight()
|
Pixel[][] |
getPixels()
Returns the bitmap pixel array reference. |
int |
getPixelWidth()
|
private void |
handleException(java.lang.Exception e)
|
boolean |
isVerbose()
|
private int |
longToInt(long val,
java.lang.String err)
Converts a long to an int, ensuring the value does not exceed max int value. |
private void |
printArraySizes()
|
private void |
printHeaderData()
|
static long |
setDataValue(long value,
byte[] bytes,
int start,
int end)
Bytes will be in little endian format. |
private void |
setHeaderData()
Sets data in the infoHeader and fileHeader based on the bitmaps current field values. |
void |
setVerbose(boolean verbose)
|
private void |
writePixelBitData(java.io.FileOutputStream outStream)
|
private void |
writePixelData(java.io.FileOutputStream outStream)
|
void |
writeToFile(java.io.File outFile)
Writes the current bitmap out to the specified file. |
void |
writeToFileGrayscale(java.io.File outFile)
Writes the current bitmap out to the specified file, first matching all blue and green pixel values to the red pixel values, to produce a gray-scale image. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int FILE_HEADER_LENGTH
private static final int MIN_INFO_HEADER_LENGTH
private static final int IOS
private byte[] fileHeader
private byte[] infoHeader
private byte[] fillerSpace
private Pixel[][] pixels
private byte[][] rowPadding
private byte[] trailingData
private boolean verbose
long fileSize
int infoHeaderLength
long dataStartLocation
int fillerLength
int pixelWidth
int pixelHeight
int bitsPerPixel
int bytesPerPixel
int byteRowPadding
int rowByteCount
int colorTableCount
| Constructor Detail |
|---|
public Bitmap(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic Bitmap(Bitmap bitmap)
bitmap -
public Bitmap(int bitsPerPixel,
int pixelHeight,
int pixelWidth)
bitsPerPixel - pixelHeight - pixelWidth - | Method Detail |
|---|
private void setHeaderData()
public Pixel[][] getPixels()
public void writeToFile(java.io.File outFile)
outFile - public void writeToFileGrayscale(java.io.File outFile)
outFile -
private void writePixelData(java.io.FileOutputStream outStream)
throws java.io.IOException
java.io.IOException
private void writePixelBitData(java.io.FileOutputStream outStream)
throws java.io.IOException
java.io.IOExceptionprivate void extractHeaderData()
private void printHeaderData()
private void printArraySizes()
private void extractPixelData(java.io.FileInputStream inStream)
throws java.io.IOException
java.io.IOException
public static long getDataValue(byte[] bytes,
int start,
int end)
bytes - start - end -
public static long setDataValue(long value,
byte[] bytes,
int start,
int end)
bytes - start - end -
private int longToInt(long val,
java.lang.String err)
val - err -
private void handleException(java.lang.Exception e)
public int getPixelWidth()
public int getPixelHeight()
public int getPixelCount()
public boolean isVerbose()
public void setVerbose(boolean verbose)
verbose - sets verbose output boolean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||