com.sun.pdfview
Class PdfSubByteSampleModel

java.lang.Object
  extended by java.awt.image.SampleModel
      extended by com.sun.pdfview.PdfSubByteSampleModel

public class PdfSubByteSampleModel
extends java.awt.image.SampleModel

Provides a read-only sample-model where components are less than a byte in width while allowing for pixels to cross byte-boundaries. For example, this allows 2 pixels made of 3 4-bit-bands (p[pixel,band]) to be stored in 3 bytes as p[0,1] p[0,2] | p[0,3] p[1,0] | p[1,1] p[1,2]. MultiPixelPackedSampleModel, which allows for sub-byte components, does not allow for such byte spanning, while the PDF specification does permit it -- hence the existence of this class.


Field Summary
 
Fields inherited from class java.awt.image.SampleModel
dataType, height, numBands, width
 
Constructor Summary
PdfSubByteSampleModel(int w, int h, int numComponents, int bitsPerComponent)
           
 
Method Summary
 java.awt.image.SampleModel createCompatibleSampleModel(int w, int h)
           
 java.awt.image.DataBuffer createDataBuffer()
           
 java.awt.image.SampleModel createSubsetSampleModel(int[] bands)
           
 java.lang.Object getDataElements(int x, int y, java.lang.Object obj, java.awt.image.DataBuffer data)
           
 int getNumDataElements()
           
 int getSample(int x, int y, int b, java.awt.image.DataBuffer data)
           
 int[] getSampleSize()
           
 int getSampleSize(int band)
           
 void setDataElements(int x, int y, java.lang.Object obj, java.awt.image.DataBuffer data)
           
 void setSample(int x, int y, int b, int s, java.awt.image.DataBuffer data)
           
 
Methods inherited from class java.awt.image.SampleModel
getDataElements, getDataType, getHeight, getNumBands, getPixel, getPixel, getPixel, getPixels, getPixels, getPixels, getSampleDouble, getSampleFloat, getSamples, getSamples, getSamples, getTransferType, getWidth, setDataElements, setPixel, setPixel, setPixel, setPixels, setPixels, setPixels, setSample, setSample, setSamples, setSamples, setSamples
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdfSubByteSampleModel

public PdfSubByteSampleModel(int w,
                             int h,
                             int numComponents,
                             int bitsPerComponent)
Method Detail

getNumDataElements

public int getNumDataElements()
Specified by:
getNumDataElements in class java.awt.image.SampleModel

getDataElements

public java.lang.Object getDataElements(int x,
                                        int y,
                                        java.lang.Object obj,
                                        java.awt.image.DataBuffer data)
Specified by:
getDataElements in class java.awt.image.SampleModel

setDataElements

public void setDataElements(int x,
                            int y,
                            java.lang.Object obj,
                            java.awt.image.DataBuffer data)
Specified by:
setDataElements in class java.awt.image.SampleModel

getSample

public int getSample(int x,
                     int y,
                     int b,
                     java.awt.image.DataBuffer data)
Specified by:
getSample in class java.awt.image.SampleModel

setSample

public void setSample(int x,
                      int y,
                      int b,
                      int s,
                      java.awt.image.DataBuffer data)
Specified by:
setSample in class java.awt.image.SampleModel

createCompatibleSampleModel

public java.awt.image.SampleModel createCompatibleSampleModel(int w,
                                                              int h)
Specified by:
createCompatibleSampleModel in class java.awt.image.SampleModel

createSubsetSampleModel

public java.awt.image.SampleModel createSubsetSampleModel(int[] bands)
Specified by:
createSubsetSampleModel in class java.awt.image.SampleModel

createDataBuffer

public java.awt.image.DataBuffer createDataBuffer()
Specified by:
createDataBuffer in class java.awt.image.SampleModel

getSampleSize

public int[] getSampleSize()
Specified by:
getSampleSize in class java.awt.image.SampleModel

getSampleSize

public int getSampleSize(int band)
Specified by:
getSampleSize in class java.awt.image.SampleModel