public static class PixelFormat.PackedComposition extends Object implements PixelFormat.Composition
PixelFormat.Composition
.
Components are interleaved, i.e. packed.
UNDEF
Constructor and Description |
---|
PixelFormat.PackedComposition(PixelFormat.CType[] componentOrder,
int[] componentMask,
int[] componentBitShift,
int bitStride) |
PixelFormat.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 PixelFormat.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 PixelFormat.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.Composition
Object.toString()
.toString
in interface PixelFormat.Composition
toString
in class Object
public final boolean isUniform()
PixelFormat.Composition
isUniform
in interface PixelFormat.Composition
public 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.Composition
public final int componentCount()
PixelFormat.Composition
RGBx8888
.componentCount
in interface PixelFormat.Composition
public final int bitsPerPixel()
PixelFormat.Composition
RGBx8888
.bitsPerPixel
in interface PixelFormat.Composition
public final int bitStride()
PixelFormat.Composition
For packed pixels e.g. 32 bits for RGBx8888
.
bitStride
in interface PixelFormat.Composition
public final int bytesPerPixel()
PixelFormat.Composition
PixelFormat.Composition.bitStride()
in bytes, e.g. 4 for RGBx8888
.bytesPerPixel
in interface PixelFormat.Composition
public final PixelFormat.CType[] componentOrder()
PixelFormat.Composition
Component type
order of all components, see PixelFormat.Composition.componentBitMask()
.componentOrder
in interface PixelFormat.Composition
public final int find(PixelFormat.CType s)
PixelFormat.Composition
PixelFormat.CType
within PixelFormat.Composition.componentOrder()
, -1 if not exists.find
in interface PixelFormat.Composition
public final int[] componentBitMask()
PixelFormat.Composition
Components mask is returned in the order Low-Index to High-Index, e.g.:
componentBitMask
in interface PixelFormat.Composition
public final int[] componentBitCount()
PixelFormat.Composition
PixelFormat.Composition.componentBitMask()
.componentBitCount
in interface PixelFormat.Composition
public final int[] componentBitShift()
PixelFormat.Composition
PixelFormat.Composition.componentBitMask()
.componentBitShift
in interface PixelFormat.Composition
public final int decodeSingleI32(int shifted, int cIdx)
PixelFormat.Composition
PixelFormat.Composition.bytesPerPixel()
of up to 32bit.decodeSingleI32
in interface PixelFormat.Composition
shifted
- complete pixel encoded into on 32bit integercIdx
- the desired component indexpublic final int decodeSingleI64(long shifted, int cIdx)
PixelFormat.Composition
PixelFormat.Composition.bytesPerPixel()
of up to 64bit.decodeSingleI64
in interface PixelFormat.Composition
shifted
- complete pixel encoded into on 64bit integercIdx
- the desired component indexpublic final int encodeSingleI32(int norm, int cIdx)
encodeSingleI32
in interface PixelFormat.Composition
public final long encodeSingleI64(int norm, int cIdx)
encodeSingleI64
in interface PixelFormat.Composition
public final int encode3CompI32(int c1NormI32, int c2NormI32, int c3NormI32)
encode3CompI32
in interface PixelFormat.Composition
public final int encode4CompI32(int c1NormI32, int c2NormI32, int c3NormI32, int c4NormI32)
encode4CompI32
in interface PixelFormat.Composition
public final int encodeSingleI8(byte normI8, int cIdx)
encodeSingleI8
in interface PixelFormat.Composition
public final int encode3CompI8(byte c1NormI8, byte c2NormI8, byte c3NormI8)
encode3CompI8
in interface PixelFormat.Composition
public final int encode4CompI8(byte c1NormI8, byte c2NormI8, byte c3NormI8, byte c4NormI8)
encode4CompI8
in interface PixelFormat.Composition
public final float toFloat(int i32, int cIdx, boolean i32Shifted)
toFloat
in interface PixelFormat.Composition
public final int fromFloat(float f, int cIdx, boolean shiftResult)
fromFloat
in interface PixelFormat.Composition
public final int defaultValue(int cIdx, boolean shiftResult)
defaultValue
in interface PixelFormat.Composition
public final int hashCode()
PixelFormat.Composition
Object.hashCode()
.hashCode
in interface PixelFormat.Composition
hashCode
in class Object
public final boolean equals(Object obj)
PixelFormat.Composition
Object.equals(Object)
equals
in interface PixelFormat.Composition
equals
in class Object
Copyright 2010 JogAmp Community.