|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Canvas
converter
public class converter
This class initialize all the variables including the the integers, pixels and so fourth. The state is enable. There are no OS/Hardware dependencies and no variances. There is no need for any security constraints and no references to external specifications.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Canvas |
---|
java.awt.Canvas.AccessibleAWTCanvas |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private int |
bfOffBits
Initialization of bit map off bits by addition of BITMAPFILEHEADER and BITMAPINFOHEADER. |
private int |
bfReserved1
Initialization of bitmap file reserved1 with the value 0. |
private int |
bfReserved2
Initialization of bitmap file reserved2 with the value 0. |
private int |
bfSize
Initialization of bitmap file size with the value 0. |
private byte[] |
bfType
Initialization of bfType as an array of type byte with the value B and M casted by byte. |
private int |
biBitCount
Initialization of bitmap info bit count with the size of 24. |
private int |
biClrImportant
Initialization of bitmap info important color indicator with the size of 0. |
private int |
biClrUsed
Initialization of bitmap info color used indicator with the size of 0. |
private int |
biCompression
Initialization of bitmap info compression with the size of 0. |
private int |
biHeight
Initialization of bitmap info height with the size of 0. |
private int |
biPlanes
Initialization of bitmap info planes with the size of 1. |
private int |
biSize
Initialization of bitmap info size by BITMAPINFOHEADER_SIZE. |
private int |
biSizeImage
Initialization of bitmap info image size with the size of 0x030000. |
private int[] |
bitmap
Bipmap integer array that creates an bitmap raw data. |
private byte[] |
bitmapFileHeader
Initialization of bitmap file header as an array of type byte with the size of 14. |
private static int |
BITMAPFILEHEADER_SIZE
A size of bitmap file header to 14 as a final integer. |
private byte[] |
bitmapInfoHeader
Initialization of bitmap info header as an array of type byte with the size of 40. |
private static int |
BITMAPINFOHEADER_SIZE
A size of bipmap info header to 40 as a final integer. |
private int |
biWidth
Initialization of bitmap info width with the size of 0. |
private int |
biXPelsPerMeter
Initialization of bitmap info x-pixel per meter with the size of 0x0. |
private int |
biYPelsPerMeter
Initialization of bitmap info y-pixel per meter with the size of 0x0. |
(package private) short |
BMPbitsPerPixel
Number of bits per pixel - 1, 4, 8, or 24 (no color map). |
(package private) int |
BMPcolorsImportant
Number of important colors (appear first in palette) (0 means all are important). |
(package private) int |
BMPcolorsUsed
Number of colors in palette (if 0, calculate). |
(package private) int |
BMPcompression
Compression methods used: 0 (none), 1 (8-bit RLE), or 2 (4-bit RLE). |
(package private) int |
BMPheadersize
Integer value of bitmap header size. |
(package private) int |
BMPheight
Integer value of bitmap height size in pixels. |
(package private) int |
BMPhorzResolution
Horizontal resolution, pixels/meter (may be 0). |
(package private) java.awt.Image |
BMPimage
Bitmap image representation. |
(package private) int |
BMPimageoffset
Integer value of bitmap image offset. |
(package private) short |
BMPplanes
Short value of color planes, always 1. |
(package private) int |
BMPreserved
Integer value of the preserved description of bitmap. |
(package private) int |
BMPsize
Integer value of the size of bitmap that describes the header in bytes. |
(package private) int |
BMPsizeOfBitmap
Size of bitmap in bytes (may be 0: if so, calculate). |
(package private) int |
BMPvertResolution
Vertical resolution, pixels/meter (may be 0). |
(package private) int |
BMPwidth
Integer value of bitmap width size in pixels. |
private byte[] |
bytebuffer
bytebuffer object that creates byte type array. |
(package private) int |
bytesPerLine
Indicator of bytes per line. |
(package private) int |
colorIndex
Color index. |
(package private) java.awt.Color[] |
colorTable
Color table array. |
private java.io.DataInputStream |
d
DataInputStream object to be used with byte-based file stream. |
private java.io.FileOutputStream |
fo
FileOutputStream object that performs byte-based output stream. |
private int |
i
Integer value to be used as an index. |
private int |
j
Integer value to be used as an index. |
(package private) int[] |
pixels
Array of pixels. |
(package private) byte[] |
scanline
Byte type array of scan line. |
private int |
type
Bitmap type with integer value. |
private short |
windowInt
windowInt short value to be used when converting occurs between long and integer. |
private int |
windowLong
windowLong integer value to be used when converting occurs between long and integer. |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
converter()
|
Method Summary | |
---|---|
void |
BufferedImageToFile(java.io.FileOutputStream in_fo,
java.awt.image.BufferedImage parImage,
int type)
This method sets up the image in the buffer. |
boolean |
convertImage(java.awt.Image parImage,
int parWidth,
int parHeight)
convertImage converts the memory image to the bitmap format (BRG). |
java.awt.image.BufferedImage |
FileToBufferedImage(java.io.FileInputStream is)
This method sets up the image in the buffer. |
short |
flipInt(byte[] byteFlip)
Reads byte array object and converts it to short value. |
int |
flipLong(byte[] byteFlip)
Reads byte array object and converts it to int value. |
byte[] |
intToDWord(int parValue)
intToDWord converts an int to a double word, where the return value is stored in a 4-byte array. |
byte[] |
intToWord(int parValue)
intToWord converts an int to a word, where the return value is stored in a 2-byte array. |
static void |
main(java.lang.String[] args)
This method is the main function that calls all the other ones There is no state transition. |
void |
parseit()
This method calls the parseit function and initialize it to 0 There is no state transition. |
void |
parseit(int typeFlag)
This method prints out the results of the image There is no state transition. |
short |
readInt(java.io.DataInputStream d)
Reads DataInputStream and converts it to long value. |
int |
readLong(java.io.DataInputStream d)
Reads DataInputStream and converts it to int value. |
void |
save(java.awt.Image parImage,
int parWidth,
int parHeight)
The saveMethod is the main method of the process. |
java.awt.Color |
win2Color(int colorValue)
Sets windows RGB color value. |
void |
writeBitmap()
writeBitmap converts the image returned from the pixel grabber to the format required. |
void |
writeBitmapFileHeader()
writeBitmapFileHeader writes the bitmap file header to the file. |
void |
writeBitmapInfoHeader()
writeBitmapInfoHeader writes the bitmap information header to the file. |
Methods inherited from class java.awt.Canvas |
---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, paint, update |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final int BITMAPFILEHEADER_SIZE
private static final int BITMAPINFOHEADER_SIZE
private byte[] bitmapFileHeader
private byte[] bfType
private int bfSize
private int bfReserved1
private int bfReserved2
private int bfOffBits
private byte[] bitmapInfoHeader
private int biSize
private int biWidth
private int biHeight
private int biPlanes
private int biBitCount
private int biCompression
private int biSizeImage
private int biXPelsPerMeter
private int biYPelsPerMeter
private int biClrUsed
private int biClrImportant
private int type
private int[] bitmap
private java.io.FileOutputStream fo
private byte[] bytebuffer
private int i
private int j
private int windowLong
private short windowInt
private java.io.DataInputStream d
int BMPsize
int BMPreserved
int BMPimageoffset
int BMPheadersize
int BMPwidth
int BMPheight
short BMPplanes
short BMPbitsPerPixel
int BMPcompression
int BMPsizeOfBitmap
int BMPhorzResolution
int BMPvertResolution
int BMPcolorsUsed
int BMPcolorsImportant
java.awt.Color[] colorTable
int[] pixels
int colorIndex
int bytesPerLine
byte[] scanline
java.awt.Image BMPimage
Constructor Detail |
---|
public converter()
Method Detail |
---|
public java.awt.image.BufferedImage FileToBufferedImage(java.io.FileInputStream is)
is
- This is a FileInputStream variable used to get data input stream
public void BufferedImageToFile(java.io.FileOutputStream in_fo, java.awt.image.BufferedImage parImage, int type)
in_fo
- is a FileInputStream variableparImage
- is a BufferedImage variabletype
- is a int variablepublic void parseit() throws java.io.IOException
java.io.IOException
- there is an exceptionpublic void parseit(int typeFlag) throws java.io.IOException
typeFlag
- this is an int variable
java.io.IOException
- there is an exceptionpublic java.awt.Color win2Color(int colorValue)
colorValue
- used to set windows RGB color value.
public int readLong(java.io.DataInputStream d)
d
- DataInputStream.
public short readInt(java.io.DataInputStream d)
d
- DataInputStream.
public int flipLong(byte[] byteFlip)
byteFlip
- byte type array.
public short flipInt(byte[] byteFlip)
byteFlip
- byte type array.
public void save(java.awt.Image parImage, int parWidth, int parHeight)
parImage
- Image object.parWidth
- int value that determines the size of width.parHeight
- int value that determines the size of height.public boolean convertImage(java.awt.Image parImage, int parWidth, int parHeight)
parImage
- Image object.parWidth
- int value that determines the size of width.parHeight
- int value that determines the size of height.
public void writeBitmap()
public void writeBitmapFileHeader()
public void writeBitmapInfoHeader()
public byte[] intToWord(int parValue)
parValue
- resets the value of the elements in the byte array.
public byte[] intToDWord(int parValue)
parValue
- resets the value of elements in the byte array.
public static void main(java.lang.String[] args)
args
- This is a string variable
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |