Package org.apache.commons.imaging.formats.tiff.photometricinterpreters

# Class PhotometricInterpreterYCbCr

java.lang.Object
org.apache.commons.imaging.formats.tiff.photometricinterpreters.AbstractPhotometricInterpreter
org.apache.commons.imaging.formats.tiff.photometricinterpreters.PhotometricInterpreterYCbCr

public class PhotometricInterpreterYCbCr extends AbstractPhotometricInterpreter

- ## Field Summary

  ### Fields inherited from class org.apache.commons.imaging.formats.tiff.photometricinterpreters.AbstractPhotometricInterpreter

  `height, predictor, samplesPerPixel, width`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PhotometricInterpreterYCbCr(int samplesPerPixel, int[] bitsPerSample, int predictor, int width, int height)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static int`
  `convertYCbCrtoRGB(int y, int cb, int cr)`
  This method converts a YUV (aka YCbCr) colorspace to a RGB colorspace.
  `void`
  `interpretPixel(ImageBuilder imageBuilder, int[] samples, int x, int y)`
  `static int`
  `limit(int value, int min, int max)`

  ### Methods inherited from class org.apache.commons.imaging.formats.tiff.photometricinterpreters.AbstractPhotometricInterpreter

  `getBitsPerSample`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PhotometricInterpreterYCbCr

    public PhotometricInterpreterYCbCr(int samplesPerPixel, int[] bitsPerSample, int predictor, int width, int height)

- ## Method Details

  - ### convertYCbCrtoRGB

    public static 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.

  - ### limit

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

  - ### interpretPixel

    public void interpretPixel(ImageBuilder imageBuilder, int[] samples, int x, int y) throws ImagingException, IOException
    Specified by:
      `interpretPixel` in class `AbstractPhotometricInterpreter`
    Throws:
      `ImagingException`
      `IOException`