< prev index next >
src/java.desktop/share/classes/java/awt/image/LookupOp.java
Print this page
*** 79,129 ****
private LookupTable ltable;
private int numComponents;
RenderingHints hints;
/**
! * Constructs a <code>LookupOp</code> object given the lookup
! * table and a <code>RenderingHints</code> object, which might
! * be <code>null</code>.
! * @param lookup the specified <code>LookupTable</code>
! * @param hints the specified <code>RenderingHints</code>,
! * or <code>null</code>
*/
public LookupOp(LookupTable lookup, RenderingHints hints) {
this.ltable = lookup;
this.hints = hints;
numComponents = ltable.getNumComponents();
}
/**
! * Returns the <code>LookupTable</code>.
! * @return the <code>LookupTable</code> of this
! * <code>LookupOp</code>.
*/
public final LookupTable getTable() {
return ltable;
}
/**
! * Performs a lookup operation on a <code>BufferedImage</code>.
* If the color model in the source image is not the same as that
* in the destination image, the pixels will be converted
! * in the destination. If the destination image is <code>null</code>,
! * a <code>BufferedImage</code> will be created with an appropriate
! * <code>ColorModel</code>. An <code>IllegalArgumentException</code>
* might be thrown if the number of arrays in the
! * <code>LookupTable</code> does not meet the restrictions
* stated in the class comment above, or if the source image
! * has an <code>IndexColorModel</code>.
! * @param src the <code>BufferedImage</code> to be filtered
! * @param dst the <code>BufferedImage</code> in which to
* store the results of the filter operation
! * @return the filtered <code>BufferedImage</code>.
* @throws IllegalArgumentException if the number of arrays in the
! * <code>LookupTable</code> does not meet the restrictions
* described in the class comments, or if the source image
! * has an <code>IndexColorModel</code>.
*/
public final BufferedImage filter(BufferedImage src, BufferedImage dst) {
ColorModel srcCM = src.getColorModel();
int numBands = srcCM.getNumColorComponents();
ColorModel dstCM;
--- 79,129 ----
private LookupTable ltable;
private int numComponents;
RenderingHints hints;
/**
! * Constructs a {@code LookupOp} object given the lookup
! * table and a {@code RenderingHints} object, which might
! * be {@code null}.
! * @param lookup the specified {@code LookupTable}
! * @param hints the specified {@code RenderingHints},
! * or {@code null}
*/
public LookupOp(LookupTable lookup, RenderingHints hints) {
this.ltable = lookup;
this.hints = hints;
numComponents = ltable.getNumComponents();
}
/**
! * Returns the {@code LookupTable}.
! * @return the {@code LookupTable} of this
! * {@code LookupOp}.
*/
public final LookupTable getTable() {
return ltable;
}
/**
! * Performs a lookup operation on a {@code BufferedImage}.
* If the color model in the source image is not the same as that
* in the destination image, the pixels will be converted
! * in the destination. If the destination image is {@code null},
! * a {@code BufferedImage} will be created with an appropriate
! * {@code ColorModel}. An {@code IllegalArgumentException}
* might be thrown if the number of arrays in the
! * {@code LookupTable} does not meet the restrictions
* stated in the class comment above, or if the source image
! * has an {@code IndexColorModel}.
! * @param src the {@code BufferedImage} to be filtered
! * @param dst the {@code BufferedImage} in which to
* store the results of the filter operation
! * @return the filtered {@code BufferedImage}.
* @throws IllegalArgumentException if the number of arrays in the
! * {@code LookupTable} does not meet the restrictions
* described in the class comments, or if the source image
! * has an {@code IndexColorModel}.
*/
public final BufferedImage filter(BufferedImage src, BufferedImage dst) {
ColorModel srcCM = src.getColorModel();
int numBands = srcCM.getNumColorComponents();
ColorModel dstCM;
*** 230,255 ****
return origDst;
}
/**
! * Performs a lookup operation on a <code>Raster</code>.
! * If the destination <code>Raster</code> is <code>null</code>,
! * a new <code>Raster</code> will be created.
! * The <code>IllegalArgumentException</code> might be thrown
! * if the source <code>Raster</code> and the destination
! * <code>Raster</code> do not have the same
* number of bands or if the number of arrays in the
! * <code>LookupTable</code> does not meet the
* restrictions stated in the class comment above.
! * @param src the source <code>Raster</code> to filter
! * @param dst the destination <code>WritableRaster</code> for the
! * filtered <code>src</code>
! * @return the filtered <code>WritableRaster</code>.
* @throws IllegalArgumentException if the source and destinations
* rasters do not have the same number of bands, or the
! * number of arrays in the <code>LookupTable</code> does
* not meet the restrictions described in the class comments.
*
*/
public final WritableRaster filter (Raster src, WritableRaster dst) {
int numBands = src.getNumBands();
--- 230,255 ----
return origDst;
}
/**
! * Performs a lookup operation on a {@code Raster}.
! * If the destination {@code Raster} is {@code null},
! * a new {@code Raster} will be created.
! * The {@code IllegalArgumentException} might be thrown
! * if the source {@code Raster} and the destination
! * {@code Raster} do not have the same
* number of bands or if the number of arrays in the
! * {@code LookupTable} does not meet the
* restrictions stated in the class comment above.
! * @param src the source {@code Raster} to filter
! * @param dst the destination {@code WritableRaster} for the
! * filtered {@code src}
! * @return the filtered {@code WritableRaster}.
* @throws IllegalArgumentException if the source and destinations
* rasters do not have the same number of bands, or the
! * number of arrays in the {@code LookupTable} does
* not meet the restrictions described in the class comments.
*
*/
public final WritableRaster filter (Raster src, WritableRaster dst) {
int numBands = src.getNumBands();
*** 328,364 ****
/**
* Returns the bounding box of the filtered destination image. Since
* this is not a geometric operation, the bounding box does not
* change.
! * @param src the <code>BufferedImage</code> to be filtered
* @return the bounds of the filtered definition image.
*/
public final Rectangle2D getBounds2D (BufferedImage src) {
return getBounds2D(src.getRaster());
}
/**
* Returns the bounding box of the filtered destination Raster. Since
* this is not a geometric operation, the bounding box does not
* change.
! * @param src the <code>Raster</code> to be filtered
! * @return the bounds of the filtered definition <code>Raster</code>.
*/
public final Rectangle2D getBounds2D (Raster src) {
return src.getBounds();
}
/**
* Creates a zeroed destination image with the correct size and number of
! * bands. If destCM is <code>null</code>, an appropriate
! * <code>ColorModel</code> will be used.
* @param src Source image for the filter operation.
! * @param destCM the destination's <code>ColorModel</code>, which
! * can be <code>null</code>.
! * @return a filtered destination <code>BufferedImage</code>.
*/
public BufferedImage createCompatibleDestImage (BufferedImage src,
ColorModel destCM) {
BufferedImage image;
int w = src.getWidth();
--- 328,364 ----
/**
* Returns the bounding box of the filtered destination image. Since
* this is not a geometric operation, the bounding box does not
* change.
! * @param src the {@code BufferedImage} to be filtered
* @return the bounds of the filtered definition image.
*/
public final Rectangle2D getBounds2D (BufferedImage src) {
return getBounds2D(src.getRaster());
}
/**
* Returns the bounding box of the filtered destination Raster. Since
* this is not a geometric operation, the bounding box does not
* change.
! * @param src the {@code Raster} to be filtered
! * @return the bounds of the filtered definition {@code Raster}.
*/
public final Rectangle2D getBounds2D (Raster src) {
return src.getBounds();
}
/**
* Creates a zeroed destination image with the correct size and number of
! * bands. If destCM is {@code null}, an appropriate
! * {@code ColorModel} will be used.
* @param src Source image for the filter operation.
! * @param destCM the destination's {@code ColorModel}, which
! * can be {@code null}.
! * @return a filtered destination {@code BufferedImage}.
*/
public BufferedImage createCompatibleDestImage (BufferedImage src,
ColorModel destCM) {
BufferedImage image;
int w = src.getWidth();
*** 431,460 ****
return image;
}
/**
! * Creates a zeroed-destination <code>Raster</code> with the
* correct size and number of bands, given this source.
! * @param src the <code>Raster</code> to be transformed
! * @return the zeroed-destination <code>Raster</code>.
*/
public WritableRaster createCompatibleDestRaster (Raster src) {
return src.createCompatibleWritableRaster();
}
/**
* Returns the location of the destination point given a
! * point in the source. If <code>dstPt</code> is not
! * <code>null</code>, it will be used to hold the return value.
! * Since this is not a geometric operation, the <code>srcPt</code>
! * will equal the <code>dstPt</code>.
! * @param srcPt a <code>Point2D</code> that represents a point
* in the source image
! * @param dstPt a <code>Point2D</code>that represents the location
* in the destination
! * @return the <code>Point2D</code> in the destination that
* corresponds to the specified point in the source.
*/
public final Point2D getPoint2D (Point2D srcPt, Point2D dstPt) {
if (dstPt == null) {
dstPt = new Point2D.Float();
--- 431,460 ----
return image;
}
/**
! * Creates a zeroed-destination {@code Raster} with the
* correct size and number of bands, given this source.
! * @param src the {@code Raster} to be transformed
! * @return the zeroed-destination {@code Raster}.
*/
public WritableRaster createCompatibleDestRaster (Raster src) {
return src.createCompatibleWritableRaster();
}
/**
* Returns the location of the destination point given a
! * point in the source. If {@code dstPt} is not
! * {@code null}, it will be used to hold the return value.
! * Since this is not a geometric operation, the {@code srcPt}
! * will equal the {@code dstPt}.
! * @param srcPt a {@code Point2D} that represents a point
* in the source image
! * @param dstPt a {@code Point2D} that represents the location
* in the destination
! * @return the {@code Point2D} in the destination that
* corresponds to the specified point in the source.
*/
public final Point2D getPoint2D (Point2D srcPt, Point2D dstPt) {
if (dstPt == null) {
dstPt = new Point2D.Float();
*** 464,474 ****
return dstPt;
}
/**
* Returns the rendering hints for this op.
! * @return the <code>RenderingHints</code> object associated
* with this op.
*/
public final RenderingHints getRenderingHints() {
return hints;
}
--- 464,474 ----
return dstPt;
}
/**
* Returns the rendering hints for this op.
! * @return the {@code RenderingHints} object associated
* with this op.
*/
public final RenderingHints getRenderingHints() {
return hints;
}
< prev index next >