java.awt.image

Interface RenderedImage

Known Subinterfaces:
WritableRenderedImage
Known Implementing Classes:
BufferedImage

public interface RenderedImage

RenderedImage is a common interface for objects which contain or can produce image data in the form of Rasters. The image data may be stored/produced as a single tile or a regular array of tiles.

Method Summary

WritableRaster
copyData(WritableRaster raster)
Computes an arbitrary rectangular region of the RenderedImage and copies it into a caller-supplied WritableRaster.
ColorModel
getColorModel()
Returns the ColorModel associated with this image.
Raster
getData()
Returns the image as one large tile (for tile based images this will require fetching the whole image and copying the image data over).
Raster
getData(Rectangle rect)
Computes and returns an arbitrary region of the RenderedImage.
int
getHeight()
Returns the height of the RenderedImage.
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 (inclusive) of the RenderedImage.
int
getMinY()
Returns the minimum Y coordinate (inclusive) of the RenderedImage.
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)
Gets a property from the property set of this image.
String[]
getPropertyNames()
Returns an array of names recognized by getProperty(String) or null, if no property names are recognized.
SampleModel
getSampleModel()
Returns the SampleModel associated with this image.
Vector
getSources()
Returns a vector of RenderedImages that are the immediate sources of image data for this RenderedImage.
Raster
getTile(int tileX, int tileY)
Returns tile (tileX, tileY).
int
getTileGridXOffset()
Returns the X offset of the tile grid relative to the origin, i.e., the X coordinate of the upper-left pixel of tile (0, 0).
int
getTileGridYOffset()
Returns the Y offset of the tile grid relative to the origin, i.e., the Y coordinate of the upper-left pixel of tile (0, 0).
int
getTileHeight()
Returns the tile height in pixels.
int
getTileWidth()
Returns the tile width in pixels.
int
getWidth()
Returns the width of the RenderedImage.

Method Details

copyData

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

View More Examples of copyData(WritableRaster raster)
   1:           p.setSourceSubsampling(sampleRate, sampleRate, 0, 0);
   2:           RenderedImage ri = r.readAsRenderedImage(0, p);
   3:           ColorModel cm = ri.getColorModel();
   4:         ...
   5:           WritableRaster ras = rast.createCompatibleWritableRaster();
   6:           ri.copyData(ras);
   7:           BufferedImage bi = new BufferedImage(cm, ras, false, null);
   8:           ImageIcon tn = new ImageIcon(bi);
   9:           if (tn != null) {

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5: 
   6:     private RenderedImage tiled;
   7: 
   8:         ...
   9: 
  10:         tiled.copyData(wr);
  11:         GraphicsUtil.coerceData(wr, tiled.getColorModel(), 

View Full Code Here
   1: import java.awt.image.BufferedImage;
   2: import java.awt.image.RenderedImage;
   3: 
   4:         ...
   5: 
   6:         RenderedImage red = filt.createDefaultRendering();
   7:         if(red == null)
   8:         ...
   9:                                               BufferedImage.TYPE_INT_ARGB);
  10:         red.copyData(img.getRaster());
  11:         return img;

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5:         try{
   6:             RenderedImage img = getSource();
   7: 
   8:         ...
   9:             srcWR = srcWR.createWritableTranslatedChild(minX, minY);
  10:             img.copyData(srcWR);

View Full Code Here
   1: import java.awt.image.ColorModel;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5: 
   6:         RenderedImage red = filt.createDefaultRendering();
   7:         if(red == null){
   8:         ...
   9:                                               BufferedImage.TYPE_INT_ARGB);
  10:         red.copyData(img.getRaster());

View Full Code Here

getColorModel

public ColorModel getColorModel()
Returns the ColorModel associated with this image. All Rasters returned from this image will have this as their ColorModel. This can return null.
Returns:
the ColorModel of this image.
Usages and Demos :

View More Examples of getColorModel()
   1: import jp.ujihara.java.awt.image.ColorModel;
   2: import jp.ujihara.java.awt.image.RenderedImage;
   3: import jp.ujihara.java.awt.image.SampleModel;
   4:         ...
   5: 
   6:   public ImageTypeSpecifier(RenderedImage image)
   7:   {
   8:         ...
   9:     
  10:     this.colorModel = image.getColorModel();
  11:     this.sampleModel = image.getSampleModel();

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5:     {
   6:       return image.getColorModel();
   7:     }
   8:         ...
   9: 
  10:   RenderedImage image;
  11: 
  12:         ...
  13: 
  14:   ImagePaint(RenderedImage i, AffineTransform t)

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5: 
   6:     private RenderedImage tiled;
   7: 
   8:         ...
   9: 
  10:         rasterCM = tiled.getColorModel();
  11:         if (rasterCM.hasAlpha()) {
  12:         ...
  13:         tiled.copyData(wr);
  14:         GraphicsUtil.coerceData(wr, tiled.getColorModel(), 

View Full Code Here
   1: import java.awt.image.IndexColorModel;
   2: import java.awt.image.RenderedImage;
   3: import java.util.Arrays;
   4:         ...
   5:         final GridCoverage2D visual = source.geophysics(false);
   6:         final RenderedImage  image  = visual.getRenderedImage();
   7:         final GridSampleDimension[] bands = visual.getSampleDimensions();
   8:         ...
   9:         final int visibleBand = CoverageUtilities.getVisibleBand(image);
  10:         ColorModel model = image.getColorModel();
  11:         boolean colorChanged = false;
  12:         ...
  13:             final ColorModel candidate = (i == visibleBand) ?
  14:                 image.getColorModel() : band.getColorModel();

View Full Code Here

getData

public Raster getData()
Returns the image as one large tile (for tile based images this will require fetching the whole image and copying the image data over). The Raster returned is a copy of the image data and will not be updated if the image is changed.
Returns:
the image as one large tile.
Usages and Demos :

View More Examples of getData()
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.IOException;
   4:         ...
   5:     public Raster decodeAsRaster(int page) throws IOException {
   6:         RenderedImage im = decodeAsRenderedImage(page);
   7:         ...
   8:         return im.getData();
   9:     }
  10:         ...
  11: 
  12:     public RenderedImage decodeAsRenderedImage() throws IOException {

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5:       float[] dest = new float[2];
   6:       Raster source = image.getData();
   7:       int minX = source.getMinX();
   8:         ...
   9:         {
  10:           Raster s = image.getData();
  11:           target = s.createCompatibleWritableRaster(w, h);
  12:         ...
  13: 
  14:   RenderedImage image;

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7:     private int width;
   8:         ...
   9: 
  10:     public void encode(RenderedImage im) throws IOException {
  11:         this.image = im;

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7:     private int width;
   8:         ...
   9: 
  10:     public void encode(RenderedImage im) throws IOException {
  11:         this.image = im;

View Full Code Here

getData

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

getHeight

public int getHeight()
Returns the height of the RenderedImage.
Returns:
the height of this RenderedImage.
Usages and Demos :

View More Examples of getHeight()
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5:         float scale = 100f/src.getWidth();
   6:         float yscale = 100f/src.getHeight();
   7: 
   8:         ...
   9:         rc = new RenderContext(at, rc.getRenderingHints());
  10:         RenderedImage histRI = getSource().createRendering(rc);
  11: 
  12:         ...
  13: 
  14:         int t = (int)(histRI.getWidth()*histRI.getHeight()*trim+0.5);

View Full Code Here
   1: 
   2:         RenderedImage decodedRenderedImage = null;
   3:         try{
   4:         ...
   5:             decodedImage = new BufferedImage(decodedRenderedImage.getWidth(),
   6:                                              decodedRenderedImage.getHeight(),
   7:                                              BufferedImage.TYPE_INT_ARGB);
   8:         ...
   9:            &&
  10:            imgA.getHeight() == imgB.getHeight()){
  11:             int w = imgA.getWidth();
  12:         ...
  13:             int h = imgA.getHeight();

View Full Code Here
   1: import java.awt.image.BufferedImage;
   2: import java.awt.image.RenderedImage;
   3: import javax.media.jai.ImageMIPMap;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:         double maxSize = Math.max(image.getWidth(), image.getHeight());
  11:         int logLevel = (int) (Math.log(MIN_SIZE / maxSize) / LOG_DOWN_SAMPLER);
  12:         ...
  13: 
  14:     private RenderedImage getGoodImage(RenderedImage img) {

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.renderable.ParameterBlock;
   4:         ...
   5: 
   6:     private RenderedImage rendered;
   7: 
   8:         ...
   9: 
  10:     public void setImage(RenderedImage image) {
  11:         if (image != null) {
  12:         ...
  13:             final float scale = Math.min(((float)renderedSize) / image.getWidth(),
  14:                                          ((float)renderedSize) / image.getHeight());

View Full Code Here
   1: import java.awt.image.BufferedImage;
   2: import java.awt.image.RenderedImage;
   3: 
   4:         ...
   5: 
   6:         RenderedImage red = filt.createDefaultRendering();
   7:         if(red == null)
   8:         ...
   9:         BufferedImage img = new BufferedImage(red.getWidth(),
  10:                                               red.getHeight(),
  11:                                               BufferedImage.TYPE_INT_ARGB);

View Full Code Here

getMinTileX

public int getMinTileX()
Returns the minimum tile index in the X direction.
Returns:
the minimum tile index in the X direction.

getMinTileY

public int getMinTileY()
Returns the minimum tile index in the Y direction.
Returns:
the minimum tile index in the X direction.

getMinX

public int getMinX()
Returns the minimum X coordinate (inclusive) of the RenderedImage.
Returns:
the X coordinate of this RenderedImage.
Usages and Demos :

View More Examples of getMinX()
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:     public ImageTableModel(final RenderedImage image) {
  11:         setRenderedImage(image);
  12:         ...
  13:         if (image != null) {
  14:             minX            = image.getMinX();

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.Serializable;
   4:         ...
   5:     public GeneralGridRange(final Raster raster) {
   6:         final int x = raster.getMinX();
   7:         final int y = raster.getMinY();
   8:         ...
   9:     
  10:     public GeneralGridRange(final RenderedImage image) {
  11:         this(image, 2);
  12:         ...
  13:     
  14:     GeneralGridRange(final RenderedImage image, final int dimension) {

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: 
   4:         ...
   5:     public GridRange(final Raster raster) {
   6:         final int x = raster.getMinX();
   7:         final int y = raster.getMinY();
   8:         ...
   9:     
  10:     public GridRange(final RenderedImage image) {
  11:         this(image, 2);
  12:         ...
  13:     
  14:     GridRange(final RenderedImage image, final int dimension) {

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5: 
   6:     RenderedImage  tile   = null;
   7:     WritableRaster raster = null;
   8:         ...
   9: 
  10:     public TileRed(RenderedImage tile,
  11:                    Rectangle tiledRegion) {
  12:         ...
  13:             raster = Raster.createWritableRaster
  14:                 (sm, new Point(tile.getMinX(), tile.getMinY()));

View Full Code Here
   1: import java.awt.image.BufferedImage;
   2: import java.awt.image.RenderedImage;
   3: import java.util.ArrayList;
   4:         ...
   5:     @Override
   6:     public ScoreAndConf computeScoreAndConfidence(final RenderedImage stillImage)
   7:         {
   8:         ...
   9: 
  10:         final int minX = stillImage.getMinX();
  11:         final int minY = stillImage.getMinY();

View Full Code Here

getMinY

public int getMinY()
Returns the minimum Y coordinate (inclusive) of the RenderedImage.
Returns:
the Y coordinate of this RenderedImage.
Usages and Demos :

View More Examples of getMinY()
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:     public ImageTableModel(final RenderedImage image) {
  11:         setRenderedImage(image);
  12:         ...
  13:             minX            = image.getMinX();
  14:             minY            = image.getMinY();

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.Serializable;
   4:         ...
   5:         final int x = raster.getMinX();
   6:         final int y = raster.getMinY();
   7:         index = new int[] {
   8:         ...
   9:     
  10:     public GeneralGridRange(final RenderedImage image) {
  11:         this(image, 2);
  12:         ...
  13:     
  14:     GeneralGridRange(final RenderedImage image, final int dimension) {

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: 
   4:         ...
   5:         final int x = raster.getMinX();
   6:         final int y = raster.getMinY();
   7:         index = new int[] {
   8:         ...
   9:     
  10:     public GridRange(final RenderedImage image) {
  11:         this(image, 2);
  12:         ...
  13:     
  14:     GridRange(final RenderedImage image, final int dimension) {

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5: 
   6:     RenderedImage  tile   = null;
   7:     WritableRaster raster = null;
   8:         ...
   9: 
  10:     public TileRed(RenderedImage tile,
  11:                    Rectangle tiledRegion) {
  12:         ...
  13:             raster = Raster.createWritableRaster
  14:                 (sm, new Point(tile.getMinX(), tile.getMinY()));

View Full Code Here
   1: import java.awt.image.BufferedImage;
   2: import java.awt.image.RenderedImage;
   3: import java.util.ArrayList;
   4:         ...
   5:     @Override
   6:     public ScoreAndConf computeScoreAndConfidence(final RenderedImage stillImage)
   7:         {
   8:         ...
   9:         final int minX = stillImage.getMinX();
  10:         final int minY = stillImage.getMinY();

View Full Code Here

getNumXTiles

public int getNumXTiles()
Returns the number of tiles in the X direction.
Returns:
the number of tiles in the X direction.
Usages and Demos :

View More Examples of getNumXTiles()
   1: 
   2: import java.awt.image.RenderedImage;
   3: 
   4:         ...
   5: 
   6:     public static TileStore getTileGrid(RenderedImage img, 
   7:                         TileGenerator src) {
   8:         ...
   9:         return new TileGrid(img.getMinTileX(),  img.getMinTileY(), 
  10:                             img.getNumXTiles(), img.getNumYTiles(), 
  11:                             src, cache);

View Full Code Here

getNumYTiles

public int getNumYTiles()
Returns the number of tiles in the Y direction.
Returns:
the number of tiles in the Y direction.
Usages and Demos :

View More Examples of getNumYTiles()
   1: 
   2: import java.awt.image.RenderedImage;
   3: 
   4:         ...
   5: 
   6:     public static TileStore getTileGrid(RenderedImage img, 
   7:                         TileGenerator src) {
   8:         ...
   9:         return new TileGrid(img.getMinTileX(),  img.getMinTileY(), 
  10:                             img.getNumXTiles(), img.getNumYTiles(), 
  11:                             src, cache);

View Full Code Here

getProperty

public Object getProperty(String name)
Gets a property from the property set of this image. The set of properties and whether it is immutable is determined by the implementing class. This method returns java.awt.Image.UndefinedProperty if the specified property is not defined for this RenderedImage.
Parameters:
name - the name of the property
Returns:
the property indicated by the specified name.
Usages and Demos :

View More Examples of getProperty(String name)
   1: 
   2: import java.awt.image.RenderedImage;
   3: 
   4:         ...
   5: 
   6:     public static boolean uses(final GridCoverage coverage, final RenderedImage image) {
   7:         if (coverage != null) {
   8:         ...
   9: 
  10:     public static int getVisibleBand(final RenderedImage image) {
  11:         ...
  12:         final Object candidate = image.getProperty("GC_VisibleBand");

View Full Code Here
   1: import java.awt.image.IndexColorModel;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5: 
   6:     public static BufferedImage convertRenderedImageToBufferedImage(final RenderedImage ri)
   7:         {
   8:         ...
   9:             for(int i = 0; i < keys.length; i++)
  10:                 { properties.put(keys[i], ri.getProperty(keys[i])); }
  11:             }

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5:         while (i.hasNext()) {
   6:             RenderedImage ri = (RenderedImage)i.next();
   7:         ...
   8:             ret = ri.getProperty(name);
   9:             if (ret != null) return ret;

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5:         while (i.hasNext()) {
   6:             RenderedImage ri = (RenderedImage)i.next();
   7:         ...
   8:             ret = ri.getProperty(name);
   9:             if (ret != null) return ret;

View Full Code Here
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.renderable.RenderableImage;
   4:         ...
   5:         final CoordinateReferenceSystem crs = CRSUtilities.getHorizontalCRS(this.crs);
   6:         final RenderedImage           image = getRenderableImage(time).createDefaultRendering();
   7:         final GridSampleDimension[]   bands = new GridSampleDimension[getNumSampleDimensions()];
   8:         ...
   9:         final MathTransform gridToCRS;
  10:         gridToCRS = ProjectiveTransform.create((AffineTransform) image.getProperty("gridToCRS"));
  11:         if (factory == null) {
  12:         ...
  13:         
  14:         public RenderedImage createDefaultRendering() {

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.
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.image.IndexColorModel;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.WritableRaster;
   4:         ...
   5: 
   6:     public static BufferedImage convertRenderedImageToBufferedImage(final RenderedImage ri)
   7:         {
   8:         ...
   9: 
  10:         final String[] keys = ri.getPropertyNames();
  11:         Hashtable<String, Object> properties = null;

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5:         while (i.hasNext()) {
   6:             RenderedImage ri = (RenderedImage)i.next();
   7:             ret = ri.getProperty(name);
   8:         ...
   9:             RenderedImage ri = (RenderedImage)iter.next();
  10:             String [] srcProps = ri.getPropertyNames();
  11:             if (srcProps.length != 0) {

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5:         while (i.hasNext()) {
   6:             RenderedImage ri = (RenderedImage)i.next();
   7:             ret = ri.getProperty(name);
   8:         ...
   9:             RenderedImage ri = (RenderedImage)iter.next();
  10:             String [] srcProps = ri.getPropertyNames();
  11:             if (srcProps.length != 0) {

View Full Code Here
   1: import java.awt.Image;
   2: import java.awt.image.RenderedImage;
   3: import javax.imageio.IIOException;
   4:         ...
   5:     
   6:     public synchronized void add(final RenderedImage image) throws AmbiguousPropertyException {
   7:         if (image instanceof PropertySource) {
   8:         ...
   9:         } else {
  10:             final String[] names = image.getPropertyNames();
  11:             if (names!=null) {
  12:         ...
  13:         final String[] names = (prefix!=null) ? properties.getPropertyNames(prefix) :
  14:                                                 properties.getPropertyNames();

View Full Code Here
   1: import java.awt.Image;
   2: import java.awt.image.RenderedImage;
   3: import java.io.BufferedReader;
   4:         ...
   5:     
   6:     public synchronized void add(final RenderedImage image) throws AmbiguousMetadataException {
   7:         if (image instanceof PropertySource) {
   8:         ...
   9:         } else {
  10:             final String[] names = image.getPropertyNames();
  11:             if (names!=null) {
  12:         ...
  13:         final String[] names = (prefix!=null) ? properties.getPropertyNames(prefix) :
  14:                                                 properties.getPropertyNames();

View Full Code Here

getSampleModel

public SampleModel getSampleModel()
Returns the SampleModel associated with this image. All Rasters returned from this image will have this as their SampleModel.
Returns:
the SampleModel of this image.
Usages and Demos :

View More Examples of getSampleModel()
   1:           p.setSourceSubsampling(sampleRate, sampleRate, 0, 0);
   2:           RenderedImage ri = r.readAsRenderedImage(0, p);
   3:           ColorModel cm = ri.getColorModel();
   4:         ...
   5:           SampleModel sm = ri.getSampleModel();
   6:           Raster rast = ri.getData();
   7:           WritableRaster ras = rast.createCompatibleWritableRaster();
   8:           ri.copyData(ras);

View Full Code Here
   1: import jp.ujihara.java.awt.image.ColorModel;
   2: import jp.ujihara.java.awt.image.RenderedImage;
   3: import jp.ujihara.java.awt.image.SampleModel;
   4:         ...
   5: 
   6:   public ImageTypeSpecifier(RenderedImage image)
   7:   {
   8:         ...
   9:     this.colorModel = image.getColorModel();
  10:     this.sampleModel = image.getSampleModel();
  11:   }

View Full Code Here
   1: import java.awt.RenderingHints;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.renderable.ParameterBlock;
   4:         ...
   5: 
   6:     public RenderedImage create(final ParameterBlock param,
   7:                                 final RenderingHints hints)
   8:         ...
   9:         }
  10:         final RenderedImage src0 = (RenderedImage) sources.get(0);
  11:         final RenderedImage src1 = (RenderedImage) sources.get(1);
  12:         ...
  13:         final int numBands0 = src0.getSampleModel().getNumBands();

View Full Code Here
   1: import java.awt.RenderingHints;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.renderable.ParameterBlock;
   4:         ...
   5: 
   6:     public RenderedImage create(final ParameterBlock param,
   7:                                 final RenderingHints hints)
   8:         ...
   9:         }
  10:         final RenderedImage src0 = (RenderedImage) sources.get(0);
  11:         final RenderedImage src1 = (RenderedImage) sources.get(1);
  12:         ...
  13:         final int numBands0 = src0.getSampleModel().getNumBands();

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.awt.image.RenderedImage;
   3: import java.io.File;
   4:         ...
   5:         final GeneralEnvelope envelope = new GeneralEnvelope(bounds);
   6:         final RenderedImage image = ImageIO.read(TestData.getResource(this,
   7:                 path));
   8:         ...
   9:         final int numBands = image.getSampleModel().getNumBands();
  10:         final GridSampleDimension[] bands = new GridSampleDimension[numBands];

View Full Code Here

getSources

public Vector getSources()
Returns a vector of RenderedImages that are the immediate sources of image data for this RenderedImage. This method returns null if the RenderedImage object has no information about its immediate sources. It returns an empty Vector if the RenderedImage object has no immediate sources.
Returns:
a Vector of RenderedImage objects.

getTile

public Raster getTile(int tileX,
                      int tileY)
Returns tile (tileX, tileY). Note that tileX and tileY are indices into the tile array, not pixel locations. The Raster that is returned is live and will be updated if the image is changed.
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:
the tile given the specified indices.
Usages and Demos :

View More Examples of getTile(int tileX,int tileY)
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:     public ImageTableModel(final RenderedImage image) {
  11:         setRenderedImage(image);
  12:         ...
  13:         int ty = y-tileGridYOffset; if (y<0) ty += 1-tileHeight;
  14:         return image.getTile(tx/tileWidth, ty/tileHeight);

View Full Code Here

getTileGridXOffset

public int getTileGridXOffset()
Returns the X offset of the tile grid relative to the origin, i.e., the X coordinate of the upper-left pixel of tile (0, 0). (Note that tile (0, 0) may not actually exist.)
Returns:
the X offset of the tile grid relative to the origin.
Usages and Demos :

View More Examples of getTileGridXOffset()
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:     public ImageTableModel(final RenderedImage image) {
  11:         setRenderedImage(image);
  12:         ...
  13:             maxY            = image.getHeight() + minY;
  14:             tileGridXOffset = image.getTileGridXOffset();

View Full Code Here

getTileGridYOffset

public int getTileGridYOffset()
Returns the Y offset of the tile grid relative to the origin, i.e., the Y coordinate of the upper-left pixel of tile (0, 0). (Note that tile (0, 0) may not actually exist.)
Returns:
the Y offset of the tile grid relative to the origin.
Usages and Demos :

View More Examples of getTileGridYOffset()
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:     public ImageTableModel(final RenderedImage image) {
  11:         setRenderedImage(image);
  12:         ...
  13:             tileGridXOffset = image.getTileGridXOffset();
  14:             tileGridYOffset = image.getTileGridYOffset();

View Full Code Here

getTileHeight

public int getTileHeight()
Returns the tile height in pixels. All tiles must have the same height.
Returns:
the tile height in pixels.
Usages and Demos :

View More Examples of getTileHeight()
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:     public ImageTableModel(final RenderedImage image) {
  11:         setRenderedImage(image);
  12:         ...
  13:             tileWidth       = image.getTileWidth();
  14:             tileHeight      = image.getTileHeight();

View Full Code Here
   1: import java.awt.image.IndexColorModel;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5: 
   6:     public static ImageLayout getImageLayout(final RenderedImage image) {
   7:         return getImageLayout(image, true);
   8:         ...
   9: 
  10:     private static ImageLayout getImageLayout(final RenderedImage image,
  11:             final boolean initToImage) {
  12:         ...
  13:         if ((image.getNumXTiles() == 1 || image.getTileWidth() <= STRIPE_SIZE)
  14:                 && (image.getNumYTiles() == 1 || image.getTileHeight() <= STRIPE_SIZE)) {

View Full Code Here

getTileWidth

public int getTileWidth()
Returns the tile width in pixels. All tiles must have the same width.
Returns:
the tile width in pixels.
Usages and Demos :

View More Examples of getTileWidth()
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:     public ImageTableModel(final RenderedImage image) {
  11:         setRenderedImage(image);
  12:         ...
  13:             tileGridYOffset = image.getTileGridYOffset();
  14:             tileWidth       = image.getTileWidth();

View Full Code Here
   1: import java.awt.image.IndexColorModel;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5: 
   6:     public static ImageLayout getImageLayout(final RenderedImage image) {
   7:         return getImageLayout(image, true);
   8:         ...
   9: 
  10:     private static ImageLayout getImageLayout(final RenderedImage image,
  11:             final boolean initToImage) {
  12:         ...
  13:         ImageLayout layout = initToImage ? new ImageLayout(image) : null;
  14:         if ((image.getNumXTiles() == 1 || image.getTileWidth() <= STRIPE_SIZE)

View Full Code Here

getWidth

public int getWidth()
Returns the width of the RenderedImage.
Returns:
the width of this RenderedImage.
Usages and Demos :

View More Examples of getWidth()
   1: import java.awt.geom.AffineTransform;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5:         
   6:         float scale = 100f/src.getWidth();
   7:         float yscale = 100f/src.getHeight();
   8:         ...
   9:         rc = new RenderContext(at, rc.getRenderingHints());
  10:         RenderedImage histRI = getSource().createRendering(rc);
  11: 
  12:         ...
  13: 
  14:         int t = (int)(histRI.getWidth()*histRI.getHeight()*trim+0.5);

View Full Code Here
   1: import java.awt.image.BufferedImage;
   2: import java.awt.image.RenderedImage;
   3: import javax.media.jai.ImageMIPMap;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:         double maxSize = Math.max(image.getWidth(), image.getHeight());
  11:         int logLevel = (int) (Math.log(MIN_SIZE / maxSize) / LOG_DOWN_SAMPLER);
  12:         ...
  13: 
  14:     private RenderedImage getGoodImage(RenderedImage img) {

View Full Code Here
   1: import java.awt.Rectangle;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.renderable.ParameterBlock;
   4:         ...
   5: 
   6:     private RenderedImage rendered;
   7: 
   8:         ...
   9: 
  10:     public void setImage(RenderedImage image) {
  11:         if (image != null) {
  12:         ...
  13:             final float scale = Math.min(((float)renderedSize) / image.getWidth(),

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private RenderedImage image;
   7: 
   8:         ...
   9: 
  10:     public ImageTableModel(final RenderedImage image) {
  11:         setRenderedImage(image);
  12:         ...
  13:             minY            = image.getMinY();
  14:             maxX            = image.getWidth()  + minX;

View Full Code Here
   1: import java.awt.image.Raster;
   2: import java.awt.image.RenderedImage;
   3: import java.awt.image.SampleModel;
   4:         ...
   5: 
   6:     RenderedImage  tile   = null;
   7:     WritableRaster raster = null;
   8:         ...
   9: 
  10:     public TileRed(RenderedImage tile,
  11:                    Rectangle tiledRegion) {
  12:         ...
  13:         this(tile, tiledRegion, tile.getWidth(), tile.getHeight(), null);

View Full Code Here