Class PdfSubByteSampleModel
java.lang.Object
java.awt.image.SampleModel
org.openpdf.renderer.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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate final intprivate final intprivate final int[]private final intprivate final intFields inherited from class SampleModel
dataType, height, numBands, width -
Constructor Summary
ConstructorsConstructorDescriptionPdfSubByteSampleModel(int w, int h, int numComponents, int bitsPerComponent) -
Method Summary
Modifier and TypeMethodDescriptioncreateCompatibleSampleModel(int w, int h) createSubsetSampleModel(int[] bands) private intgetComponent(DataBuffer data, int aBitIndex) getDataElements(int x, int y, Object obj, DataBuffer data) intintgetSample(int x, int y, int b, DataBuffer data) int[]intgetSampleSize(int band) voidsetDataElements(int x, int y, Object obj, DataBuffer data) voidsetSample(int x, int y, int b, int s, DataBuffer data) Methods inherited from class 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
-
Field Details
-
transferBytesPerPixel
private final int transferBytesPerPixel -
storageBitsPerPixel
private final int storageBitsPerPixel -
bitsPerLine
private final int bitsPerLine -
bitsPerBand
private final int bitsPerBand -
componentMask
private final int componentMask -
sampleSize
private final int[] sampleSize -
ignoredBitsPerComponentPerByte
private final int ignoredBitsPerComponentPerByte
-
-
Constructor Details
-
PdfSubByteSampleModel
public PdfSubByteSampleModel(int w, int h, int numComponents, int bitsPerComponent)
-
-
Method Details
-
getNumDataElements
public int getNumDataElements()- Specified by:
getNumDataElementsin classSampleModel
-
getDataElements
- Specified by:
getDataElementsin classSampleModel
-
getComponent
-
setDataElements
- Specified by:
setDataElementsin classSampleModel
-
getSample
- Specified by:
getSamplein classSampleModel
-
setSample
- Specified by:
setSamplein classSampleModel
-
createCompatibleSampleModel
- Specified by:
createCompatibleSampleModelin classSampleModel
-
createSubsetSampleModel
- Specified by:
createSubsetSampleModelin classSampleModel
-
createDataBuffer
- Specified by:
createDataBufferin classSampleModel
-
getSampleSize
public int[] getSampleSize()- Specified by:
getSampleSizein classSampleModel
-
getSampleSize
public int getSampleSize(int band) - Specified by:
getSampleSizein classSampleModel
-