org.apache.sanselan.formats.tiff.photometricinterpreters
Class PhotometricInterpreterYCbCr

java.lang.Object
  extended by org.apache.sanselan.formats.tiff.photometricinterpreters.PhotometricInterpreter
      extended by org.apache.sanselan.formats.tiff.photometricinterpreters.PhotometricInterpreterYCbCr

public class PhotometricInterpreterYCbCr
extends PhotometricInterpreter


Field Summary
 
Fields inherited from class org.apache.sanselan.formats.tiff.photometricinterpreters.PhotometricInterpreter
bitsPerSample, height, predictor, samplesPerPixel, width
 
Constructor Summary
PhotometricInterpreterYCbCr(double[] fYCbCrCoefficients, int[] fYCbCrPositioning, int[] fYCbCrSubSampling, double[] fReferenceBlackWhite, int fSamplesPerPixel, int[] fBitsPerSample, int Predictor, int width, int height)
           
 
Method Summary
 int convertYCbCrtoRGB(int Y, int Cb, int Cr)
          This method converts a YUV (aka YCbCr) colorspace to a RGB colorspace.
 void interpretPixel(java.awt.image.BufferedImage bi, int[] samples, int x, int y)
           
 int limit(int value, int min, int max)
           
 
Methods inherited from class org.apache.sanselan.formats.tiff.photometricinterpreters.PhotometricInterpreter
dumpstats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhotometricInterpreterYCbCr

public PhotometricInterpreterYCbCr(double[] fYCbCrCoefficients,
                                   int[] fYCbCrPositioning,
                                   int[] fYCbCrSubSampling,
                                   double[] fReferenceBlackWhite,
                                   int fSamplesPerPixel,
                                   int[] fBitsPerSample,
                                   int Predictor,
                                   int width,
                                   int height)
Method Detail

limit

public int limit(int value,
                 int min,
                 int max)

convertYCbCrtoRGB

public int convertYCbCrtoRGB(int Y,
                             int Cb,
                             int Cr)
This method converts a YUV (aka YCbCr) colorspace to a RGB colorspace. This is handy when trying to reconstruct an image in Java from YCbCr transmitted data. This routine expects the data to fall in the standard PC 0..255 range per pixel, with the array dimensions corresponding to the imageWidth and imageHeight. These variables are either set manually in the case of a null constructor, or they are automatically calculated from the image parameter constructor.

Parameters:
Y - The Y component set.
Cb - The Cb component set.
Cr - The Cr component set.
Returns:
R The R component.

interpretPixel

public void interpretPixel(java.awt.image.BufferedImage bi,
                           int[] samples,
                           int x,
                           int y)
                    throws ImageReadException,
                           java.io.IOException
Specified by:
interpretPixel in class PhotometricInterpreter
Throws:
ImageReadException
java.io.IOException


Copyright © 2007-2009. All Rights Reserved.