Package com.jogamp.nativewindow.util
Interface PixelFormat.Composition
-
- All Known Implementing Classes:
PixelFormat.PackedComposition
- Enclosing class:
- PixelFormat
public static interface PixelFormat.Composition
Pixel composition, i.e. layout of its components.
-
-
Field Summary
Fields Modifier and Type Field Description static int
UNDEF
-1
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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, seecomponentBitMask()
.int[]
componentBitMask()
Returns the un-shifted bit-mask of all components.int[]
componentBitShift()
Returns the bit-shift of all components, seecomponentBitMask()
.int
componentCount()
Number of components per pixel, e.g.PixelFormat.CType[]
componentOrder()
Returns theComponent type
order of all components, seecomponentBitMask()
.int
decodeSingleI32(int shifted, int cIdx)
Decodes a component from the shifted pixel data with abytesPerPixel()
of up to 32bit.int
decodeSingleI64(long shifted, int cIdx)
Decodes a component from the shifted pixel data with abytesPerPixel()
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 normalI8, int cIdx)
boolean
equals(Object o)
ReturnsObject.equals(Object)
int
find(PixelFormat.CType s)
Returns the index of givenPixelFormat.CType
withincomponentOrder()
, -1 if not exists.int
fromFloat(float f, int cIdx, boolean shiftResult)
int
hashCode()
Returns cached immutable hash value, seeObject.hashCode()
.boolean
isInterleaved()
Returnstrue
if all components are packed, i.e.boolean
isUniform()
Returnstrue
if all components are of same bit-size, e.g.float
toFloat(int i32, int cIdx, boolean i32Shifted)
String
toString()
ReturnsObject.toString()
.
-
-
-
Field Detail
-
UNDEF
static final int UNDEF
-1- See Also:
- Constant Field Values
-
-
Method Detail
-
isUniform
boolean isUniform()
-
isInterleaved
boolean isInterleaved()
-
componentCount
int componentCount()
Number of components per pixel, e.g. 3 forRGBx8888
.
-
bitsPerPixel
int bitsPerPixel()
Number of bits per pixel, e.g. 24 bits forRGBx8888
.
-
bitStride
int bitStride()
Bit distance between pixels.For packed pixels e.g. 32 bits for
RGBx8888
.
-
bytesPerPixel
int bytesPerPixel()
Number of bytes per pixel, i.e. packedbitStride()
in bytes, e.g. 4 forRGBx8888
.
-
componentOrder
PixelFormat.CType[] componentOrder()
Returns theComponent type
order of all components, seecomponentBitMask()
.
-
find
int find(PixelFormat.CType s)
Returns the index of givenPixelFormat.CType
withincomponentOrder()
, -1 if not exists.
-
componentBitMask
int[] componentBitMask()
-
componentBitCount
int[] componentBitCount()
Returns the number of bits of all components, seecomponentBitMask()
.
-
componentBitShift
int[] componentBitShift()
Returns the bit-shift of all components, seecomponentBitMask()
.
-
decodeSingleI32
int decodeSingleI32(int shifted, int cIdx)
Decodes a component from the shifted pixel data with abytesPerPixel()
of up to 32bit.- Parameters:
shifted
- complete pixel encoded into on 32bit integercIdx
- the desired component index- Returns:
- the decoded component value
-
decodeSingleI64
int decodeSingleI64(long shifted, int cIdx)
Decodes a component from the shifted pixel data with abytesPerPixel()
of up to 64bit.- Parameters:
shifted
- complete pixel encoded into on 64bit integercIdx
- the desired component index- Returns:
- the decoded component value
-
encodeSingleI32
int encodeSingleI32(int norm, int cIdx)
-
encodeSingleI64
long encodeSingleI64(int norm, int cIdx)
-
encode3CompI32
int encode3CompI32(int c1NormI32, int c2NormI32, int c3NormI32)
-
encode4CompI32
int encode4CompI32(int c1NormI32, int c2NormI32, int c3NormI32, int c4NormI32)
-
encodeSingleI8
int encodeSingleI8(byte normalI8, int cIdx)
-
encode3CompI8
int encode3CompI8(byte c1NormI8, byte c2NormI8, byte c3NormI8)
-
encode4CompI8
int encode4CompI8(byte c1NormI8, byte c2NormI8, byte c3NormI8, byte c4NormI8)
-
toFloat
float toFloat(int i32, int cIdx, boolean i32Shifted)
-
fromFloat
int fromFloat(float f, int cIdx, boolean shiftResult)
-
defaultValue
int defaultValue(int cIdx, boolean shiftResult)
-
hashCode
int hashCode()
Returns cached immutable hash value, seeObject.hashCode()
.
-
equals
boolean equals(Object o)
ReturnsObject.equals(Object)
-
toString
String toString()
ReturnsObject.toString()
.
-
-