| java.lang.Object java.awt.image.MemoryImageSource sun.porting.utils.BitmapImageSource
BitmapImageSource | public class BitmapImageSource extends MemoryImageSource (Code) | | A memory image source whose memory representation consists of
a packed bitmap (32 bits packed into each int) and an IndexColorModel
describing the colors represented by the bits (i.e. the background color
maps to pixel value 0 and the foreground color to pixel value 1).
version: 1.8 |
Constructor Summary | |
public | BitmapImageSource(int w, int h, int pix, IndexColorModel cm) Create an image source for an image of the given width and height,
with packed bitmap data stored in pix[] and using the given
IndexColorModel to translate the bits into colors.
Parameters: w - The width of the image Parameters: h - The height of the image Parameters: pix - The bitmap data, packed 32 pixels per int. |
Method Summary | |
protected static IndexColorModel | makeColorModel(Color fg, Color bg) Create an IndexColorModel of size 2 that translates color 0 to the given
background color and color 1 to the given foreground color. | protected static byte[] | translatePixels(int pix, int width, int height) Translate bitmap image data into byte image data.
Takes a bitmap packed 32 pixels to an int (i.e. |
BitmapImageSource | public BitmapImageSource(int w, int h, int pix, IndexColorModel cm)(Code) | | Create an image source for an image of the given width and height,
with packed bitmap data stored in pix[] and using the given
IndexColorModel to translate the bits into colors.
Parameters: w - The width of the image Parameters: h - The height of the image Parameters: pix - The bitmap data, packed 32 pixels per int. The data mustbe padded so that each scanline starts on an int boundary. Parameters: cm - The color model describing the meanings of 0 (background)and 1 (foreground). |
makeColorModel | protected static IndexColorModel makeColorModel(Color fg, Color bg)(Code) | | Create an IndexColorModel of size 2 that translates color 0 to the given
background color and color 1 to the given foreground color.
Parameters: fg - The desired foreground color Parameters: bg - The desired background color An IndexColorModel which maps 1/0 to the given colors. |
translatePixels | protected static byte[] translatePixels(int pix, int width, int height)(Code) | | Translate bitmap image data into byte image data.
Takes a bitmap packed 32 pixels to an int (i.e. 1 bit of data per pixel,
plus padding), and returns one byte of data per pixel, no padding.
Parameters: pix - The input pixel data (bitmap data) Parameters: width - The width of the input bitmap Parameters: height - The height of the input bitmap A byte array containing the translated bitmap. |
Methods inherited from java.awt.image.MemoryImageSource | public synchronized void addConsumer(ImageConsumer ic)(Code)(Java Doc) public synchronized boolean isConsumer(ImageConsumer ic)(Code)(Java Doc) public void newPixels()(Code)(Java Doc) public synchronized void newPixels(int x, int y, int w, int h)(Code)(Java Doc) public synchronized void newPixels(int x, int y, int w, int h, boolean framenotify)(Code)(Java Doc) public synchronized void newPixels(byte[] newpix, ColorModel newmodel, int offset, int scansize)(Code)(Java Doc) public synchronized void newPixels(int[] newpix, ColorModel newmodel, int offset, int scansize)(Code)(Java Doc) public synchronized void removeConsumer(ImageConsumer ic)(Code)(Java Doc) public void requestTopDownLeftRightResend(ImageConsumer ic)(Code)(Java Doc) public synchronized void setAnimated(boolean animated)(Code)(Java Doc) public synchronized void setFullBufferUpdates(boolean fullbuffers)(Code)(Java Doc) public void startProduction(ImageConsumer ic)(Code)(Java Doc)
|
|
|