com.crionics.jpdf.graphic
Class ImageJPEG

java.lang.Object
  extended by com.crionics.jpdf.graphic.AbstractImage
      extended by com.crionics.jpdf.graphic.ImageJPEG

public class ImageJPEG
extends AbstractImage

This Class allows to load and Process an JPEG Image before its insertion in a PDF Document.
Note: The Codecs used to access the image are the one provided by the Java API.


Field Summary
 
Fields inherited from class com.crionics.jpdf.graphic.AbstractImage
FLIP_NONE, FLIP_X, FLIP_XY, FLIP_Y, SCALE_MODEL_AVERAGE, SCALE_MODEL_FAST, SCALE_MODEL_SMOOTH, TYPE_GENERIC, TYPE_JPEG
 
Constructor Summary
ImageJPEG(java.awt.image.BufferedImage img)
           
 
Method Summary
 int getType()
           
 void setQuality(float q)
          Sets the Encoding Quality Factor for the JPEG.
 void writeToStream(java.io.OutputStream outStream)
          Writes the content of the image in the specified OutputStream.
 
Methods inherited from class com.crionics.jpdf.graphic.AbstractImage
convertTo, ensureHasAlphaChannel, flip, flush, getHeight, getImage, getImageTransformed, getImageTransformed, getWidth, scale
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageJPEG

public ImageJPEG(java.awt.image.BufferedImage img)
Method Detail

getType

public int getType()
Specified by:
getType in class AbstractImage

setQuality

public void setQuality(float q)
                throws PdfException
Sets the Encoding Quality Factor for the JPEG.
Note:
By default the Quality Factor is set to 1.0 (100%)

Parameters:
qualityFactor - The Quality Factor to set during the encoding of the image (from 0.0 to 1.0).
Throws:
PdfException - If the qualityFactor supplied is out of range.

writeToStream

public void writeToStream(java.io.OutputStream outStream)
                   throws java.io.IOException
Description copied from class: AbstractImage
Writes the content of the image in the specified OutputStream.

Specified by:
writeToStream in class AbstractImage
Parameters:
outStream - The OuputStream where to write the image
Throws:
java.io.IOException - If an error occurs while accessing the stream.


Copyright © 1999-2007 Crionics. All Rights Reserved.