Package org.loboevolution.pdfview
Class PdfSubByteSampleModel
java.lang.Object
java.awt.image.SampleModel
org.loboevolution.pdfview.PdfSubByteSampleModel
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.
Author Luke Kirby, Pirion Systems
-
Field Summary
Fields inherited from class java.awt.image.SampleModel
dataType, height, numBands, width
-
Constructor Summary
ConstructorDescriptionPdfSubByteSampleModel
(int w, int h, int numComponents, int bitsPerComponent) Constructor for PdfSubByteSampleModel. -
Method Summary
Modifier and TypeMethodDescriptioncreateCompatibleSampleModel
(int w, int h) createSubsetSampleModel
(int[] bands) getDataElements
(int x, int y, Object obj, DataBuffer data) int
int
getSample
(int x, int y, int b, DataBuffer data) int[]
int
getSampleSize
(int band) void
setDataElements
(int x, int y, Object obj, DataBuffer data) void
setSample
(int x, int y, int b, int s, 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
-
Constructor Details
-
Method Details
-
getNumDataElements
public int getNumDataElements()- Specified by:
getNumDataElements
in classSampleModel
-
getDataElements
- Specified by:
getDataElements
in classSampleModel
-
setDataElements
- Specified by:
setDataElements
in classSampleModel
-
getSample
- Specified by:
getSample
in classSampleModel
-
setSample
- Specified by:
setSample
in classSampleModel
-
createCompatibleSampleModel
- Specified by:
createCompatibleSampleModel
in classSampleModel
-
createSubsetSampleModel
- Specified by:
createSubsetSampleModel
in classSampleModel
-
createDataBuffer
- Specified by:
createDataBuffer
in classSampleModel
-
getSampleSize
public int[] getSampleSize()- Specified by:
getSampleSize
in classSampleModel
-
getSampleSize
public int getSampleSize(int band) - Specified by:
getSampleSize
in classSampleModel
-