public static class PixelFormat.PackedComposition extends Object implements PixelFormat.Composition
PixelFormat.Composition.
Components are interleaved, i.e. packed.
UNDEF| Constructor and Description |
|---|
PackedComposition(PixelFormat.CType[] componentOrder,
int[] componentMask,
int[] componentBitShift,
int bitStride) |
PackedComposition(PixelFormat.CType[] componentOrder,
int componentCount,
int bpc,
int bitStride) |
| Modifier and Type | Method and Description |
|---|---|
int |
bitsPerPixel()
Number of bits per pixel, e.g.
|
int |
bitStride()
Bit distance between pixels.
|
int |
bytesPerPixel()
Number of bytes per pixel, i.e.
|
int[] |
componentBitCount()
Returns the number of bits of all components, see
PixelFormat.Composition.componentBitMask(). |
int[] |
componentBitMask()
Returns the un-shifted bit-mask of all components.
|
int[] |
componentBitShift()
Returns the bit-shift of all components, see
PixelFormat.Composition.componentBitMask(). |
int |
componentCount()
Number of components per pixel, e.g.
|
PixelFormat.CType[] |
componentOrder()
Returns the
Component type order of all components, see PixelFormat.Composition.componentBitMask(). |
int |
decodeSingleI32(int shifted,
int cIdx)
Decodes a component from the shifted pixel data with a
PixelFormat.Composition.bytesPerPixel() of up to 32bit. |
int |
decodeSingleI64(long shifted,
int cIdx)
Decodes a component from the shifted pixel data with a
PixelFormat.Composition.bytesPerPixel() of up to 64bit. |
int |
defaultValue(int cIdx,
boolean shiftResult) |
int |
encode3CompI32(int c1NormI32,
int c2NormI32,
int c3NormI32) |
int |
encode3CompI8(byte c1NormI8,
byte c2NormI8,
byte c3NormI8) |
int |
encode4CompI32(int c1NormI32,
int c2NormI32,
int c3NormI32,
int c4NormI32) |
int |
encode4CompI8(byte c1NormI8,
byte c2NormI8,
byte c3NormI8,
byte c4NormI8) |
int |
encodeSingleI32(int norm,
int cIdx) |
long |
encodeSingleI64(int norm,
int cIdx) |
int |
encodeSingleI8(byte normI8,
int cIdx) |
boolean |
equals(Object obj)
Returns
Object.equals(Object) |
int |
find(PixelFormat.CType s)
Returns the index of given
PixelFormat.CType within PixelFormat.Composition.componentOrder(), -1 if not exists. |
int |
fromFloat(float f,
int cIdx,
boolean shiftResult) |
int |
hashCode()
Returns cached immutable hash value, see
Object.hashCode(). |
boolean |
isInterleaved()
Returns
true if all components are packed, i.e. |
boolean |
isUniform()
Returns
true if all components are of same bit-size, e.g. |
float |
toFloat(int i32,
int cIdx,
boolean i32Shifted) |
String |
toString()
Returns
Object.toString(). |
public PackedComposition(PixelFormat.CType[] componentOrder, int componentCount, int bpc, int bitStride)
componentOrder - Component type order of all components, see componentBitMask().componentCount - number of componentsbpc - bits per componentbitStride - stride bits to next pixelpublic PackedComposition(PixelFormat.CType[] componentOrder, int[] componentMask, int[] componentBitShift, int bitStride)
componentOrder - Component type order of all components, see componentBitMask().componentMask - bit-mask of of all components, see componentBitMask().componentBitShift - bit-shift of all components, see componentBitMask().bitStride - stride bits to next pixelpublic final String toString()
PixelFormat.CompositionObject.toString().toString in interface PixelFormat.CompositiontoString in class Objectpublic final boolean isUniform()
PixelFormat.CompositionisUniform in interface PixelFormat.Compositionpublic final boolean isInterleaved()
true if all components are packed, i.e. interleaved, e.g. RGBA8888,
otherwise false.
Instances of PixelFormat.PackedComposition returns true.
isInterleaved in interface PixelFormat.Compositionpublic final int componentCount()
PixelFormat.CompositionRGBx8888.componentCount in interface PixelFormat.Compositionpublic final int bitsPerPixel()
PixelFormat.CompositionRGBx8888.bitsPerPixel in interface PixelFormat.Compositionpublic final int bitStride()
PixelFormat.Composition
For packed pixels e.g. 32 bits for RGBx8888.
bitStride in interface PixelFormat.Compositionpublic final int bytesPerPixel()
PixelFormat.CompositionPixelFormat.Composition.bitStride() in bytes, e.g. 4 for RGBx8888.bytesPerPixel in interface PixelFormat.Compositionpublic final PixelFormat.CType[] componentOrder()
PixelFormat.CompositionComponent type order of all components, see PixelFormat.Composition.componentBitMask().componentOrder in interface PixelFormat.Compositionpublic final int find(PixelFormat.CType s)
PixelFormat.CompositionPixelFormat.CType within PixelFormat.Composition.componentOrder(), -1 if not exists.find in interface PixelFormat.Compositionpublic final int[] componentBitMask()
PixelFormat.CompositionComponents mask is returned in the order Low-Index to High-Index, e.g.:
componentBitMask in interface PixelFormat.Compositionpublic final int[] componentBitCount()
PixelFormat.CompositionPixelFormat.Composition.componentBitMask().componentBitCount in interface PixelFormat.Compositionpublic final int[] componentBitShift()
PixelFormat.CompositionPixelFormat.Composition.componentBitMask().componentBitShift in interface PixelFormat.Compositionpublic final int decodeSingleI32(int shifted,
int cIdx)
PixelFormat.CompositionPixelFormat.Composition.bytesPerPixel() of up to 32bit.decodeSingleI32 in interface PixelFormat.Compositionshifted - complete pixel encoded into on 32bit integercIdx - the desired component indexpublic final int decodeSingleI64(long shifted,
int cIdx)
PixelFormat.CompositionPixelFormat.Composition.bytesPerPixel() of up to 64bit.decodeSingleI64 in interface PixelFormat.Compositionshifted - complete pixel encoded into on 64bit integercIdx - the desired component indexpublic final int encodeSingleI32(int norm,
int cIdx)
encodeSingleI32 in interface PixelFormat.Compositionpublic final long encodeSingleI64(int norm,
int cIdx)
encodeSingleI64 in interface PixelFormat.Compositionpublic final int encode3CompI32(int c1NormI32,
int c2NormI32,
int c3NormI32)
encode3CompI32 in interface PixelFormat.Compositionpublic final int encode4CompI32(int c1NormI32,
int c2NormI32,
int c3NormI32,
int c4NormI32)
encode4CompI32 in interface PixelFormat.Compositionpublic final int encodeSingleI8(byte normI8,
int cIdx)
encodeSingleI8 in interface PixelFormat.Compositionpublic final int encode3CompI8(byte c1NormI8,
byte c2NormI8,
byte c3NormI8)
encode3CompI8 in interface PixelFormat.Compositionpublic final int encode4CompI8(byte c1NormI8,
byte c2NormI8,
byte c3NormI8,
byte c4NormI8)
encode4CompI8 in interface PixelFormat.Compositionpublic final float toFloat(int i32,
int cIdx,
boolean i32Shifted)
toFloat in interface PixelFormat.Compositionpublic final int fromFloat(float f,
int cIdx,
boolean shiftResult)
fromFloat in interface PixelFormat.Compositionpublic final int defaultValue(int cIdx,
boolean shiftResult)
defaultValue in interface PixelFormat.Compositionpublic final int hashCode()
PixelFormat.CompositionObject.hashCode().hashCode in interface PixelFormat.CompositionhashCode in class Objectpublic final boolean equals(Object obj)
PixelFormat.CompositionObject.equals(Object)equals in interface PixelFormat.Compositionequals in class ObjectCopyright 2010 JogAmp Community.