java.awt.image

Class BufferedImage

Implemented Interfaces:
RenderedImage, Transparency, WritableRenderedImage

public class BufferedImage
extends Image
implements WritableRenderedImage, Transparency

The BufferedImage subclass describes an Image with an accessible buffer of image data. A BufferedImage is comprised of a ColorModel and a Raster of image data. The number and types of bands in the SampleModel of the Raster must match the number and types required by the ColorModel to represent its color and alpha components. All BufferedImage objects have an upper left corner coordinate of (0, 0). Any Raster used to construct a BufferedImage must therefore have minX=0 and minY=0.

This class relies on the data fetching and setting methods of Raster, and on the color characterization methods of ColorModel.

See Also:
ColorModel, Raster, WritableRaster

Field Summary

static int
TYPE_3BYTE_BGR
Represents an image with 8-bit RGB color components, corresponding to a Windows-style BGR color model) with the colors Blue, Green, and Red stored in 3 bytes.
static int
TYPE_4BYTE_ABGR
Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha.
static int
TYPE_4BYTE_ABGR_PRE
Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha.
static int
TYPE_BYTE_BINARY
Represents an opaque byte-packed 1, 2, or 4 bit image.
static int
TYPE_BYTE_GRAY
Represents a unsigned byte grayscale image, non-indexed.
static int
TYPE_BYTE_INDEXED
Represents an indexed byte image.
static int
TYPE_CUSTOM
Image type is not recognized so it must be a customized image.
static int
TYPE_INT_ARGB
Represents an image with 8-bit RGBA color components packed into integer pixels.
static int
TYPE_INT_ARGB_PRE
Represents an image with 8-bit RGBA color components packed into integer pixels.
static int
TYPE_INT_BGR
Represents an image with 8-bit RGB color components, corresponding to a Windows- or Solaris- style BGR color model, with the colors Blue, Green, and Red packed into integer pixels.
static int
TYPE_INT_RGB
Represents an image with 8-bit RGB color components packed into integer pixels.
static int
TYPE_USHORT_555_RGB
Represents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha.
static int
TYPE_USHORT_565_RGB
Represents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha.
static int
TYPE_USHORT_GRAY
Represents an unsigned short grayscale image, non-indexed).

Fields inherited from class java.awt.Image

SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty, accelerationPriority

Fields inherited from interface java.awt.Transparency

BITMASK, OPAQUE, TRANSLUCENT

Constructor Summary

BufferedImage(int width, int height, int imageType)
Constructs a BufferedImage of one of the predefined image types.
BufferedImage(int width, int height, int imageType, IndexColorModel cm)
Constructs a BufferedImage of one of the predefined image types: TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED.
BufferedImage(ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, Hashtable properties)
Constructs a new BufferedImage with a specified ColorModel and Raster.

Method Summary

void
addTileObserver(TileObserver to)
Adds a tile observer.
void
coerceData(boolean isAlphaPremultiplied)
Forces the data to match the state specified in the isAlphaPremultiplied variable.
WritableRaster
copyData(WritableRaster outRaster)
Computes an arbitrary rectangular region of the BufferedImage and copies it into a specified WritableRaster.
Graphics2D
createGraphics()
Creates a Graphics2D, which can be used to draw into this BufferedImage.
void
flush()
Flushes all resources being used to cache optimization information.
WritableRaster
getAlphaRaster()
Returns a WritableRaster representing the alpha channel for BufferedImage objects with ColorModel objects that support a separate spatial alpha channel, such as ComponentColorModel and DirectColorModel.
ImageCapabilities
getCapabilities(GraphicsConfiguration gc)
This overrides Image.getCapabilities(gc) to get the capabilities of its surfaceManager.
ColorModel
getColorModel()
Returns the ColorModel.
Raster
getData()
Returns the image as one large tile.
Raster
getData(Rectangle rect)
Computes and returns an arbitrary region of the BufferedImage.
Graphics
getGraphics()
This method returns a Graphics2D, but is here for backwards compatibility.
int
getHeight()
Returns the height of the BufferedImage.
int
getHeight(ImageObserver observer)
Returns the height of the BufferedImage.
int
getMinTileX()
Returns the minimum tile index in the x direction.
int
getMinTileY()
Returns the minimum tile index in the y direction.
int
getMinX()
Returns the minimum x coordinate of this BufferedImage.
int
getMinY()
Returns the minimum y coordinate of this BufferedImage.
int
getNumXTiles()
Returns the number of tiles in the x direction.
int
getNumYTiles()
Returns the number of tiles in the y direction.
Object
getProperty(String name)
Returns a property of the image by name.
Object
getProperty(String name, ImageObserver observer)
Returns a property of the image by name.
String[]
getPropertyNames()
Returns an array of names recognized by getProperty(String) or null, if no property names are recognized.
int
getRGB(int x, int y)
Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace.
int[]
getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
Returns an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, from a portion of the image data.
WritableRaster
getRaster()
Returns the WritableRaster.
SampleModel
getSampleModel()
Returns the SampleModel associated with this BufferedImage.
ImageProducer
getSource()
Returns the object that produces the pixels for the image.
Vector
getSources()
Returns a Vector of RenderedImage objects that are the immediate sources, not the sources of these immediate sources, of image data for this BufferedImage.
BufferedImage
getSubimage(int x, int y, int w, int h)
Returns a subimage defined by a specified rectangular region.
Raster
getTile(int tileX, int tileY)
Returns tile (tileXtileY).
int
getTileGridXOffset()
Returns the x offset of the tile grid relative to the origin, For example, the x coordinate of the location of tile (0, 0).
int
getTileGridYOffset()
Returns the y offset of the tile grid relative to the origin, For example, the y coordinate of the location of tile (0, 0).
int
getTileHeight()
Returns the tile height in pixels.
int
getTileWidth()
Returns the tile width in pixels.
int
getTransparency()
Returns the transparency.
int
getType()
Returns the image type.
int
getWidth()
Returns the width of the BufferedImage.
int
getWidth(ImageObserver observer)
Returns the width of the BufferedImage.
WritableRaster
getWritableTile(int tileX, int tileY)
Checks out a tile for writing.
Point[]
getWritableTileIndices()
Returns an array of Point objects indicating which tiles are checked out for writing.
boolean
hasTileWriters()
Returns whether or not any tile is checked out for writing.
boolean
isAlphaPremultiplied()
Returns whether or not the alpha has been premultiplied.
boolean
isTileWritable(int tileX, int tileY)
Returns whether or not a tile is currently checked out for writing.
void
releaseWritableTile(int tileX, int tileY)
Relinquishes permission to write to a tile.
void
removeTileObserver(TileObserver to)
Removes a tile observer.
void
setData(Raster r)
Sets a rectangular region of the image to the contents of the specified Raster r, which is assumed to be in the same coordinate space as the BufferedImage.
void
setRGB(int x, int y, int rgb)
Sets a pixel in this BufferedImage to the specified RGB value.
void
setRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
Sets an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, into a portion of the image data.
String
toString()
Returns a String representation of this BufferedImage object and its values.

Methods inherited from class java.awt.Image

flush, getAccelerationPriority, getCapabilities, getGraphics, getHeight, getProperty, getScaledInstance, getSource, getWidth, setAccelerationPriority

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

TYPE_3BYTE_BGR

public static final int TYPE_3BYTE_BGR
Represents an image with 8-bit RGB color components, corresponding to a Windows-style BGR color model) with the colors Blue, Green, and Red stored in 3 bytes. There is no alpha. The image has a ComponentColorModel. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite documentation.
Field Value:
5
Usages and Demos :

View More Examples of BufferedImage.TYPE_3BYTE_BGR
   1: public static void newimage() {
   2: bi=new java.awt.image.BufferedImage(layout.layout.w, layout.layout.h, java.awt.image.BufferedImage.TYPE_3BYTE_BGR); 
   3: }
   4:         ...
   5: ix=plot.panx; iy=plot.pany; iw=plot.panw; ih=plot.panh;
   6: bi=new java.awt.image.BufferedImage(iw, ih, java.awt.image.BufferedImage.TYPE_3BYTE_BGR); 
   7: g=bi.getGraphics(); g.translate(-ix, -iy);
   8: g.setColor(colfont.backcol); g.fillRect(ix,iy,iw,ih);
   9: modloop.mainloop();

View Full Code Here
   1:         AffineTransformOp.TYPE_BILINEAR);
   2:     BufferedImage r = new BufferedImage(_w, _h, BufferedImage.TYPE_3BYTE_BGR);
   3:     res.filter(_init, r);
   4:     return r;
   5:   }

View Full Code Here
   1:             
   2:             BufferedImage outputImage = new BufferedImage(128,128,BufferedImage.TYPE_3BYTE_BGR);
   3:             ArcSDERasterBandCopier bandCopier = ArcSDERasterBandCopier.getInstance(rAttr.getPixelType(), rAttr.getTileWidth(), rAttr.getTileHeight());
   4:             
   5:             SeRasterTile rTile = r.getRasterTile();

View Full Code Here
   1:         this.currentImage =
   2:             new BufferedImage(1, 1, BufferedImage.TYPE_3BYTE_BGR);
   3:         this.label = new JLabel(new ImageIcon(currentImage));
   4:         imagePanel.add(label, BorderLayout.CENTER);

View Full Code Here
   1:             
   2:             BufferedImage curImage = new BufferedImage(image.getWidth(), image.getHeight(),BufferedImage.TYPE_3BYTE_BGR);
   3:             Graphics2D g = (Graphics2D) curImage.createGraphics();
   4:             g.drawImage(image,0,0,null);
   5:             

View Full Code Here

TYPE_4BYTE_ABGR

public static final int TYPE_4BYTE_ABGR
Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha. The image has a ComponentColorModel with alpha. The color data in this image is considered not to be premultiplied with alpha. The byte data is interleaved in a single byte array in the order A, B, G, R from lower to higher byte addresses within each pixel.
Field Value:
6
Usages and Demos :

View More Examples of BufferedImage.TYPE_4BYTE_ABGR
   1:             
   2:             Image img = new BufferedImage(w,h,BufferedImage.TYPE_4BYTE_ABGR);
   3:             Graphics g = img.getGraphics();
   4:             
   5:             folder.paintIcon(chooser,g,0,0);

View Full Code Here
   1:   public void dragGestureRecognized(DragGestureEvent dge) {
   2:     BufferedImage resizeCursorImage=new BufferedImage(64, 64, BufferedImage.TYPE_4BYTE_ABGR);
   3: 
   4:     Graphics g=resizeCursorImage.getGraphics();

View Full Code Here
   1:     } catch (Exception e) {
   2:       BufferedImage im = new BufferedImage(16,16,BufferedImage.TYPE_4BYTE_ABGR);
   3:       ImageIcon i = new ImageIcon(im);
   4:       return i;
   5:     }

View Full Code Here
   1:     BufferedImage image=
   2:       new BufferedImage(wu, hu, BufferedImage.TYPE_4BYTE_ABGR);
   3:     Graphics2D g2d= image.createGraphics();
   4:     g2d.setBackground(fond_);
   5:     g2d.clearRect(0, 0, wu, hu);

View Full Code Here
   1:             e.printStackTrace();
   2:             img = new BufferedImage(402, 385, BufferedImage.TYPE_4BYTE_ABGR);
   3:         }
   4:         resetValues();
   5:     }

View Full Code Here

TYPE_4BYTE_ABGR_PRE

public static final int TYPE_4BYTE_ABGR_PRE
Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha. The image has a ComponentColorModel with alpha. The color data in this image is considered to be premultiplied with alpha. The byte data is interleaved in a single byte array in the order A, B, G, R from lower to higher byte addresses within each pixel.
Field Value:
7
Usages and Demos :

View More Examples of BufferedImage.TYPE_4BYTE_ABGR_PRE
   1:     public PlanarImage executeDrawOperation() {
   2:         BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR_PRE);
   3: 
   4:         Graphics2D graphics = (Graphics2D) bi.getGraphics();

View Full Code Here
   1: 
   2:         BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR_PRE);
   3:         Graphics2D graphics = (Graphics2D) bi.getGraphics();
   4:         ...
   5: 
   6:         bi = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR_PRE);
   7:         graphics = (Graphics2D) bi.getGraphics();
   8: 
   9:         graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

View Full Code Here
   1:             + arcwidth + " arch=" + archeight);
   2:         BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR_PRE);
   3: 
   4:         Graphics2D graphics = (Graphics2D) bi.getGraphics();

View Full Code Here

TYPE_BYTE_BINARY

public static final int TYPE_BYTE_BINARY
Represents an opaque byte-packed 1, 2, or 4 bit image. The image has an IndexColorModel without alpha. When this type is used as the imageType argument to the BufferedImage constructor that takes an imageType argument but no ColorModel argument, a 1-bit image is created with an IndexColorModel with two colors in the default sRGB ColorSpace: {0, 0, 0} and {255, 255, 255}.

Images with 2 or 4 bits per pixel may be constructed via the BufferedImage constructor that takes a ColorModel argument by supplying a ColorModel with an appropriate map size.

Images with 8 bits per pixel should use the image types TYPE_BYTE_INDEXED or TYPE_BYTE_GRAY depending on their ColorModel.

When color data is stored in an image of this type, the closest color in the colormap is determined by the IndexColorModel and the resulting index is stored. Approximation and loss of alpha or color components can result, depending on the colors in the IndexColorModel colormap.

Field Value:
12
Usages and Demos :

View More Examples of BufferedImage.TYPE_BYTE_BINARY
   1:                 case 2 :
   2:                     type = BufferedImage.TYPE_BYTE_BINARY;
   3:                     break;
   4:                 default :
   5:                     type = BufferedImage.TYPE_INT_RGB;

View Full Code Here
   1:         
   2:         BufferedImage mask = new BufferedImage(img.getWidth(observer), img.getHeight(observer), BufferedImage.TYPE_BYTE_BINARY);
   3:         Graphics g = mask.getGraphics();
   4:         g.fillRect(sx1,sy1, (int)swidth, (int)sheight);
   5:         drawImage(img, mask, tx, null, observer);

View Full Code Here

TYPE_BYTE_GRAY

public static final int TYPE_BYTE_GRAY
Represents a unsigned byte grayscale image, non-indexed. This image has a ComponentColorModel with a CS_GRAY ColorSpace. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite documentation.
Field Value:
10
Usages and Demos :

View More Examples of BufferedImage.TYPE_BYTE_GRAY
   1:         jLabel1.setIcon(new ImageIcon(new BufferedImage(SIZEX, SIZEY,
   2:                 BufferedImage.TYPE_BYTE_GRAY)));
   3:         pack();
   4:     }

View Full Code Here
   1:  
   2:  BufferedImage bufImage = new BufferedImage(256,128,BufferedImage.TYPE_BYTE_GRAY);
   3:  Graphics gc = bufImage.getGraphics();
   4:  gc.setColor(Color.white); gc.fillRect(0,0,256,128); gc.setColor(Color.black);
   5:  for (int i = 0; i < 256; i++)

View Full Code Here
   1:         BufferedImage bi = new BufferedImage(devR.width, devR.height,
   2:                                              BufferedImage.TYPE_BYTE_GRAY);
   3: 
   4:         Shape devShape = usr2dev.createTransformedShape(getClipPath());
   5:         Rectangle devAOIR;

View Full Code Here
   1:                 case 1 :
   2:                     type = BufferedImage.TYPE_BYTE_GRAY;
   3:                     break;
   4:                 case 2 :
   5:                     type = BufferedImage.TYPE_BYTE_BINARY;

View Full Code Here
   1:          icon = new RemoteImageWrapper(
   2:                new BufferedImage(64, 64, BufferedImage.TYPE_BYTE_GRAY));
   3:       orbit = model.getOrbitBehavior();
   4:       orbit.addCallback(this, false);
   5:       setControl(orbit, null);

View Full Code Here

TYPE_BYTE_INDEXED

public static final int TYPE_BYTE_INDEXED
Represents an indexed byte image. When this type is used as the imageType argument to the BufferedImage constructor that takes an imageType argument but no ColorModel argument, an IndexColorModel is created with a 256-color 6/6/6 color cube palette with the rest of the colors from 216-255 populated by grayscale values in the default sRGB ColorSpace.

When color data is stored in an image of this type, the closest color in the colormap is determined by the IndexColorModel and the resulting index is stored. Approximation and loss of alpha or color components can result, depending on the colors in the IndexColorModel colormap.

Field Value:
13
Usages and Demos :

View More Examples of BufferedImage.TYPE_BYTE_INDEXED
   1:         if (shaded) {
   2:             if (type != BufferedImage.TYPE_BYTE_INDEXED) {
   3:                 System.out.println("Warning: image converted to " +
   4:         ...
   5:                     image.getWidth(), image.getHeight(),
   6:                     BufferedImage.TYPE_BYTE_INDEXED);
   7:                 Graphics2D g = newImage.createGraphics();
   8:                 g.drawImage(image, 0, 0, null);
   9:                 g.dispose();

View Full Code Here
   1:       case 8:
   2:     return new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED);
   3:       default:
   4:       case 32:
   5:     return new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);

View Full Code Here
   1:         final int SIZE = 64;
   2:         final BufferedImage  source = new BufferedImage(SIZE, SIZE, BufferedImage.TYPE_BYTE_INDEXED);
   3:         final DataBufferByte buffer = (DataBufferByte) source.getRaster().getDataBuffer();
   4:         final byte[] array = buffer.getData(0);
   5:         for (int i=0; i<array.length; i++) {

View Full Code Here
   1:         final int SIZE = 64;
   2:         final BufferedImage  source = new BufferedImage(SIZE, SIZE, BufferedImage.TYPE_BYTE_INDEXED);
   3:         final DataBufferByte buffer = (DataBufferByte) source.getRaster().getDataBuffer();
   4:         final byte[] array = buffer.getData(0);
   5:         for (int i=0; i<array.length; i++) {

View Full Code Here
   1:         }, Unit.get("?C"));
   2:         image  = new BufferedImage(120, 80, BufferedImage.TYPE_BYTE_INDEXED);
   3:         raster = image.getRaster();
   4:         for (int i=raster.getWidth(); --i>=0;) {
   5:             for (int j=raster.getHeight(); --j>=0;) {

View Full Code Here

TYPE_CUSTOM

public static final int TYPE_CUSTOM
Image type is not recognized so it must be a customized image. This type is only used as a return value for the getType() method.
Field Value:
0
Usages and Demos :

View More Examples of BufferedImage.TYPE_CUSTOM
   1:             case BufferedImage.TYPE_3BYTE_BGR:
   2:             case BufferedImage.TYPE_CUSTOM:
   3:             {
   4:                 byte[] data = ((DataBufferByte)img.getRaster().
   5:                     getDataBuffer()).getData();

View Full Code Here
   1:                 break;
   2:             case BufferedImage.TYPE_CUSTOM :
   3:                 throw new RuntimeException("Unsupported image type : CUSTOM");
   4:             default :
   5:                 throw new RuntimeException("Unsupported image type "+image.getType());

View Full Code Here

TYPE_INT_ARGB

public static final int TYPE_INT_ARGB
Represents an image with 8-bit RGBA color components packed into integer pixels. The image has a DirectColorModel with alpha. The color data in this image is considered not to be premultiplied with alpha. When this type is used as the imageType argument to a BufferedImage constructor, the created image is consistent with images created in the JDK1.1 and earlier releases.
Field Value:
2
Usages and Demos :

View More Examples of BufferedImage.TYPE_INT_ARGB
   1:     public static final Graphics2D DEFAULT_GRAPHICS = (Graphics2D)
   2:         new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).getGraphics();
   3: 
   4:     public void render(Graphics2D g, VisualItem item);

View Full Code Here
   1:     public static final Graphics2D DEFAULT_GRAPHICS = (Graphics2D)
   2:         new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).getGraphics();
   3: 
   4:     public void render(Graphics2D g, VisualItem item);

View Full Code Here
   1:   public BoundedTextLine(String text, double x, double y) {
   2:     super(new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB), x, y);
   3:     textLine = new TextLine(text);
   4:         ...
   5:     if(image.getWidth(null)!=(int) rect.getWidth()+1||image.getHeight(null)!=(int) rect.getHeight()+1+gutter) {
   6:       image = new BufferedImage((int) rect.getWidth()+1, (int) rect.getHeight()+1+gutter, BufferedImage.TYPE_INT_ARGB);
   7:       width = image.getWidth(null);
   8:       height = image.getHeight(null);
   9:       desent = -(int) rect.getY();

View Full Code Here
   1:         RenderedImage createImage( int row, int col ){
   2:             BufferedImage image = new BufferedImage( 90, 90, BufferedImage.TYPE_INT_ARGB );
   3:             Graphics2D g = (Graphics2D) image.getGraphics();
   4:         ...
   5:         RenderedImage createImage(){
   6:             BufferedImage image = new BufferedImage( 1, 1, BufferedImage.TYPE_INT_ARGB );
   7:             return image;
   8:         }
   9:         Envelope2D createRectangle( int row, int col ){

View Full Code Here
   1:         if (ri == null)
   2:             ri = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
   3: 
   4: 
   5:         CachableRed cr = GraphicsUtil.wrap(ri);

View Full Code Here

TYPE_INT_ARGB_PRE

public static final int TYPE_INT_ARGB_PRE
Represents an image with 8-bit RGBA color components packed into integer pixels. The image has a DirectColorModel with alpha. The color data in this image is considered to be premultiplied with alpha.
Field Value:
3
Usages and Demos :

View More Examples of BufferedImage.TYPE_INT_ARGB_PRE
   1:     public Image makeImage(Component comp, int width, int height) {
   2:         Image im = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB_PRE);
   3:         if (im == null)
   4:             im = super.makeImage(comp, width, height);
   5:         return im;

View Full Code Here
   1:     {
   2:       Image image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB_PRE);
   3:       BLANK_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(), "");
   4:       DIAL_IMAGE = new IconResource("artofillusion/Icons/dial.png");
   5:       KNOB_IMAGE = new IconResource("artofillusion/Icons/dialKnob.png");

View Full Code Here
   1:       BufferedImage result = new BufferedImage(pixelWidth, pixelHeight, 
   2:             BufferedImage.TYPE_INT_ARGB_PRE);
   3:       Graphics2D g2d = result.createGraphics();
   4:       g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
   5:             RenderingHints.VALUE_ANTIALIAS_ON);

View Full Code Here
   1:             BufferedImage dd;
   2:             image = new BufferedImage(ic.getIconWidth(),ic.getIconHeight(),BufferedImage.TYPE_INT_ARGB_PRE);
   3:             Graphics g = ((BufferedImage)image).createGraphics();
   4:             ic.paintIcon(this,g,0,0);
   5:             g.dispose();

View Full Code Here
   1:           BufferedImage image = new BufferedImage(imageWidth, imageHeight,
   2:                                                   BufferedImage.TYPE_INT_ARGB_PRE);
   3: 
   4:         ...
   5:             image = new BufferedImage(imageWidth, imageHeight,
   6:                                       BufferedImage.TYPE_INT_ARGB_PRE);
   7: 
   8:             filter.setResultImage(image);
   9:             filter.setRealBounds(imageSpaceBounds, userSpaceBounds);

View Full Code Here

TYPE_INT_BGR

public static final int TYPE_INT_BGR
Represents an image with 8-bit RGB color components, corresponding to a Windows- or Solaris- style BGR color model, with the colors Blue, Green, and Red packed into integer pixels. There is no alpha. The image has a DirectColorModel. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite documentation.
Field Value:
4
Usages and Demos :

View More Examples of BufferedImage.TYPE_INT_BGR
   1:         display = new BufferedImage(size.width, size.height, 
   2:                                     BufferedImage.TYPE_INT_BGR);
   3: 
   4:         Thread t = new RenderThread();
   5:         t.start();

View Full Code Here
   1:                 
   2:                 BufferedImage img = new BufferedImage(p.getWidth(),p.getHeight(),BufferedImage.TYPE_INT_BGR);
   3:                 Graphics2D g2 = img.createGraphics();
   4:                 g2.setColor(Color.white);
   5:                 g2.fillRect(0,0, p.getWidth(),p.getHeight());

View Full Code Here
   1:                 break;
   2:             case BufferedImage.TYPE_INT_BGR :
   3:                 nioType = NioImageBuffer.ImageType.TYPE_INT_BGR;
   4:         ...
   5:             case BufferedImage.TYPE_INT_ARGB :
   6:             case BufferedImage.TYPE_INT_BGR :
   7:             case BufferedImage.TYPE_INT_RGB :
   8:                 int[] intArr = ((DataBufferInt)image.getRaster().getDataBuffer()).getData();
   9:                 IntBuffer intBuf = ByteBuffer.allocateDirect(intArr.length * 4).order(order).asIntBuffer();

View Full Code Here

TYPE_INT_RGB

public static final int TYPE_INT_RGB
Represents an image with 8-bit RGB color components packed into integer pixels. The image has a DirectColorModel without alpha. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite documentation.
Field Value:
1
Usages and Demos :

View More Examples of BufferedImage.TYPE_INT_RGB
   1:    g2d.draw( new Rectangle2D.Double( 80, 30, 65, 100 ) );
   2:    BufferedImage buffImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB );
   3:    Graphics2D gg = buffImage.createGraphics();
   4:    g2d.setPaint( new TexturePaint(buffImage, new Rectangle( 10, 10 ) ) );
   5:    g2d.fill( new RoundRectangle2D.Double(155, 30, 75, 100, 50, 50 ) );   

View Full Code Here
   1:         final Paint p1 = new TexturePaint(
   2:             new BufferedImage(100, 200, BufferedImage.TYPE_INT_RGB), new Rectangle2D.Double()
   3:         );
   4:         ...
   5:         final Paint p2 = new TexturePaint(
   6:             new BufferedImage(100, 200, BufferedImage.TYPE_INT_RGB), new Rectangle2D.Double()
   7:         );
   8:         assertEquals(p1, p2);
   9:     }

View Full Code Here
   1: {
   2:     protected transient Graphics fontGraphics = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB).getGraphics();
   3: 
   4:     public TriangleRenderer renderer = new TriangleRenderer();

View Full Code Here
   1: {
   2:     protected transient Graphics fontGraphics = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB).getGraphics();
   3: 
   4:     public TriangleRenderer renderer = new TriangleRenderer();

View Full Code Here
   1:         
   2:         BufferedImage scaledImage = new BufferedImage((int)scaledX, (int)scaledY, BufferedImage.TYPE_INT_RGB);
   3:         Graphics2D scaledG = scaledImage.createGraphics();
   4:         ...
   5:         }
   6:         BufferedImage buf = new BufferedImage(scaledX, scaledY, BufferedImage.TYPE_INT_RGB);
   7:         WaitingImageObserver obs = new WaitingImageObserver(buf);
   8:         transform(sourceImg, buf, scaledX, scaledY, rotation, obs);
   9:         obs.waitImageLoaded();

View Full Code Here

TYPE_USHORT_555_RGB

public static final int TYPE_USHORT_555_RGB
Represents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha. This image has a DirectColorModel. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite documentation.
Field Value:
9
Usages and Demos :

View More Examples of BufferedImage.TYPE_USHORT_555_RGB
   1: 
   2:         BufferedImage image = new BufferedImage( width, height, BufferedImage.TYPE_USHORT_555_RGB );
   3:         Graphics2D g = image.createGraphics();
   4:         g.setColor(Color.white);
   5:         g.fillRect(0, 0, width, height);

View Full Code Here
   1: 
   2:         BufferedImage image = new BufferedImage( width, height, BufferedImage.TYPE_USHORT_555_RGB );
   3:         Graphics2D g = image.createGraphics();
   4:         g.setColor(Color.white);
   5:         g.fillRect(0, 0, width, height);

View Full Code Here

TYPE_USHORT_565_RGB

public static final int TYPE_USHORT_565_RGB
Represents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha. This image has a DirectColorModel. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite documentation.
Field Value:
8
Usages and Demos :

View More Examples of BufferedImage.TYPE_USHORT_565_RGB
   1:         else {
   2:             if (type != BufferedImage.TYPE_USHORT_565_RGB) {
   3:                 BufferedImage newImage = new BufferedImage(
   4:         ...
   5:                     image.getWidth(), image.getHeight(),
   6:                     BufferedImage.TYPE_USHORT_565_RGB);
   7:                 Graphics2D g = newImage.createGraphics();
   8:                 g.drawImage(image, 0, 0, null);
   9:                 g.dispose();

View Full Code Here
   1:     return new BufferedImage(width, height, 
   2:                  BufferedImage.TYPE_USHORT_565_RGB);
   3:       case 8:
   4:     return new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED);
   5:       default:

View Full Code Here
   1:                 viewWindow.getWidth(), viewWindow.getHeight(),
   2:                 BufferedImage.TYPE_USHORT_565_RGB);
   3: 
   4:             DataBuffer dest =
   5:                 doubleBuffer.getRaster().getDataBuffer();

View Full Code Here
   1:                     backingImage = new BufferedImage(w, h,     
   2:                         BufferedImage.TYPE_USHORT_565_RGB);
   3:                     backingGraphics = new AShortBufferedPixelGraphics2D(
   4:                         backingImage);
   5:                 }

View Full Code Here

TYPE_USHORT_GRAY

public static final int TYPE_USHORT_GRAY
Represents an unsigned short grayscale image, non-indexed). This image has a ComponentColorModel with a CS_GRAY ColorSpace. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in the AlphaComposite documentation.
Field Value:
11
Usages and Demos :

View More Examples of BufferedImage.TYPE_USHORT_GRAY
   1:         Dimension size = component.getSize();
   2:         BufferedImage image = new BufferedImage(size.width, size.height, BufferedImage.TYPE_USHORT_GRAY);
   3:         Graphics2D grp = image.createGraphics();
   4:         component.paint(grp);

View Full Code Here
   1:     if( cs == grayCS || bi.getType() == BufferedImage.TYPE_BYTE_GRAY 
   2:         || bi.getType() == BufferedImage.TYPE_USHORT_GRAY )
   3:       colorType = c.hasAlpha() ? PNGHeader.GRAYSCALE_WITH_ALPHA : 
   4:         PNGHeader.GRAYSCALE;
   5:     else

View Full Code Here
   1:                 BufferedImage qChromaBBufferedImage = new BufferedImage(
   2:                         width * 2 + 5, height, BufferedImage.TYPE_USHORT_GRAY);
   3:                 Graphics2D qChromaBGraphics2 = (Graphics2D) qChromaBBufferedImage
   4:                         .getGraphics();
   5:                 qChromaBGraphics2.drawImage(beforeQChromaB, 0, 0, null);

View Full Code Here
   1:         boolean writeAsMono = ((dataType == BufferedImage.TYPE_BYTE_GRAY
   2:                                 || dataType == BufferedImage.TYPE_USHORT_GRAY)
   3:                                && !dcmParam.isWriteAlwaysRGB());
   4:         
   5:         if (writeAsMono) {

View Full Code Here
   1:        int dataType = bi.getType();
   2:        boolean writeAsMono = (dataType == BufferedImage.TYPE_BYTE_GRAY || dataType == BufferedImage.TYPE_USHORT_GRAY);
   3: 
   4:        if (writeAsMono) {
   5:            putBufferedImageAsMonochrome(bi, sourceRegion, true);

View Full Code Here

Constructor Details

BufferedImage

public BufferedImage(int width,
                     int height,
                     int imageType)
Constructs a BufferedImage of one of the predefined image types. The ColorSpace for the image is the default sRGB space.
Parameters:
width - width of the created image
height - height of the created image
imageType - type of the created image
Usages and Demos :

View More Examples of BufferedImage(int width,int height,int imageType)
   1:   {
   2:     testEngine.addMTGO(new MTGO(new BufferedImage(1, 1, 1), "test1", false), frame);
   3:         ...
   4:     testEngine.addMTGO(new MTGO(new BufferedImage(1, 1, 1), "test2", false), frame);
   5:         ...
   6:     testEngine.addMTGO(new MTGO(new BufferedImage(1, 1, 1), "test3", false), frame);
   7:     testEngine.addMTGO(new MTGO(new BufferedImage(1, 1, 1), "test4", false), frame);

View Full Code Here
   1:         java.awt.GraphicsEnvironment ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
   2:         Graphics x = ge.createGraphics(new BufferedImage(1,1,1));
   3:         fp.paintComponent(x);
   4:     }

View Full Code Here
   1:         java.awt.GraphicsEnvironment ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
   2:         Graphics2D x = ge.createGraphics(new BufferedImage(1,1,1));
   3:         test.paintBorder(null,x,1,1,1,1);
   4:         
   5:     }

View Full Code Here
   1:         this.currentImage =
   2:             new BufferedImage(1, 1, BufferedImage.TYPE_3BYTE_BGR);
   3:         this.label = new JLabel(new ImageIcon(currentImage));
   4:         imagePanel.add(label, BorderLayout.CENTER);

View Full Code Here
   1:         this.escherGraphics = escherGraphics;
   2:         setImg( new BufferedImage(1, 1, 2) );
   3:         setColor(Color.black);
   4:     }

View Full Code Here

BufferedImage

public BufferedImage(int width,
                     int height,
                     int imageType,
                     IndexColorModel cm)
Constructs a BufferedImage of one of the predefined image types: TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED.

If the image type is TYPE_BYTE_BINARY, the number of entries in the color model is used to determine whether the image should have 1, 2, or 4 bits per pixel. If the color model has 1 or 2 entries, the image will have 1 bit per pixel. If it has 3 or 4 entries, the image with have 2 bits per pixel. If it has between 5 and 16 entries, the image will have 4 bits per pixel. Otherwise, an IllegalArgumentException will be thrown.

Parameters:
width - width of the created image
height - height of the created image
imageType - type of the created image
cm - IndexColorModel of the created image
Throws:
IllegalArgumentException - if the imageType is not TYPE_BYTE_BINARY or TYPE_BYTE_INDEXED or if the imageType is TYPE_BYTE_BINARY and the color map has more than 16 entries.
Usages and Demos :

View More Examples of BufferedImage(int width,int height,int imageType,IndexColorModel cm)
   1:         new byte[] { (byte)0, (byte)255 });
   2:     image = new BufferedImage(cm, wr, false, null);
   3:     random = new Random();
   4:   }

View Full Code Here
   1:           ri.copyData(ras);
   2:           BufferedImage bi = new BufferedImage(cm, ras, false, null);
   3:           ImageIcon tn = new ImageIcon(bi);
   4:           if (tn != null) {
   5:             if (tn.getIconWidth() > 90) {

View Full Code Here
   1:             cm.createCompatibleWritableRaster(thumbWidth, thumbHeight);
   2:         BufferedImage thumbImage = new BufferedImage(cm, r, false, null);
   3:         
   4:         Graphics2D graphics2D = thumbImage.createGraphics();
   5:         graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);

View Full Code Here
   1:     
   2:     return new BufferedImage(cm, raster, false, null);
   3:     }
   4: 
   5: }

View Full Code Here
   1:     WritableRaster raster = Raster.createWritableRaster(sm, db, null);
   2:     return new BufferedImage(cm, raster, false, null);
   3:     }
   4: 
   5: }

View Full Code Here

BufferedImage

public BufferedImage(ColorModel cm,
                     WritableRaster raster,
                     boolean isRasterPremultiplied,
                     Hashtable properties)
Constructs a new BufferedImage with a specified ColorModel and Raster. If the number and types of bands in the SampleModel of the Raster do not match the number and types required by the ColorModel to represent its color and alpha components, a RasterFormatException is thrown. This method can multiply or divide the color Raster data by alpha to match the alphaPremultiplied state in the ColorModel. Properties for this BufferedImage can be established by passing in a Hashtable of String/Object pairs.
Parameters:
cm - ColorModel for the new image
raster - Raster for the image data
isRasterPremultiplied - if true, the data in the raster has been premultiplied with alpha.
properties - Hashtable of String/Object pairs.

Method Details

addTileObserver

public void addTileObserver(TileObserver to)
Adds a tile observer. If the observer is already present, it receives multiple notifications.
Specified by:
addTileObserver in interface WritableRenderedImage
Parameters:
to - the specified TileObserver

coerceData

public void coerceData(boolean isAlphaPremultiplied)
Forces the data to match the state specified in the isAlphaPremultiplied variable. It may multiply or divide the color raster data by alpha, or do nothing if the data is in the correct state.
Parameters:
isAlphaPremultiplied - true if the alpha has been premultiplied; false otherwise.

copyData

public WritableRaster copyData(WritableRaster outRaster)
Computes an arbitrary rectangular region of the BufferedImage and copies it into a specified WritableRaster. The region to be computed is determined from the bounds of the specified WritableRaster. The specified WritableRaster must have a SampleModel that is compatible with this image. If outRaster is null, an appropriate WritableRaster is created.
Specified by:
copyData in interface RenderedImage
Parameters:
outRaster - a WritableRaster to hold the returned part of the image, or null
Returns:
a reference to the supplied or created WritableRaster.
Usages and Demos :

View More Examples of copyData(WritableRaster outRaster)
   1: 
   2:     public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) {
   3:         ...
   4:         BufferedImage img1 = op.filter(img, null);
   5:         drawImage(img1, new AffineTransform(1f, 0f, 0f, 1f, x, y), null);
   6:         ...
   7:         ColorModel cm = img.getColorModel();
   8:         WritableRaster wr = img.copyData(null);
   9:         ...
  10:         BufferedImage img1 = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), properties);

View Full Code Here
   1: 
   2:     public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) {
   3:         ...
   4:         BufferedImage img1 = op.filter(img, null);
   5:         drawImage(img1, new AffineTransform(1f, 0f, 0f, 1f, x, y), null);
   6:         ...
   7:         ColorModel cm = img.getColorModel();
   8:         WritableRaster wr = img.copyData(null);
   9:         ...
  10:         BufferedImage img1 = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), properties);

View Full Code Here
   1: import java.awt.geom.RoundRectangle2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.BufferedImageOp;
   4:         ...
   5:     
   6:     public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) {
   7:         ...
   8:         BufferedImage result = img;
   9:         if (op != null) {
  10:         ...
  11:             BufferedImage result = new BufferedImage(cm, raster, isAlphaPremultiplied, properties);
  12:             img.copyData(raster);

View Full Code Here

createGraphics

public Graphics2D createGraphics()
Creates a Graphics2D, which can be used to draw into this BufferedImage.
Returns:
a Graphics2D, used for drawing into this image.
Usages and Demos :

View More Examples of createGraphics()
   1: 
   2:   public BufferedImage getBufferedImage() {
   3:         ...
   4:     BufferedImage bimg = new BufferedImage(image.getWidth(null),
   5:                                            image.getHeight(null),
   6:         ...
   7:                                            BufferedImage.TYPE_INT_RGB);
   8:     bimg.createGraphics().drawImage(image, 0, 0, null);
   9:     return bimg;

View Full Code Here
   1: import java.awt.Image;
   2: import java.awt.image.BufferedImage;
   3: import java.io.File;
   4:         ...
   5:             int h = image.getHeight(null);
   6:             BufferedImage bimg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
   7:         ...
   8:             bimg.createGraphics().drawImage(image, 0, 0, null);
   9:             JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(outputStream);

View Full Code Here
   1: 
   2:     BufferedImage offscreen =
   3:         ...
   4:         new BufferedImage(COVERWIDTH, COVERHEIGHT,
   5:         ...
   6:                   BufferedImage.TYPE_INT_ARGB);
   7:     
   8:         ...
   9:     Graphics2D osg = offscreen.createGraphics();

View Full Code Here
   1: 
   2:     BufferedImage offscreen =
   3:         ...
   4:         new BufferedImage(COVERWIDTH, COVERHEIGHT,
   5:         ...
   6:                   BufferedImage.TYPE_INT_ARGB);
   7:     
   8:         ...
   9:     Graphics2D osg = offscreen.createGraphics();

View Full Code Here
   1: import java.awt.geom.RoundRectangle2D;
   2: import java.awt.image.BufferedImage;
   3: 
   4:         ...
   5: 
   6:     private BufferedImage curImage;
   7: 
   8:         ...
   9:     private BufferedImage  backupImage;
  10:     
  11:         ...
  12:     dragged = true;
  13:     curImage.createGraphics().drawImage(backupImage,null,0,0);

View Full Code Here

flush

public void flush()
Flushes all resources being used to cache optimization information. The underlying pixel data is unaffected.
Overrides:
flush in interface Image
Usages and Demos :

View More Examples of flush()
   1: 
   2:     BufferedImage r=KorteLib.createTransparentImage(_w,_h);
   3: 
   4:         ...
   5:     g.dispose();
   6:     r.flush();
   7:     return r;
   8:   }
   9: }

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.image.BufferedImage;
   3: import java.io.File;
   4:         ...
   5:         int height = source.getHeight();
   6:         BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
   7:         Graphics2D g2d = image.createGraphics();
   8:         ...
   9:         ImageIO.write(image, "jpeg", target);
  10:         image.flush();
  11:     }

View Full Code Here
   1:     int x, y;
   2:     BufferedImage theImage;
   3: 
   4:         ...
   5:     System.out.println("x:"+x+" y:"+y);
   6:     theImage.flush();
   7:     }
   8: 
   9:     public void dragAction(MouseEvent mevt, main_canvas theCanvas) {

View Full Code Here
   1:     int x, y;
   2:     BufferedImage theImage;
   3: 
   4:         ...
   5:     System.out.println("x:"+x+" y:"+y);
   6:     theImage.flush();
   7:     }
   8: 
   9:     public void dragAction(MouseEvent mevt, main_canvas theCanvas) {

View Full Code Here
   1: 
   2:     BufferedImage bim;
   3: 
   4:         ...
   5: 
   6:     public Fill(BufferedImage in, int x1, int y1, int filler) {
   7:         fill = filler;
   8:         ...
   9:         bim.setRGB(x1, y1, fill);
  10:         bim.flush();
  11:         ...
  12:         in.flush();

View Full Code Here

getAlphaRaster

public WritableRaster getAlphaRaster()
Returns a WritableRaster representing the alpha channel for BufferedImage objects with ColorModel objects that support a separate spatial alpha channel, such as ComponentColorModel and DirectColorModel. Returns null if there is no alpha channel associated with the ColorModel in this image. This method assumes that for all ColorModel objects other than IndexColorModel, if the ColorModel supports alpha, there is a separate alpha channel which is stored as the last band of image data. If the image uses an IndexColorModel that has alpha in the lookup table, this method returns null since there is no spatially discrete alpha channel. This method creates a new WritableRaster, but shares the data array.
Returns:
a WritableRaster or null if this BufferedImage has no alpha channel associated with its ColorModel.
Usages and Demos :

View More Examples of getAlphaRaster()
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.DataBuffer;
   4:         ...
   5:             
   6:             BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
   7:             Graphics2D g2 = img.createGraphics();
   8:         ...
   9:             
  10:             DataBuffer src = img.getAlphaRaster().getDataBuffer();
  11:             
  12:         ...
  13:             BufferedImage progress = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
  14:             DataBuffer dst = progress.getAlphaRaster().getDataBuffer();

View Full Code Here

getCapabilities

public ImageCapabilities getCapabilities(GraphicsConfiguration gc)
This overrides Image.getCapabilities(gc) to get the capabilities of its surfaceManager. This means that BufferedImage objects that are accelerated may return a caps object that will indicate this acceleration.
Overrides:
getCapabilities in interface Image

getColorModel

public ColorModel getColorModel()
Returns the ColorModel.
Specified by:
getColorModel in interface RenderedImage
Returns:
the ColorModel of this BufferedImage.
Usages and Demos :

View More Examples of getColorModel()
   1: 
   2:     public BufferedImage filter( BufferedImage src, BufferedImage dst ) {
   3:         int width = src.getWidth();
   4:         ...
   5:         if ( dst == null ) {
   6:             ColorModel dstCM = src.getColorModel();
   7:             dst = new BufferedImage(dstCM, dstCM.createCompatibleWritableRaster(transformedSpace.width, transformedSpace.height), dstCM.isAlphaPremultiplied(), null);
   8:         }
   9:         WritableRaster dstRaster = dst.getRaster();

View Full Code Here
   1:       setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
   2:       BufferedImage image = makeMandelbrot(DEFAULT_WIDTH, DEFAULT_HEIGHT);
   3:       add(new JLabel(new ImageIcon(image)), BorderLayout.CENTER);
   4:         ...
   5: 
   6:    public BufferedImage makeMandelbrot(int width, int height)
   7:    {  
   8:         ...
   9:       BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
  10:       WritableRaster raster = image.getRaster();
  11:         ...
  12:       ColorModel model = image.getColorModel();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.BufferedImageOp;
   4:         ...
   5: class NullOp implements BufferedImageOp {
   6:     public BufferedImage filter(BufferedImage src, BufferedImage dest){
   7:         java.awt.Graphics2D g = dest.createGraphics();
   8:         ...
   9:         if(destCM==null)
  10:             destCM = src.getColorModel();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.BufferedImageOp;
   4:         ...
   5:     
   6:     public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM) {
   7:         if ( dstCM == null )
   8:         ...
   9:             dstCM = src.getColorModel();
  10:         return new BufferedImage(dstCM, dstCM.createCompatibleWritableRaster(src.getWidth(), src.getHeight()), dstCM.isAlphaPremultiplied(), null);

View Full Code Here
   1: 
   2:     public BitmapBuilder createBuilder(BufferedImage bufferedImage)
   3:     {
   4:         ...
   5:         ColorModel colorModel = bufferedImage.getColorModel();
   6: 
   7:         ...
   8:         {
   9:             return createBuilderByIndexModel(bufferedImage);
  10:         }
  11:         ...
  12:     {
  13:         if (!(bufferedImage.getColorModel() instanceof IndexColorModel))

View Full Code Here

getData

public Raster getData()
Returns the image as one large tile. The Raster returned is a copy of the image data is not updated if the image is changed.
Specified by:
getData in interface RenderedImage
Returns:
a Raster that is a copy of the image data.
Usages and Demos :

View More Examples of getData()
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5: public class BufferedImageCachableRed extends AbstractRed {
   6:     BufferedImage bi;
   7: 
   8:         ...
   9:     public BufferedImageCachableRed(BufferedImage bi) {
  10:         super((CachableRed)null, 
  11:         ...
  12:     public Raster getData() {
  13:         Raster r = bi.getData();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ColorModel;
   4:         ...
   5: 
   6:   private BufferedImage image;
   7: 
   8:         ...
   9:         Rectangle2D anchor = t.getAnchorRect();
  10:         BufferedImage image = t.getImage();
  11:         double scaleX = anchor.getWidth() / image.getWidth();
  12:         ...
  13:     float[] dest = new float[2];
  14:     Raster source = image.getData();

View Full Code Here
   1:         final int SIZE = 64;
   2:         final BufferedImage  source = new BufferedImage(SIZE, SIZE, BufferedImage.TYPE_BYTE_INDEXED);
   3:         final DataBufferByte buffer = (DataBufferByte) source.getRaster().getDataBuffer();
   4:         ...
   5:         }
   6:         double[] sourceData = source.getData().getSamples(0, 0, SIZE, SIZE, 0, (double[])null);
   7:         ...
   8:         double[] targetData = target.getData().getSamples(0, 0, SIZE, SIZE, 0, (double[])null);
   9:         band.getSampleToGeophysics().transform(sourceData, 0, sourceData, 0, sourceData.length);
  10:         ...
  11:         assertEquals(DataBuffer.TYPE_BYTE, back.getSampleModel().getDataType());
  12:         sourceData = source.getData().getSamples(0, 0, SIZE, SIZE, 0, (double[])null);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.DataBuffer;
   4:         ...
   5:         final int SIZE = 64;
   6:         final BufferedImage  source = new BufferedImage(SIZE, SIZE, BufferedImage.TYPE_BYTE_INDEXED);
   7:         final DataBufferByte buffer = (DataBufferByte) source.getRaster().getDataBuffer();
   8:         ...
   9:         }
  10:         double[] sourceData = source.getData().getSamples(0, 0, SIZE, SIZE, 0, (double[])null);
  11:         ...
  12:         double[] targetData = target.getData().getSamples(0, 0, SIZE, SIZE, 0, (double[])null);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5: 
   6:     public void setData(BufferedImage image) {
   7:         ...
   8:         setData(image.getData());
   9:     }

View Full Code Here

getData

public Raster getData(Rectangle rect)
Computes and returns an arbitrary region of the BufferedImage. The Raster returned is a copy of the image data and is not updated if the image is changed.
Specified by:
getData in interface RenderedImage
Parameters:
rect - the region of the BufferedImage to be returned.
Returns:
a Raster that is a copy of the image data of the specified region of the BufferedImage
Usages and Demos :

View More Examples of getData(Rectangle rect)
   1:         (image.getHeight() < h)) {
   2:         image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
   3:         imageGraphics = image.createGraphics();
   4:         ...
   5:         rect.x = 0; rect.y = 0; rect.width = w; rect.height = h;
   6:         return image.getData(rect);
   7:     }

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5: public class BufferedImageCachableRed extends AbstractRed {
   6:     BufferedImage bi;
   7: 
   8:         ...
   9:     public BufferedImageCachableRed(BufferedImage bi) {
  10:         super((CachableRed)null, 
  11:         ...
  12: 
  13:         Raster ret = bi.getData(r);

View Full Code Here

getGraphics

public Graphics getGraphics()
This method returns a Graphics2D, but is here for backwards compatibility. createGraphics is more convenient, since it is declared to return a Graphics2D.
Overrides:
getGraphics in interface Image
Returns:
a Graphics2D, which can be used to draw into this image.
Usages and Demos :

View More Examples of getGraphics()
   1: import java.awt.Toolkit;
   2: import java.awt.image.BufferedImage;
   3: import java.io.File;
   4:         ...
   5: 
   6:             BufferedImage bimg = new BufferedImage(actualWidth, actualHeight,
   7:                     BufferedImage.TYPE_INT_RGB);
   8:         ...
   9:             bimg.getGraphics().drawImage(img, 0, 0, actualWidth, actualHeight,
  10:                     null);

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5:     {
   6:         BufferedImage bi = new BufferedImage(img.getWidth(this), img.getHeight(this), BufferedImage.TYPE_INT_ARGB);
   7:         ...
   8:         bi.getGraphics().drawImage(img, 0, 0, this);

View Full Code Here
   1: import java.awt.Insets;
   2: import java.awt.image.BufferedImage;
   3: import javax.swing.ImageIcon;
   4:         ...
   5:         for(int i=0; i<squares.length; i++) {            
   6:             BufferedImage image = 
   7:         ...
   8:                     new BufferedImage(
   9:                         renderer.getSize(), renderer.getSize(), 
  10:         ...
  11:                             BufferedImage.TYPE_INT_RGB);
  12:             image.getGraphics().setColor(java.awt.Color.DARK_GRAY);

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.image.BufferedImage;
   3: import java.io.*;
   4:         ...
   5: 
   6:                 BufferedImage relief = m_localGraphicSystem.createCompatibleImage(TileManager.TILE_SIZE, TileManager.TILE_SIZE,
   7:                         m_baseMap ? Transparency.BITMASK : Transparency.TRANSLUCENT);
   8:         ...
   9:                 relief.getGraphics().drawImage(map, 0, 0, TileManager.TILE_SIZE, TileManager.TILE_SIZE, bounds.x, bounds.y,
  10:                         bounds.x + TileManager.TILE_SIZE, bounds.y + TileManager.TILE_SIZE, observer);

View Full Code Here
   1: import java.awt.image.*;
   2: import java.awt.image.BufferedImage.*;
   3: import java.awt.event.*;
   4:         ...
   5:     int y_s = i/img_row;
   6:     BufferedImage work = new BufferedImage(16,16,BufferedImage.TYPE_INT_RGB);
   7:         ...
   8:         work.getGraphics().drawImage(palette.getImage(),
   9:                     0,0,16,16,

View Full Code Here

getHeight

public int getHeight()
Returns the height of the BufferedImage.
Specified by:
getHeight in interface RenderedImage
Returns:
the height of this BufferedImage
Usages and Demos :

View More Examples of getHeight()
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.BufferedImageOp;
   4:         ...
   5: class NullOp implements BufferedImageOp {
   6:     public BufferedImage filter(BufferedImage src, BufferedImage dest){
   7:         java.awt.Graphics2D g = dest.createGraphics();
   8:         ...
   9:     public Rectangle2D getBounds2D(BufferedImage src){
  10:         return new Rectangle(0, 0, src.getWidth(), src.getHeight());
  11:     }
  12:         ...
  13: 
  14:         dest = new BufferedImage(destCM, destCM.createCompatibleWritableRaster(src.getWidth(), src.getHeight()),

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.DirectColorModel;
   4:         ...
   5: 
   6:     public static void encode(String format, BufferedImage image,
   7:         OutputStream outStream) throws IOException {
   8:         ...
   9:             
  10:             BufferedImage curImage = new BufferedImage(image.getWidth(), image.getHeight(),BufferedImage.TYPE_3BYTE_BGR);
  11:             Graphics2D g = (Graphics2D) curImage.createGraphics();

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.BufferedImageOp;
   4:         ...
   5: 
   6:    public BufferedImage getSliceImage(int slice, Point3f p)
   7:    {
   8:         ...
   9: 
  10:    public BufferedImage getSliceImage(int slice, Point3f p,
  11:                                       float brightness)
  12:         ...
  13:                (Vector3f) tuples[2], img.getWidth(),
  14:                img.getHeight(), true, 0,

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.FilteredImageSource;
   4:         ...
   5: 
   6:     BufferedImage img = new BufferedImage(iFrame.getWidth(), iFrame.getHeight(), BufferedImage.TYPE_INT_ARGB);
   7: 
   8:         ...
   9: 
  10:     BufferedImage img2 = new BufferedImage(img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_ARGB);
  11:     img2.getGraphics().drawImage(Toolkit.getDefaultToolkit().createImage(source), 0, 0, null);
  12:         ...
  13:         int xPos = c.getWidth() - width - (fadeColors.length - i) - RIGHT_INSET;
  14:         g.drawLine(xPos, BUTTON_OFFSET, xPos, c.getHeight() - 2 * BUTTON_OFFSET);

View Full Code Here
   1:     public void okActionPerformed(java.awt.event.ActionEvent evt) {
   2:     BufferedImage im = ((TerpPaint)this.getParent()).center.getBufferedImage();
   3:     Graphics2D g2d = im.createGraphics();
   4:         ...
   5: 
   6:         if (im.getWidth()* (x/100)*im.getHeight()* (y/100)>=3000000)
   7:         ok_action = false;
   8:         ...
   9:         {
  10:         BufferedImage temp = new BufferedImage((int)(im.getWidth()* (x/100)), (int)(im.getHeight()*(y/100)), BufferedImage.TYPE_INT_RGB);
  11:         Graphics2D gd = temp.createGraphics();

View Full Code Here

getHeight

public int getHeight(ImageObserver observer)
Returns the height of the BufferedImage.
Overrides:
getHeight in interface Image
Parameters:
observer - ignored
Returns:
the height of this BufferedImage
Usages and Demos :

View More Examples of getHeight(ImageObserver observer)
   1: public class WatermarkTextField extends JTextField {
   2:     BufferedImage img;
   3:     TexturePaint texture;
   4:         ...
   5:         Rectangle rect = new Rectangle(0,0,
   6:                 img.getWidth(null),img.getHeight(null));
   7:         texture = new TexturePaint(img, rect);
   8:         setOpaque(false);
   9:     }

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.nio.channels.ServerSocketChannel;
   4:         ...
   5: 
   6:    public synchronized int registerAddress(BufferedImage img, Observer obs)
   7:    {
   8:         ...
   9:       ImageSet set = images.remove(ID);
  10:       BufferedImage img = set.img;
  11:       Object result;
  12:         ...
  13:          {
  14:             result = getUncompressed(img, img.getWidth(null), img.getHeight(null));

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: 
   4:         ...
   5:     {
   6:         BufferedImage i = generateImage(10, Globals.curEditor());
   7:         System.out.print(i.getWidth(null));
   8:         ...
   9:         System.out.print(", ");
  10:         System.out.println(i.getHeight(null));

View Full Code Here
   1: import java.awt.Image;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ImageObserver;
   4:         ...
   5: {
   6:    transient BufferedImage backing;
   7:    transient List<Pending> pending;
   8:         ...
   9: 
  10:    public RemoteImage(BufferedImage backing)
  11:    {
  12:         ...
  13:             case ImageObserver.HEIGHT:
  14:                int height = backing.getHeight(observer);

View Full Code Here
   1: import java.awt.Image;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ImageObserver;
   4:         ...
   5: 
   6:     final BufferedImage img = new BufferedImage(
   7:         1, 1, BufferedImage.TYPE_INT_RGB
   8:         ...
   9:       if (g.drawImage(this.image, 0, 0, img.getWidth(this), 
  10:             img.getHeight(this), this)) {
  11:         return;

View Full Code Here

getMinTileX

public int getMinTileX()
Returns the minimum tile index in the x direction. This is always zero.
Specified by:
getMinTileX in interface RenderedImage
Returns:
the minimum tile index in the x direction.

getMinTileY

public int getMinTileY()
Returns the minimum tile index in the y direction. This is always zero.
Specified by:
getMinTileY in interface RenderedImage
Returns:
the mininum tile index in the y direction.

getMinX

public int getMinX()
Returns the minimum x coordinate of this BufferedImage. This is always zero.
Specified by:
getMinX in interface RenderedImage
Returns:
the minimum x coordinate of this BufferedImage.
Usages and Demos :

View More Examples of getMinX()
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5: public class BufferedImageCachableRed extends AbstractRed {
   6:     BufferedImage bi;
   7: 
   8:         ...
   9:     public BufferedImageCachableRed(BufferedImage bi) {
  10:         super((CachableRed)null, 
  11:         ...
  12:               new Rectangle(bi.getMinX(),  bi.getMinY(),

View Full Code Here
   1: 
   2:     public BufferedImage im;
   3: 
   4:         ...
   5: 
   6:         double x1 = im.getMinX();
   7: 
   8: 
   9:         double y1 = im.getMinY();

View Full Code Here
   1: 
   2:     public BufferedImage im;
   3: 
   4:         ...
   5: 
   6:         double x1 = im.getMinX();
   7: 
   8: 
   9:         double y1 = im.getMinY();

View Full Code Here
   1: import java.awt.Toolkit;
   2: import java.awt.image.BufferedImage;
   3: import java.util.LinkedList;
   4:         ...
   5: 
   6:     public BufferedImage im;
   7: 
   8:         ...
   9: 
  10:         double x1 = im.getMinX();
  11: 
  12:         ...
  13:             ok_action = true;
  14:             BufferedImage im = ((TerpPaint) this.getParent()).center

View Full Code Here
   1: import java.awt.Toolkit;
   2: import java.awt.image.BufferedImage;
   3: import java.util.LinkedList;
   4:         ...
   5: 
   6:     public BufferedImage im;
   7: 
   8:         ...
   9: 
  10:         double x1 = im.getMinX();
  11: 
  12:         ...
  13:             ok_action = true;
  14:             BufferedImage im = ((TerpPaint) this.getParent()).center

View Full Code Here

getMinY

public int getMinY()
Returns the minimum y coordinate of this BufferedImage. This is always zero.
Specified by:
getMinY in interface RenderedImage
Returns:
the minimum y coordinate of this BufferedImage.
Usages and Demos :

View More Examples of getMinY()
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5: public class BufferedImageCachableRed extends AbstractRed {
   6:     BufferedImage bi;
   7: 
   8:         ...
   9:     public BufferedImageCachableRed(BufferedImage bi) {
  10:         super((CachableRed)null, 
  11:         ...
  12:               new Rectangle(bi.getMinX(),  bi.getMinY(),

View Full Code Here
   1: 
   2:     public BufferedImage im;
   3: 
   4:         ...
   5: 
   6:         double y1 = im.getMinY();
   7: 
   8:         if (lastSelected == 1) {

View Full Code Here
   1: 
   2:     public BufferedImage im;
   3: 
   4:         ...
   5: 
   6:         double y1 = im.getMinY();
   7: 
   8:         if (lastSelected == 1) {

View Full Code Here
   1: import java.awt.Toolkit;
   2: import java.awt.image.BufferedImage;
   3: import java.util.LinkedList;
   4:         ...
   5: 
   6:     public BufferedImage im;
   7: 
   8:         ...
   9: 
  10:         double y1 = im.getMinY();
  11: 
  12:         ...
  13:             ok_action = true;
  14:             BufferedImage im = ((TerpPaint) this.getParent()).center

View Full Code Here
   1: import java.awt.Toolkit;
   2: import java.awt.image.BufferedImage;
   3: import java.util.LinkedList;
   4:         ...
   5: 
   6:     public BufferedImage im;
   7: 
   8:         ...
   9: 
  10:         double y1 = im.getMinY();
  11: 
  12:         ...
  13:             ok_action = true;
  14:             BufferedImage im = ((TerpPaint) this.getParent()).center

View Full Code Here

getNumXTiles

public int getNumXTiles()
Returns the number of tiles in the x direction. This is always one.
Specified by:
getNumXTiles in interface RenderedImage
Returns:
the number of tiles in the x direction.

getNumYTiles

public int getNumYTiles()
Returns the number of tiles in the y direction. This is always one.
Specified by:
getNumYTiles in interface RenderedImage
Returns:
the number of tiles in the y direction.

getProperty

public Object getProperty(String name)
Returns a property of the image by name.
Specified by:
getProperty in interface RenderedImage
Parameters:
name - the property name
Returns:
an Object that is the property referred to by the specified name.
Usages and Demos :

View More Examples of getProperty(String name)
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5: public class BufferedImageCachableRed extends AbstractRed {
   6:     BufferedImage bi;
   7: 
   8:         ...
   9:     public BufferedImageCachableRed(BufferedImage bi) {
  10:         super((CachableRed)null, 
  11:         ...
  12:     public Object getProperty(String name) {
  13:         return bi.getProperty(name);

View Full Code Here
   1: import java.awt.Image;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ImageObserver;
   4:         ...
   5: {
   6:    transient BufferedImage backing;
   7:    transient List<Pending> pending;
   8:         ...
   9: 
  10:    public RemoteImage(BufferedImage backing)
  11:    {
  12:         ...
  13:             case ImageObserver.PROPERTIES:
  14:                Object property = backing.getProperty((String) otherInfo, observer);

View Full Code Here
   1: import java.awt.image.ImageObserver;
   2: import java.awt.image.BufferedImage;
   3: import gnu.gcj.xlib.GC;
   4:         ...
   5: 
   6:     if (!(img instanceof BufferedImage))
   7:       {
   8:         ...
   9:     
  10:     BufferedImage bimg = (BufferedImage) img;
  11: 
  12:         ...
  13:     XImage ximg = (XImage) bimg.getProperty("gnu.gcj.xlib.XImage");

View Full Code Here
   1: import java.awt.FontMetrics;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ImageObserver;
   4:         ...
   5:     }
   6:     if (image instanceof BufferedImage)
   7:     {
   8:         ...
   9:       BufferedImage bImage = (BufferedImage) image;
  10:         ...
  11:       Object config = bImage.getProperty("java.awt.GraphicsConfiguration");

View Full Code Here
   1: 
   2:     public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) {
   3:         ...
   4:         BufferedImage img1 = op.filter(img, null);
   5:         drawImage(img1, new AffineTransform(1f, 0f, 0f, 1f, x, y), null);
   6:         ...
   7:         for (int i = 0; i < names.length; i++) {
   8:             properties.put(names[i], img.getProperty(names[i]));
   9:         }
  10:         ...
  11:         WritableRaster wr = img.copyData(null);
  12:         BufferedImage img1 = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), properties);

View Full Code Here

getProperty

public Object getProperty(String name,
                          ImageObserver observer)
Returns a property of the image by name. Individual property names are defined by the various image formats. If a property is not defined for a particular image, this method returns the UndefinedProperty field. If the properties for this image are not yet known, then this method returns null and the ImageObserver object is notified later. The property name "comment" should be used to store an optional comment that can be presented to the user as a description of the image, its source, or its author.
Overrides:
getProperty in interface Image
Parameters:
name - the property name
observer - the ImageObserver that receives notification regarding image information
Returns:
an Object that is the property referred to by the specified name or null if the properties of this image are not yet known.
Usages and Demos :

View More Examples of getProperty(String name,ImageObserver observer)
   1: import java.awt.Image;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ImageObserver;
   4:         ...
   5: {
   6:    transient BufferedImage backing;
   7:    transient List<Pending> pending;
   8:         ...
   9: 
  10:    public RemoteImage(BufferedImage backing)
  11:    {
  12:         ...
  13:       {
  14:          return backing.getProperty(name, observer);

View Full Code Here
   1:       };
   2:       Object oo = img.getProperty("url",dummy);
   3: 
   4:         ...
   5:   {
   6:     Object oo = img.getProperty("url",observer);
   7:     if( oo != null ) {
   8:         ...
   9: 
  10:   public void drawImage(BufferedImage img,BufferedImageOp op,int x,int y)
  11:   {

View Full Code Here

getPropertyNames

public String[] getPropertyNames()
Returns an array of names recognized by getProperty(String) or null, if no property names are recognized.
Specified by:
getPropertyNames in interface RenderedImage
Returns:
a String array containing all of the property names that getProperty(String) recognizes; or null if no property names are recognized.
Usages and Demos :

View More Examples of getPropertyNames()
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5: public class BufferedImageCachableRed extends AbstractRed {
   6:     BufferedImage bi;
   7: 
   8:         ...
   9:     public BufferedImageCachableRed(BufferedImage bi) {
  10:         super((CachableRed)null, 
  11:         ...
  12:     public String [] getPropertyNames() {
  13:         return bi.getPropertyNames();

View Full Code Here
   1: 
   2:     public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) {
   3:         ...
   4:         BufferedImage img1 = op.filter(img, null);
   5:         drawImage(img1, new AffineTransform(1f, 0f, 0f, 1f, x, y), null);
   6:         ...
   7:         Hashtable properties = new Hashtable();
   8:         String[] names = img.getPropertyNames();
   9:         for (int i = 0; i < names.length; i++) {
  10:         ...
  11:         WritableRaster wr = img.copyData(null);
  12:         BufferedImage img1 = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), properties);

View Full Code Here
   1: 
   2:     public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) {
   3:         ...
   4:         BufferedImage img1 = op.filter(img, null);
   5:         drawImage(img1, new AffineTransform(1f, 0f, 0f, 1f, x, y), null);
   6:         ...
   7:         Hashtable properties = new Hashtable();
   8:         String[] names = img.getPropertyNames();
   9:         for (int i = 0; i < names.length; i++) {
  10:         ...
  11:         WritableRaster wr = img.copyData(null);
  12:         BufferedImage img1 = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), properties);

View Full Code Here
   1: import java.awt.geom.RoundRectangle2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.BufferedImageOp;
   4:         ...
   5:     
   6:     public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y) {
   7:         ...
   8:         BufferedImage result = img;
   9:         if (op != null) {
  10:         ...
  11:             Hashtable properties = new Hashtable();
  12:             String[] keys = img.getPropertyNames();

View Full Code Here

getRGB

public int getRGB(int x,
                  int y)
Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace. Color conversion takes place if this default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method.

An ArrayOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

Parameters:
Returns:
an integer pixel in the default RGB color model and default sRGB colorspace.
Usages and Demos :

View More Examples of getRGB(int x,int y)
   1: import java.awt.Cursor;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.Color;
   4:         ...
   5: 
   6:   private BufferedImage o;
   7:         ...
   8:   private BufferedImage p;
   9:   private postFrame gui;
  10:         ...
  11:       for (int x = 0; x < o.getWidth(); x++) {
  12:         int srcPixel = o.getRGB(x, y);

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5:     {
   6:         BufferedImage bi = new BufferedImage(img.getWidth(this), img.getHeight(this), BufferedImage.TYPE_INT_ARGB);
   7:         bi.getGraphics().drawImage(img, 0, 0, this);
   8:         ...
   9:             {
  10:                 int rgb = bi.getRGB(x,y);

View Full Code Here
   1: import java.awt.Color;
   2: import java.awt.image.BufferedImage;
   3: import java.io.File;
   4:         ...
   5: 
   6:     public static void writeImageToFile(BufferedImage image) {
   7:         final JFileChooser chooser = new JFileChooser();
   8:         ...
   9: 
  10:     public static BufferedImage getOutline(BufferedImage image) {
  11:         final int w = image.getWidth();
  12:         ...
  13:         for (int x = 0; x < w; x++) {
  14:             int prev = image.getRGB(x, 0);

View Full Code Here
   1:     JPEGImageDecoder jpegDec = JPEGCodec.createJPEGDecoder(istream);
   2:     BufferedImage thisImage = jpegDec.decodeAsBufferedImage();
   3: 
   4:         ...
   5:         for (int y = 0; y < maxy; y++) {
   6:         rgb = thisImage.getRGB(x*2,y*2);
   7:         r = (rgb & 0x00ff0000) >> 16;
   8:         ...
   9:     JPEGImageDecoder jpegDec = JPEGCodec.createJPEGDecoder(istream);
  10:     BufferedImage objImage = jpegDec.decodeAsBufferedImage();
  11:     theURL = new URL(backgroundURL);
  12:         ...
  13:     jpegDec = JPEGCodec.createJPEGDecoder(istream);
  14:     BufferedImage bkgImage = jpegDec.decodeAsBufferedImage();

View Full Code Here
   1: import javax.imageio.ImageIO;
   2: import java.awt.image.BufferedImage;
   3: import javax.swing.ImageIcon;
   4:         ...
   5:   
   6:   private BufferedImage bufferedImage;
   7:   
   8:         ...
   9:  {
  10:     return bufferedImage.getRGB(x,y);
  11:  }

View Full Code Here

getRGB

public int[] getRGB(int startX,
                    int startY,
                    int w,
                    int h,
                    int[] rgbArray,
                    int offset,
                    int scansize)
Returns an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, from a portion of the image data. Color conversion takes place if the default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. With a specified coordinate (x, y) in the image, the ARGB pixel can be accessed in this way:
    pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)]; 

An ArrayOutOfBoundsException may be thrown if the region is not in bounds. However, explicit bounds checking is not guaranteed.

Parameters:
w - width of region
h - height of region
rgbArray - if not null, the rgb pixels are written here
offset - offset into the rgbArray
scansize - scanline stride for the rgbArray
Returns:
array of RGB pixels.
Usages and Demos :

View More Examples of getRGB(int startX,int startY,int w,int h,int[] rgbArray,int offset,int scansize)
   1: 
   2:     public BufferedImage filter( BufferedImage src, BufferedImage dst ) {
   3:         int width = src.getWidth();
   4:         ...
   5:             } else {
   6:                 src.getRGB( 0, y, width, 1, inPixels, 0, width );
   7:                 for ( int x = 0; x < width; x++ )
   8:                     inPixels[x] = filterRGB( x, y, inPixels[x] );
   9:                 dst.setRGB( 0, y, width, 1, inPixels, 0, width );

View Full Code Here
   1:     
   2:     public BufferedImage filter( BufferedImage src, BufferedImage dst ) {
   3:         int width = src.getWidth();
   4:         ...
   5:         int[] outPixels = new int[width*height];
   6:         src.getRGB( 0, 0, width, height, inPixels, 0, width );
   7: 
   8:         ...
   9: 
  10:         src.getRGB( 0, 0, width, height, outPixels, 0, width );

View Full Code Here
   1: 
   2:     public BufferedImage filter( BufferedImage src, BufferedImage dst ) {
   3:         int width = src.getWidth();
   4:         ...
   5:         int[] outPixels = new int[width*height];
   6:         src.getRGB( 0, 0, width, height, inPixels, 0, width );
   7: 
   8:         if ( radius > 0 ) {
   9:             convolveAndTranspose(kernel, inPixels, outPixels, width, height, alpha, CLAMP_EDGES);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ColorModel;
   4:         ...
   5:     final ImageConsumer[] cons = (ImageConsumer[]) consumers.toArray(new ImageConsumer[consumers.size()]);
   6:     final BufferedImage image = metafile.replay();
   7: 
   8:         ...
   9: 
  10:       pixels = image.getRGB(0, i, w, rows, pixels, 0, w);
  11:       for (int j = 0; j < cons.length; j++)

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.image.BufferedImage;
   3: 
   4:         ...
   5: 
   6:   private BufferedImage awtImage;
   7:   private Image swtImage;
   8:         ...
   9:     byte[] data = swtImageData.data;
  10:     awtImage.getRGB(clipX, clipY, clipW, clipH, awtPixels, 0, clipW);
  11:     for (int i = 0; i < clipH; i++)
  12:         ...
  13:       height = Math.max(height, currentImageHeight);
  14:       awtImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);

View Full Code Here

getRaster

public WritableRaster getRaster()
Returns the WritableRaster.
Returns:
the WriteableRaster of this BufferedImage.
Usages and Demos :

View More Examples of getRaster()
   1: import java.awt.Graphics2D;
   2: import java.awt.image.BufferedImage;
   3: import java.util.Hashtable;
   4:         ...
   5: 
   6:             BufferedImage bi;
   7:         ...
   8:             bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
   9: 
  10:         ...
  11:                    formatMessage(base, code, params));
  12:             bi = new BufferedImage(bi.getColorModel(), bi.getRaster(),

View Full Code Here
   1:     }
   2:     BufferedImage image = vidPanel.getVideo().getImage();
   3:         ...
   4:     if (image.getType() == BufferedImage.TYPE_INT_RGB) {
   5:       try {
   6:         ...
   7:         int y = (int)end1.getY();
   8:         image.getRaster().getDataElements(x, y, length, 1, pixels);
   9:         for (int i = 0; i < pixels.length; i++) {

View Full Code Here
   1: 
   2:   public TRegion(BufferedImage image, int x0, int y0) {
   3:     w = image.getWidth();
   4:         ...
   5:     pixels = new int[w * h];
   6:     image.getRaster().getDataElements(0, 0, w, h, pixels);
   7:     int pixel = pixels[y0 * w + x0];
   8:     Color.RGBtoHSB(r, g, b, hsb);
   9:     minBrightness = hsb[2] - 0.2f;

View Full Code Here
   1: 
   2:   public BufferedImage createCompatibleDestImage(BufferedImage src,
   3:                                                  ColorModel dstCM) {
   4:         ...
   5:     BufferedImage image;
   6:     if (dstCM == null) {
   7:         ...
   8:   public final Rectangle2D getBounds2D(BufferedImage src) {
   9:     return src.getRaster().getBounds();
  10:   }

View Full Code Here
   1: 
   2:   private BufferedImage source, output;
   3:   private int[] pixels;
   4:         ...
   5: 
   6:   public BufferedImage getFilteredImage(BufferedImage sourceImage) {
   7:     if (!isEnabled()) return sourceImage;
   8:         ...
   9:     if (vidPanel == null) return;
  10:     source.getRaster().getDataElements(0, 0, w, h, pixels);
  11:         ...
  12:     output.getRaster().setDataElements(0, 0, w, h, pixels);

View Full Code Here

getSampleModel

public SampleModel getSampleModel()
Returns the SampleModel associated with this BufferedImage.
Specified by:
getSampleModel in interface RenderedImage
Returns:
the SampleModel of this BufferedImage.
Usages and Demos :

View More Examples of getSampleModel()
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5: public class BufferedImageCachableRed extends AbstractRed {
   6:     BufferedImage bi;
   7: 
   8:         ...
   9:     public BufferedImageCachableRed(BufferedImage bi) {
  10:         super((CachableRed)null, 
  11:         ...
  12:                             bi.getWidth(), bi.getHeight()),
  13:               bi.getColorModel(), bi.getSampleModel(), 

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:   private BufferedImage image;
   7: 
   8:         ...
   9:         imageTypes.add(new ImageTypeSpecifier(image.getColorModel(),
  10:                                               image.getSampleModel()));
  11:       }
  12:         ...
  13: 
  14:   public BufferedImage read(int imageIndex, ImageReadParam param)

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.DataBuffer;
   4:         ...
   5: 
   6:     public BufferedImage createImage(int width, int height) {
   7:         ...
   8:         return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
   9:     }
  10:         ...
  11:         SinglePixelPackedSampleModel sppsm;
  12:         sppsm = (SinglePixelPackedSampleModel)img.getSampleModel();

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.DataBufferInt;
   4:         ...
   5: 
   6:     public BufferedImage createImage(int width, int height) {
   7:         ...
   8:         return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
   9:     }
  10:         ...
  11:             int scanStride = ((SinglePixelPackedSampleModel)
  12:                               img.getSampleModel()).getScanlineStride();

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.io.File;
   4:         ...
   5: 
   6:             BufferedImage image;
   7:             int[] opaque;
   8:         ...
   9:             rParam.setSourceRegion(new Rectangle(0,0, 100,100));
  10:             image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
  11:             opaque = new int[image.getWidth() * image.getHeight()];
  12:         ...
  13:             }
  14:             image.getSampleModel().setSamples(0, 0, image.getWidth(), image.getHeight(), 3, opaque, image.getRaster().getDataBuffer());

View Full Code Here

getSource

public ImageProducer getSource()
Returns the object that produces the pixels for the image.
Overrides:
getSource in interface Image
Returns:
the ImageProducer that is used to produce the pixels for this image.
See Also:
ImageProducer
Usages and Demos :

View More Examples of getSource()
   1: import java.awt.Image;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ImageObserver;
   4:         ...
   5: {
   6:    transient BufferedImage backing;
   7:    transient List<Pending> pending;
   8:         ...
   9: 
  10:    public RemoteImage(BufferedImage backing)
  11:    {
  12:         ...
  13:       {
  14:          return backing.getSource();

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.FilteredImageSource;
   4:         ...
   5: 
   6:     BufferedImage img = new BufferedImage(iFrame.getWidth(), iFrame.getHeight(), BufferedImage.TYPE_INT_ARGB);
   7: 
   8:         ...
   9: 
  10:     FilteredImageSource source = new FilteredImageSource(img.getSource(), colorFilter);
  11:     iFrame.paint(img.getGraphics());

View Full Code Here
   1: import java.awt.im.InputMethodHighlight;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ColorModel;
   4:         ...
   5:     Image image;
   6:     BufferedImage buffered = ImageIO.read(i);
   7:     if (buffered != null && buffered.getTransparency() == Transparency.OPAQUE)
   8:         ...
   9:       {
  10:         ImageProducer source = buffered.getSource();
  11:         image = createImage(source);

View Full Code Here
   1: import java.awt.*;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.FilteredImageSource;
   4:         ...
   5: 
   6:     BufferedImage img = new BufferedImage(pane.getWidth(), pane.getHeight(), BufferedImage.TYPE_INT_ARGB);
   7: 
   8:         ...
   9: 
  10:     FilteredImageSource source = new FilteredImageSource(img.getSource(), colorFilter);
  11:     pane.paint(img.getGraphics());

View Full Code Here

getSources

public Vector getSources()
Returns a Vector of RenderedImage objects that are the immediate sources, not the sources of these immediate sources, of image data for this BufferedImage. This method returns null if the BufferedImage has no information about its immediate sources. It returns an empty Vector if the BufferedImage has no immediate sources.
Specified by:
getSources in interface RenderedImage
Returns:
a Vector containing immediate sources of this BufferedImage object's image date, or null if this BufferedImage has no information about its immediate sources, or an empty Vector if this BufferedImage has no immediate sources.

getSubimage

public BufferedImage getSubimage(int x,
                                 int y,
                                 int w,
                                 int h)
Returns a subimage defined by a specified rectangular region. The returned BufferedImage shares the same data array as the original image.
Parameters:
w - the width of the specified rectangular region
h - the height of the specified rectangular region
Returns:
a BufferedImage that is the subimage of this BufferedImage.
Usages and Demos :

View More Examples of getSubimage(int x,int y,int w,int h)
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.BufferedImageOp;
   4:         ...
   5:     Rectangle r = getContentBounds();
   6:     BufferedImage bi = (BufferedImage)getBrowser().getOffImage();
   7:     int x=r.x, y=r.y, w=Math.min(r.width, bi.getWidth()-r.x), h=Math.min(r.height, bi.getHeight()-r.y);
   8:         ...
   9:     if (w>0 && h>0) {
  10:         BufferedImage sub = bi.getSubimage(x,y, w,h);
  11:         cx.g.drawImage(sub, op_, x,y);

View Full Code Here
   1: import java.awt.image.RescaleOp;
   2: import java.awt.image.BufferedImage;
   3: 
   4:         ...
   5:         Browser br = getBrowser();
   6:         BufferedImage bi = (BufferedImage)br.getOffImage();
   7:         ...
   8:         BufferedImage sub = bi.getSubimage(r.x,r.y, r.width,r.height);
   9:         g.drawImage(sub, op_, r.x,r.y);

View Full Code Here
   1: 
   2:     public BorderFill(BufferedImage image, Rectangle[] rectangles, boolean isTile[]) {
   3:     sizes = new Dimension[8];
   4:         ...
   5:         Rectangle r = rectangles[i];
   6:         BufferedImage sample = image.getSubimage(r.x, r.y, r.width, r.height);
   7:             ImageFill fill = new ImageFill(sample);
   8:         ...
   9: 
  10:     public BorderFill(BufferedImage image, Rectangle[] rectangles) {
  11:         this(image, rectangles, new boolean[]{true, true, true, true});

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5:         supportedImageTypes = new ArrayList();
   6:         supportedImageTypes.add(ImageTypeSpecifier.createFromBufferedImageType(BufferedImage.TYPE_INT_ARGB));
   7:     }
   8:         ...
   9: 
  10:     public BufferedImage read(int imageIndex, ImageReadParam param) throws IOException {
  11: 
  12:         ...
  13:                 destHeight = destination.getHeight() - destOffset.y;
  14:             destination = destination.getSubimage(destOffset.x, destOffset.y, destWidth, destHeight);

View Full Code Here
   1: import java.awt.geom.Point2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.DataBuffer;
   4:         ...
   5:     private Graphics2D backingGraphics = null;
   6:     private BufferedImage backingImage = null;
   7:     private Dimension backingDimension = new Dimension();
   8:         ...
   9:                 int h = clipRect.height;
  10:                 BufferedImage subImage = backingImage.getSubimage(x, y, w, h);
  11:                 g2d.drawImage(subImage, x, y, this);

View Full Code Here

getTile

public Raster getTile(int tileX,
                      int tileY)
Returns tile (tileXtileY). Note that tileX and tileY are indices into the tile array, not pixel locations. The Raster that is returned is live, which means that it is updated if the image is changed.
Specified by:
getTile in interface RenderedImage
Parameters:
tileX - the x index of the requested tile in the tile array
tileY - the y index of the requested tile in the tile array
Returns:
a Raster that is the tile defined by the arguments tileX and tileY.
Usages and Demos :

View More Examples of getTile(int tileX,int tileY)
   1: import java.awt.Rectangle;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.Raster;
   4:         ...
   5: public class BufferedImageCachableRed extends AbstractRed {
   6:     BufferedImage bi;
   7: 
   8:         ...
   9:     public BufferedImageCachableRed(BufferedImage bi) {
  10:         super((CachableRed)null, 
  11:         ...
  12:     public Raster getTile(int tileX, int tileY) {
  13:         return bi.getTile(tileX,tileY);

View Full Code Here

getTileGridXOffset

public int getTileGridXOffset()
Returns the x offset of the tile grid relative to the origin, For example, the x coordinate of the location of tile (0, 0). This is always zero.
Specified by:
getTileGridXOffset in interface RenderedImage
Returns:
the x offset of the tile grid.

getTileGridYOffset

public int getTileGridYOffset()
Returns the y offset of the tile grid relative to the origin, For example, the y coordinate of the location of tile (0, 0). This is always zero.
Specified by:
getTileGridYOffset in interface RenderedImage
Returns:
the y offset of the tile grid.

getTileHeight

public int getTileHeight()
Returns the tile height in pixels.
Specified by:
getTileHeight in interface RenderedImage
Returns:
the tile height in pixels.

getTileWidth

public int getTileWidth()
Returns the tile width in pixels.
Specified by:
getTileWidth in interface RenderedImage
Returns:
the tile width in pixels.

getTransparency

public int getTransparency()
Returns the transparency. Returns either OPAQUE, BITMASK, or TRANSLUCENT.
Specified by:
getTransparency in interface Transparency
Returns:
the transparency of this BufferedImage.
Since:
1.5

getType

public int getType()
Returns the image type. If it is not one of the known types, TYPE_CUSTOM is returned.
Returns:
the image type of this BufferedImage.
Usages and Demos :

View More Examples of getType()
   1: import java.awt.image.AffineTransformOp;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.DataBufferByte;
   4:         ...
   5: public final class JOGLUtil {
   6:     public static BufferedImage readPNGImage(String resource) {
   7:         ...
   8:         BufferedImage img;
   9:         try {
  10:         ...
  11:         ByteBuffer dest = null;
  12:         switch(img.getType()) {

View Full Code Here
   1: 
   2:     protected BufferedImage sourceImage;
   3: 
   4:         ...
   5:     protected BufferedImage reducedImage;
   6: 
   7:         ...
   8:         || (w != reducedImage.getWidth()) || (h != reducedImage.getHeight()) 
   9:         || sourceImage.getType() != reducedImage.getType()) {
  10:         ...
  11:         reducedImage = new BufferedImage(w, h, sourceImage.getType());

View Full Code Here
   1: import java.awt.Color;
   2: import java.awt.image.BufferedImage;
   3: import java.io.File;
   4:         ...
   5: 
   6:     public static void writeImageToFile(BufferedImage image) {
   7:         final JFileChooser chooser = new JFileChooser();
   8:         ...
   9: 
  10:     public static BufferedImage getOutline(BufferedImage image) {
  11:         final int w = image.getWidth();
  12:         ...
  13:         final int h = image.getHeight();
  14:         final BufferedImage im = new BufferedImage(w, h, image.getType());

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.BufferedImageOp;
   4:         ...
   5: 
   6:    public BufferedImage getSliceImage(int slice, Point3f p)
   7:    {
   8:         ...
   9: 
  10:    public BufferedImage getSliceImage(int slice, Point3f p,
  11:                                       float brightness)

View Full Code Here
   1: 
   2:     void loadPixels(BufferedImage image, Rectangle paintRect) {
   3:         ...
   4:         if (image.getType() != BufferedImage.TYPE_INT_ARGB &&
   5:         ...
   6:             image.getType() != BufferedImage.TYPE_INT_RGB) {
   7:             throw new IllegalArgumentException("setPixels: Expected TYPE_INT_[A]RGB Image, got: " +
   8:         ...
   9:         if (pixelFormat != GL_RGBA|| numComponents != 4) {
  10:             throw new IllegalArgumentException("setPixels: Cannot use BufferedImage to set this texture");

View Full Code Here

getWidth

public int getWidth()
Returns the width of the BufferedImage.
Specified by:
getWidth in interface RenderedImage
Returns:
the width of this BufferedImage
Usages and Demos :

View More Examples of getWidth()
   1: import java.awt.Graphics;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ColorModel;
   4:         ...
   5: 
   6:     private BufferedImage myTaskImage;
   7:     ColorModel myColorModel = new DirectColorModel(32,
   8:         ...
   9:     
  10:     public RenderedChartImage(ChartModelBase chartModel, BufferedImage taskImage, int chartWidth, int chartHeight) {
  11:         myChartModel = chartModel;
  12:         ...
  13:         minY = 0;
  14:         width = chartWidth+taskImage.getWidth();

View Full Code Here
   1:     public void okActionPerformed(java.awt.event.ActionEvent evt) {
   2:     BufferedImage im = ((TerpPaint)this.getParent()).center.getBufferedImage();
   3:     Graphics2D g2d = im.createGraphics();
   4:         ...
   5: 
   6:         if (im.getWidth()* (x/100)*im.getHeight()* (y/100)>=3000000)
   7:         ok_action = false;
   8:         ...
   9:         {
  10:         BufferedImage temp = new BufferedImage((int)(im.getWidth()* (x/100)), (int)(im.getHeight()*(y/100)), BufferedImage.TYPE_INT_RGB);
  11:         Graphics2D gd = temp.createGraphics();

View Full Code Here
   1:     public void okActionPerformed(java.awt.event.ActionEvent evt) {
   2:     BufferedImage im = ((TerpPaint)this.getParent()).center.getBufferedImage();
   3:     Graphics2D g2d = im.createGraphics();
   4:         ...
   5: 
   6:         if (im.getWidth()* (x/100)*im.getHeight()* (y/100)>=3000000)
   7:         ok_action = false;
   8:         ...
   9:         {
  10:         BufferedImage temp = new BufferedImage((int)(im.getWidth()* (x/100)), (int)(im.getHeight()*(y/100)), BufferedImage.TYPE_INT_RGB);
  11:         Graphics2D gd = temp.createGraphics();

View Full Code Here
   1:     public void okActionPerformed(java.awt.event.ActionEvent evt) {
   2:     BufferedImage im = ((TerpPaint)this.getParent()).center.getBufferedImage();
   3:     Graphics2D g2d = im.createGraphics();
   4:         ...
   5:     {
   6:         int w = im.getWidth();
   7:         int h = im.getHeight();
   8:         ...
   9:         System.out.println("I'm going to flip horizontal");
  10:         g2d.drawImage(im,im.getWidth(),0,0,im.getHeight(),0,0,im.getWidth(),im.getHeight(),this);
  11:         int cur_layer = ((TerpPaint)this.getParent()).center.currentLayer;
  12:         ...
  13:         System.out.println("I'm going to flip vertical");
  14:         g2d.drawImage(im,0,im.getHeight(),im.getWidth(),0,0,0,im.getWidth(),im.getHeight(),this);

View Full Code Here
   1:     public void okActionPerformed(java.awt.event.ActionEvent evt) {
   2:     BufferedImage im = ((TerpPaint)this.getParent()).center.getBufferedImage();
   3:     Graphics2D g2d = im.createGraphics();
   4:         ...
   5:     {
   6:         int w = im.getWidth();
   7:         int h = im.getHeight();
   8:         ...
   9:         System.out.println("I'm going to flip horizontal");
  10:         g2d.drawImage(im,im.getWidth(),0,0,im.getHeight(),0,0,im.getWidth(),im.getHeight(),this);
  11:         int cur_layer = ((TerpPaint)this.getParent()).center.currentLayer;
  12:         ...
  13:         System.out.println("I'm going to flip vertical");
  14:         g2d.drawImage(im,0,im.getHeight(),im.getWidth(),0,0,0,im.getWidth(),im.getHeight(),this);

View Full Code Here

getWidth

public int getWidth(ImageObserver observer)
Returns the width of the BufferedImage.
Overrides:
getWidth in interface Image
Parameters:
observer - ignored
Returns:
the width of this BufferedImage
Usages and Demos :

View More Examples of getWidth(ImageObserver observer)
   1: public class WatermarkTextField extends JTextField {
   2:     BufferedImage img;
   3:     TexturePaint texture;
   4:         ...
   5:         Rectangle rect = new Rectangle(0,0,
   6:                 img.getWidth(null),img.getHeight(null));
   7:         texture = new TexturePaint(img, rect);
   8:         setOpaque(false);
   9:     }

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: 
   4:         ...
   5:     {
   6:         BufferedImage i = generateImage(10, Globals.curEditor());
   7:         ...
   8:         System.out.print(i.getWidth(null));
   9:         System.out.print(", ");

View Full Code Here
   1: import java.awt.Image;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ImageObserver;
   4:         ...
   5: {
   6:    transient BufferedImage backing;
   7:    transient List<Pending> pending;
   8:         ...
   9: 
  10:    public RemoteImage(BufferedImage backing)
  11:    {
  12:         ...
  13:                   observer.imageUpdate(RemoteImage.this, ImageObserver.HEIGHT,
  14:                                        0, 0, backing.getWidth(null), height);

View Full Code Here
   1: import java.awt.Toolkit;
   2: import java.awt.image.BufferedImage;
   3: import java.io.ByteArrayInputStream;
   4:         ...
   5: 
   6:     public static BufferedImage decodeImage(String filename) {
   7:         try {
   8:         ...
   9:             JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(fis);
  10:             BufferedImage image = decoder.decodeAsBufferedImage();
  11:             fis.close();
  12:         ...
  13:     public static Image addAlphaChannel(Image image, Component observer) {
  14:         BufferedImage alphaImage = new BufferedImage(image.getWidth(observer),

View Full Code Here
   1: import java.awt.geom.RoundRectangle2D;
   2: import java.awt.image.BufferedImage;
   3: import java.io.File;
   4:         ...
   5:     public static void createScreenshot(final Component component, final String format, final String path) throws IOException {
   6:         BufferedImage image = createCompatibleImage(component.getWidth(), component.getHeight(), true);
   7:         Graphics2D g = image.createGraphics();
   8:         ...
   9:         if (format == null)
  10:             return BufferedImage.TYPE_INT_ARGB;
  11:         
  12:         ...
  13:     public static boolean isEmpty(final Image image) {
  14:         return (image == null) || (image.getWidth(null) < 1) || (image.getHeight(null) < 1);

View Full Code Here

getWritableTile

public WritableRaster getWritableTile(int tileX,
                                      int tileY)
Checks out a tile for writing. All registered TileObservers are notified when a tile goes from having no writers to having one writer.
Specified by:
getWritableTile in interface WritableRenderedImage
Parameters:
tileX - the x index of the tile
tileY - the y index of the tile
Returns:
a WritableRaster that is the tile, indicated by the specified indices, to be checked out for writing.
Usages and Demos :

View More Examples of getWritableTile(int tileX,int tileY)
   1: 
   2:   public AShortBufferedPixelGraphics2D(BufferedImage backingImage) {
   3:     super(backingImage);
   4:         ...
   5:     Raster raster = backingImage.getWritableTile(0, 0);
   6:     DataBufferUShort dataBuffer = (DataBufferUShort)raster.getDataBuffer();
   7:     bank = dataBuffer.getData(0);
   8:     setColor(g.getColor());

View Full Code Here
   1: import java.awt.Color;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.DataBufferInt;
   4:         ...
   5:     
   6:     public AIntBufferedPixelGraphics2D(BufferedImage backingImage)
   7:     {
   8:         ...
   9:         super(backingImage);
  10:         Raster raster = backingImage.getWritableTile(0, 0);
  11:         DataBufferInt dataBuffer = (DataBufferInt) raster.getDataBuffer();

View Full Code Here
   1: import java.awt.color.ColorSpace;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ColorModel;
   4:         ...
   5: 
   6:     private BufferedImage theImage = null;
   7: 
   8:         ...
   9: 
  10:     public synchronized BufferedImage read(int imageIndex, ImageReadParam param)
  11:             throws IOException {
  12:         ...
  13: 
  14:         this.theTile = theImage.getWritableTile(0, 0);

View Full Code Here

getWritableTileIndices

public Point[] getWritableTileIndices()
Returns an array of Point objects indicating which tiles are checked out for writing. Returns null if none are checked out.
Specified by:
getWritableTileIndices in interface WritableRenderedImage
Returns:
a Point array that indicates the tiles that are checked out for writing, or null if no tiles are checked out for writing.

hasTileWriters

public boolean hasTileWriters()
Returns whether or not any tile is checked out for writing. Semantically equivalent to
 (getWritableTileIndices() != null).
 
Specified by:
hasTileWriters in interface WritableRenderedImage
Returns:
true if any tile is checked out for writing; false otherwise.

isAlphaPremultiplied

public boolean isAlphaPremultiplied()
Returns whether or not the alpha has been premultiplied. It returns false if there is no alpha.
Returns:
true if the alpha has been premultiplied; false otherwise.
Usages and Demos :

View More Examples of isAlphaPremultiplied()
   1: import java.awt.Graphics2D;
   2: import java.awt.image.BufferedImage;
   3: import java.util.Hashtable;
   4:         ...
   5: 
   6:             BufferedImage bi;
   7:         ...
   8:             bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
   9: 
  10:         ...
  11:             bi = new BufferedImage(bi.getColorModel(), bi.getRaster(),
  12:                                    bi.isAlphaPremultiplied(),

View Full Code Here
   1: import java.awt.Graphics2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.RenderedImage;
   4:         ...
   5:         try {
   6:             BufferedImage ref = getImage(refImgURL);
   7:         ...
   8:             BufferedImage gen = getImage(tmpFile);
   9:             BufferedImage diff = buildDiffImage(ref, gen);
  10:         ...
  11: 
  12:         boolean refPre = ref.isAlphaPremultiplied();

View Full Code Here
   1: import java.awt.color.ColorSpace;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.ColorModel;
   4:         ...
   5:     
   6:     public BufferedImage read(final int imageIndex, final ImageReadParam param) throws IOException {
   7:         clearAbortRequest();
   8:         ...
   9:         final int  streamWidthInBytes = streamWidth * DataBuffer.getDataTypeSize(streamDataType) / 8;
  10:         final BufferedImage     image = getDestination(imageIndex, param, sourceBands, destinationBands, streamModel, streamWidth, streamHeight);
  11:         final SampleModel  imageModel = image.getSampleModel();
  12:         ...
  13:                     final boolean             hasAlpha = finalColorModel.hasAlpha();
  14:                     final boolean isAlphaPremultiplied = finalColorModel.isAlphaPremultiplied();

View Full Code Here
   1: import java.awt.image.SampleModel;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5:     
   6:     public BufferedImage read(final int imageIndex, final ImageReadParam param) throws IOException {
   7:         clearAbortRequest();
   8:         ...
   9:         final int  streamWidthInBytes = streamWidth * DataBuffer.getDataTypeSize(streamDataType) / 8;
  10:         final BufferedImage     image = getDestination(imageIndex, param, sourceBands, destinationBands, streamModel, streamWidth, streamHeight);
  11:         final SampleModel  imageModel = image.getSampleModel();
  12:         ...
  13:                     final boolean             hasAlpha = finalColorModel.hasAlpha();
  14:                     final boolean isAlphaPremultiplied = finalColorModel.isAlphaPremultiplied();

View Full Code Here

isTileWritable

public boolean isTileWritable(int tileX,
                              int tileY)
Returns whether or not a tile is currently checked out for writing.
Specified by:
isTileWritable in interface WritableRenderedImage
Parameters:
tileX - the x index of the tile.
tileY - the y index of the tile.
Returns:
true if the tile specified by the specified indices is checked out for writing; false otherwise.

releaseWritableTile

public void releaseWritableTile(int tileX,
                                int tileY)
Relinquishes permission to write to a tile. If the caller continues to write to the tile, the results are undefined. Calls to this method should only appear in matching pairs with calls to getWritableTile(int, int). Any other leads to undefined results. All registered TileObservers are notified when a tile goes from having one writer to having no writers.
Specified by:
releaseWritableTile in interface WritableRenderedImage
Parameters:
tileX - the x index of the tile
tileY - the y index of the tile

removeTileObserver

public void removeTileObserver(TileObserver to)
Removes a tile observer. If the observer was not registered, nothing happens. If the observer was registered for multiple notifications, it is now registered for one fewer notification.
Specified by:
removeTileObserver in interface WritableRenderedImage
Parameters:
to - the specified TileObserver.

setData

public void setData(Raster r)
Sets a rectangular region of the image to the contents of the specified Raster r, which is assumed to be in the same coordinate space as the BufferedImage. The operation is clipped to the bounds of the BufferedImage.
Specified by:
setData in interface WritableRenderedImage
Parameters:
r - the specified Raster
See Also:
getData, getData(Rectangle)

setRGB

public void setRGB(int x,
                   int y,
                   int rgb)
Sets a pixel in this BufferedImage to the specified RGB value. The pixel is assumed to be in the default RGB color model, TYPE_INT_ARGB, and default sRGB color space. For images with an IndexColorModel, the index with the nearest color is chosen.

An ArrayOutOfBoundsException may be thrown if the coordinates are not in bounds. However, explicit bounds checking is not guaranteed.

Parameters:
rgb - the RGB value
Usages and Demos :

View More Examples of setRGB(int x,int y,int rgb)
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.font.TextLayout;
   4:         ...
   5:     static {
   6:         BufferedImage bi = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
   7:         Graphics2D gi = bi.createGraphics();
   8:         ...
   9:         bi = new BufferedImage(2,2,BufferedImage.TYPE_INT_RGB);
  10:         bi.setRGB(0, 0, 0xffffffff); bi.setRGB(1, 0, 0xffffffff);
  11:         ...
  12:         bi.setRGB(0, 1, 0xffffffff); bi.setRGB(1, 1, 0xff0000ff);

View Full Code Here
   1: import java.io.InputStream;
   2: import java.awt.image.BufferedImage;
   3: import java.text.AttributedString;
   4:         ...
   5: 
   6:         BufferedImage bi = new BufferedImage(4,4,BufferedImage.TYPE_INT_ARGB);
   7:         ...
   8:         bi.setRGB(0, 0, 0xffffffff); 
   9:         TexturePaint tp = new TexturePaint(bi,new Rectangle(0,0,4,4));

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.io.ByteArrayInputStream;
   4:         ...
   5: 
   6:       BufferedImage img = new BufferedImage(2, 2, 1);
   7:         ...
   8:       img.setRGB(0, 0, 5);
   9:         ...
  10:       img.setRGB(0, 1, 6);

View Full Code Here
   1: import java.awt.event.*;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.geom.GeneralPath;
   4:         ...
   5:         static {
   6:             BufferedImage bi = new BufferedImage(2,1,BufferedImage.TYPE_INT_RGB);
   7:         ...
   8:             bi.setRGB(0, 0, 0xff00ff00); bi.setRGB(1, 0, 0xffff0000);
   9:             tp1 = new TexturePaint(bi,new Rectangle(0,0,2,1));
  10:         ...
  11:             bi = new BufferedImage(2,1,BufferedImage.TYPE_INT_RGB);
  12:             bi.setRGB(0, 0, 0xff0000ff); bi.setRGB(1, 0, 0xffff0000);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.io.Serializable;
   4:         ...
   5: 
   6:     public BufferedImage getBufferedImage() throws UnsupportedFormatException
   7:     {
   8:         ...
   9:         Frame f = this.getInFormat(TYPE_RGB, 1, Integer.TYPE).getPacked();
  10:         BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  11:         image.setRGB(0, 0, width, height, (int[])(f.data), f.offset, f.linestride);
  12:         ...
  13: 
  14:                 image.setRGB(bin, h-1-y, color);

View Full Code Here

setRGB

public void setRGB(int startX,
                   int startY,
                   int w,
                   int h,
                   int[] rgbArray,
                   int offset,
                   int scansize)
Sets an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, into a portion of the image data. Color conversion takes place if the default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. With a specified coordinate (x, y) in the this image, the ARGB pixel can be accessed in this way:
    pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)];
 
WARNING: No dithering takes place.

An ArrayOutOfBoundsException may be thrown if the region is not in bounds. However, explicit bounds checking is not guaranteed.

Parameters:
w - width of the region
h - height of the region
rgbArray - the rgb pixels
offset - offset into the rgbArray
scansize - scanline stride for the rgbArray
Usages and Demos :

View More Examples of setRGB(int startX,int startY,int w,int h,int[] rgbArray,int offset,int scansize)
   1: public class ColorPan extends JComponent {
   2:   BufferedImage image;
   3: 
   4:         ...
   5:     }
   6:     image = new BufferedImage(width, height,
   7:         ...
   8:         BufferedImage.TYPE_INT_RGB);
   9:         ...
  10:     image.setRGB(0, 0, width, height, data, 0, width);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.util.Arrays;
   4:         ...
   5: 
   6:   public static BufferedImage createTransparentImage (final int width, final int height)
   7:   {
   8:         ...
   9:     final BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
  10:     final int[] data = img.getRGB(0, 0, width, height, null, 0, width);
  11:         ...
  12:     Arrays.fill(data, 0x00000000);
  13:     img.setRGB(0, 0, width, height, data, 0, width);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.util.Arrays;
   4:         ...
   5: 
   6:   public static BufferedImage createTransparentImage (final int width, final int height)
   7:   {
   8:         ...
   9:     final BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
  10:     final int[] data = img.getRGB(0, 0, width, height, null, 0, width);
  11:         ...
  12:     Arrays.fill(data, 0x00000000);
  13:     img.setRGB(0, 0, width, height, data, 0, width);

View Full Code Here
   1: import javax.imageio.stream.ImageInputStream;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.Dimension;
   4:         ...
   5: 
   6:     public BufferedImage decode(ImageInputStream in) throws IOException, BMPException {
   7:     skipToImage(in);
   8:         ...
   9:     int w = (int)d.getWidth();
  10:     BufferedImage image = new BufferedImage(w, h, 
  11:                         BufferedImage.TYPE_INT_RGB);
  12:         ...
  13:     }
  14:     image.setRGB(0, 0, w, h, data, 0, w);

View Full Code Here
   1: 
   2: import java.awt.image.BufferedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:   public BufferedImage setRecord (final MfRecord record)
   7:           throws IOException
   8:         ...
   9: 
  10:   public BufferedImage setRecord (final MfRecord record, final int offset)
  11:           throws IOException
  12:         ...
  13:     final BufferedImage retval = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  14:     retval.setRGB(0, 0, width, height, data, 0, width);

View Full Code Here

toString

public String toString()
Returns a String representation of this BufferedImage object and its values.
Overrides:
toString in interface Object
Returns:
a String representing this BufferedImage.
Usages and Demos :

View More Examples of toString()
   1:     public String getString() {
   2:         return currentStream.toString();
   3:     }
   4:         ...
   5:         Dimension size = new Dimension(width, height);
   6:         BufferedImage buf = buildBufferedImage(size);
   7: 
   8:         ...
   9: 
  10:     public BufferedImage buildBufferedImage(Dimension size) {
  11:         ...
  12:         return new BufferedImage(size.width, size.height,

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.image.BufferedImage;
   3: import java.awt.print.Book;
   4:         ...
   5:         GraphicsConfiguration graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
   6:         BufferedImage result = graphicsConfiguration.createCompatibleImage(width, height, Transparency.TRANSLUCENT);
   7:         Graphics2D g2 = result.createGraphics();    
   8:         ...
   9:     public String toString() {
  10:         String result = super.toString().replaceAll(".*\\.", "");
  11:         return result + "[" + paramString() + "]";
  12:         ...
  13:         
  14:         result.append("bounds=" + (bounds == null ? "null" : bounds.toString()));

View Full Code Here