JAIUtils Class Reference

List of all members.

Static Public Member Functions

static TiledImage createWritableBuffer (int width, int height)
 Creates an alpha channel to write translucent images to.
static TiledImage createWritableBufferWithoutAlpha (int width, int height)
 Even without an alpha channel, you can do alpha compositing! However, it won't work well if you want a transparent background for PNGs.
static PlanarImage createZeroImage (int width, int height, int numBands)
 Create a black image with the given width, height, and color depth (use 3 for an RGB image, 4 for RGBA).
static PlanarImage readJPEG (final File jpegFile)
static PlanarImage scaleImage (PlanarImage src, InterpolationQuality interpQuality, float scaleFactorX, float scaleFactorY)
 performs a JAI scaling of the PlanarImage with appropriate scale factors
static PlanarImage scaleImageIteratively (PlanarImage src, float scaleFactorX, float scaleFactorY)
static PlanarImage scaleImageIteratively (PlanarImage src, InterpolationQuality interpQuality, float scaleFactorX, float scaleFactorY)
 Higher quality, but slower implementation.
static PlanarImage scaleImageToFit (PlanarImage src, int width, int height)
 scale the image to best fit into a rectangle of size width x height
static PlanarImage scaleImageToSize (PlanarImage src, int targetWidth, int targetHeight, InterpolationQuality quality, boolean maintainAspectRatio)
 the targets are hints.
static void writeImageToJPEG (PlanarImage img, File path)
 Writes a PlanarImage to a file, specified by the String (absolute path).

Detailed Description

This software is distributed under the BSD License.

Author:
Ron B Yeh (ronyeh(AT)cs.stanford.edu)

Definition at line 32 of file JAIUtils.java.


Member Function Documentation

static TiledImage createWritableBuffer ( int  width,
int  height 
) [static]

Creates an alpha channel to write translucent images to.

Parameters:
width 
height 
Returns:
a buffer that you can get a Graphics2D context from, and write to!

Definition at line 47 of file JAIUtils.java.

Referenced by JAIUtils.createWritableBufferWithoutAlpha().

static TiledImage createWritableBufferWithoutAlpha ( int  width,
int  height 
) [static]

Even without an alpha channel, you can do alpha compositing! However, it won't work well if you want a transparent background for PNGs.

Parameters:
width 
height 
Returns:

Definition at line 88 of file JAIUtils.java.

References JAIUtils.createWritableBuffer().

static PlanarImage createZeroImage ( int  width,
int  height,
int  numBands 
) [static]

Create a black image with the given width, height, and color depth (use 3 for an RGB image, 4 for RGBA).

Parameters:
width 
height 
numBands 
Returns:

Definition at line 101 of file JAIUtils.java.

static PlanarImage readJPEG ( final File  jpegFile  )  [static]

Parameters:
jpegFile 
Returns:
a PlanarImage read from a File object.

Definition at line 117 of file JAIUtils.java.

static PlanarImage scaleImage ( PlanarImage  src,
InterpolationQuality  interpQuality,
float  scaleFactorX,
float  scaleFactorY 
) [static]

performs a JAI scaling of the PlanarImage with appropriate scale factors

Parameters:
src 
interpQuality 
scaleFactorX 
scaleFactorY 
Returns:

Definition at line 130 of file JAIUtils.java.

static PlanarImage scaleImageIteratively ( PlanarImage  src,
InterpolationQuality  interpQuality,
float  scaleFactorX,
float  scaleFactorY 
) [static]

Higher quality, but slower implementation.

..

Parameters:
src 
interpQuality 
scaleFactorX 
scaleFactorY 
Returns:

Definition at line 162 of file JAIUtils.java.

static PlanarImage scaleImageToFit ( PlanarImage  src,
int  width,
int  height 
) [static]

scale the image to best fit into a rectangle of size width x height

defaults to good (but slower) scaling

Parameters:
src 
width 
height 
Returns:
Author:
Ron Yeh

Definition at line 200 of file JAIUtils.java.

References JAIUtils.scaleImageToSize().

static PlanarImage scaleImageToSize ( PlanarImage  src,
int  targetWidth,
int  targetHeight,
InterpolationQuality  quality,
boolean  maintainAspectRatio 
) [static]

the targets are hints.

.. to tell us what box the src should fit within

Parameters:
src 
targetWidth 
targetHeight 
quality 
maintainAspectRatio 
Returns:

Definition at line 214 of file JAIUtils.java.

References JAIUtils.scaleImageIteratively().

Referenced by JAIUtils.scaleImageToFit().

static void writeImageToJPEG ( PlanarImage  img,
File  path 
) [static]

Writes a PlanarImage to a file, specified by the String (absolute path).

Parameters:
img 
quality [0 to 100]
path 

Definition at line 246 of file JAIUtils.java.


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:46 2007 for R3 Paper Toolkit by  doxygen 1.4.7