Package com.jogamp.nativewindow.util
Class PixelFormat.PackedComposition
java.lang.Object
com.jogamp.nativewindow.util.PixelFormat.PackedComposition
- All Implemented Interfaces:
PixelFormat.Composition
- Enclosing class:
- PixelFormat
Packed pixel composition, see
PixelFormat.Composition.
Components are interleaved, i.e. packed.
-
Field Summary
Fields inherited from interface com.jogamp.nativewindow.util.PixelFormat.Composition
UNDEF -
Constructor Summary
ConstructorsConstructorDescriptionPackedComposition(PixelFormat.CType[] componentOrder, int[] componentMask, int[] componentBitShift, int bitStride) PackedComposition(PixelFormat.CType[] componentOrder, int componentCount, int bpc, int bitStride) -
Method Summary
Modifier and TypeMethodDescriptionfinal intNumber of bits per pixel, e.g.final intBit distance between pixels.final intNumber of bytes per pixel, i.e.final int[]Returns the number of bits of all components, seePixelFormat.Composition.componentBitMask().final int[]Returns the un-shifted bit-mask of all components.final int[]Returns the bit-shift of all components, seePixelFormat.Composition.componentBitMask().final intNumber of components per pixel, e.g.final PixelFormat.CType[]Returns theComponent typeorder of all components, seePixelFormat.Composition.componentBitMask().final intdecodeSingleI32(int shifted, int cIdx) Decodes a component from the shifted pixel data with aPixelFormat.Composition.bytesPerPixel()of up to 32bit.final intdecodeSingleI64(long shifted, int cIdx) Decodes a component from the shifted pixel data with aPixelFormat.Composition.bytesPerPixel()of up to 64bit.final intdefaultValue(int cIdx, boolean shiftResult) final intencode3CompI32(int c1NormI32, int c2NormI32, int c3NormI32) final intencode3CompI8(byte c1NormI8, byte c2NormI8, byte c3NormI8) final intencode4CompI32(int c1NormI32, int c2NormI32, int c3NormI32, int c4NormI32) final intencode4CompI8(byte c1NormI8, byte c2NormI8, byte c3NormI8, byte c4NormI8) final intencodeSingleI32(int norm, int cIdx) final longencodeSingleI64(int norm, int cIdx) final intencodeSingleI8(byte normI8, int cIdx) final booleanReturnsObject.equals(Object)final intReturns the index of givenPixelFormat.CTypewithinPixelFormat.Composition.componentOrder(), -1 if not exists.final intfromFloat(float f, int cIdx, boolean shiftResult) final inthashCode()Returns cached immutable hash value, seeObject.hashCode().final booleanReturnstrueif all components are packed, i.e.final booleanReturnstrueif all components are of same bit-size, e.g.final floattoFloat(int i32, int cIdx, boolean i32Shifted) final StringtoString()ReturnsObject.toString().
-
Constructor Details
-
PackedComposition
public PackedComposition(PixelFormat.CType[] componentOrder, int componentCount, int bpc, int bitStride) - Parameters:
componentOrder-Component typeorder of all components, seecomponentBitMask().componentCount- number of componentsbpc- bits per componentbitStride- stride bits to next pixel
-
PackedComposition
public PackedComposition(PixelFormat.CType[] componentOrder, int[] componentMask, int[] componentBitShift, int bitStride) - Parameters:
componentOrder-Component typeorder of all components, seecomponentBitMask().componentMask- bit-mask of of all components, seecomponentBitMask().componentBitShift- bit-shift of all components, seecomponentBitMask().bitStride- stride bits to next pixel
-
-
Method Details
-
toString
Description copied from interface:PixelFormat.CompositionReturnsObject.toString().- Specified by:
toStringin interfacePixelFormat.Composition- Overrides:
toStringin classObject
-
isUniform
public final boolean isUniform()Description copied from interface:PixelFormat.Composition- Specified by:
isUniformin interfacePixelFormat.Composition
-
isInterleaved
public final boolean isInterleaved()Returnstrueif all components are packed, i.e. interleaved, e.g.RGBA8888, otherwisefalse.Instances of
PixelFormat.PackedCompositionreturnstrue.- Specified by:
isInterleavedin interfacePixelFormat.Composition
-
componentCount
public final int componentCount()Description copied from interface:PixelFormat.CompositionNumber of components per pixel, e.g. 3 forRGBx8888.- Specified by:
componentCountin interfacePixelFormat.Composition
-
bitsPerPixel
public final int bitsPerPixel()Description copied from interface:PixelFormat.CompositionNumber of bits per pixel, e.g. 24 bits forRGBx8888.- Specified by:
bitsPerPixelin interfacePixelFormat.Composition
-
bitStride
public final int bitStride()Description copied from interface:PixelFormat.CompositionBit distance between pixels.For packed pixels e.g. 32 bits for
RGBx8888.- Specified by:
bitStridein interfacePixelFormat.Composition
-
bytesPerPixel
public final int bytesPerPixel()Description copied from interface:PixelFormat.CompositionNumber of bytes per pixel, i.e. packedPixelFormat.Composition.bitStride()in bytes, e.g. 4 forRGBx8888.- Specified by:
bytesPerPixelin interfacePixelFormat.Composition
-
componentOrder
Description copied from interface:PixelFormat.CompositionReturns theComponent typeorder of all components, seePixelFormat.Composition.componentBitMask().- Specified by:
componentOrderin interfacePixelFormat.Composition
-
find
Description copied from interface:PixelFormat.CompositionReturns the index of givenPixelFormat.CTypewithinPixelFormat.Composition.componentOrder(), -1 if not exists.- Specified by:
findin interfacePixelFormat.Composition
-
componentBitMask
public final int[] componentBitMask()Description copied from interface:PixelFormat.CompositionReturns the un-shifted bit-mask of all components.Components mask is returned in the order Low-Index to High-Index, e.g.:
- Specified by:
componentBitMaskin interfacePixelFormat.Composition
-
componentBitCount
public final int[] componentBitCount()Description copied from interface:PixelFormat.CompositionReturns the number of bits of all components, seePixelFormat.Composition.componentBitMask().- Specified by:
componentBitCountin interfacePixelFormat.Composition
-
componentBitShift
public final int[] componentBitShift()Description copied from interface:PixelFormat.CompositionReturns the bit-shift of all components, seePixelFormat.Composition.componentBitMask().- Specified by:
componentBitShiftin interfacePixelFormat.Composition
-
decodeSingleI32
public final int decodeSingleI32(int shifted, int cIdx) Description copied from interface:PixelFormat.CompositionDecodes a component from the shifted pixel data with aPixelFormat.Composition.bytesPerPixel()of up to 32bit.- Specified by:
decodeSingleI32in interfacePixelFormat.Composition- Parameters:
shifted- complete pixel encoded into on 32bit integercIdx- the desired component index- Returns:
- the decoded component value
-
decodeSingleI64
public final int decodeSingleI64(long shifted, int cIdx) Description copied from interface:PixelFormat.CompositionDecodes a component from the shifted pixel data with aPixelFormat.Composition.bytesPerPixel()of up to 64bit.- Specified by:
decodeSingleI64in interfacePixelFormat.Composition- Parameters:
shifted- complete pixel encoded into on 64bit integercIdx- the desired component index- Returns:
- the decoded component value
-
encodeSingleI32
public final int encodeSingleI32(int norm, int cIdx) - Specified by:
encodeSingleI32in interfacePixelFormat.Composition
-
encodeSingleI64
public final long encodeSingleI64(int norm, int cIdx) - Specified by:
encodeSingleI64in interfacePixelFormat.Composition
-
encode3CompI32
public final int encode3CompI32(int c1NormI32, int c2NormI32, int c3NormI32) - Specified by:
encode3CompI32in interfacePixelFormat.Composition
-
encode4CompI32
public final int encode4CompI32(int c1NormI32, int c2NormI32, int c3NormI32, int c4NormI32) - Specified by:
encode4CompI32in interfacePixelFormat.Composition
-
encodeSingleI8
public final int encodeSingleI8(byte normI8, int cIdx) - Specified by:
encodeSingleI8in interfacePixelFormat.Composition
-
encode3CompI8
public final int encode3CompI8(byte c1NormI8, byte c2NormI8, byte c3NormI8) - Specified by:
encode3CompI8in interfacePixelFormat.Composition
-
encode4CompI8
public final int encode4CompI8(byte c1NormI8, byte c2NormI8, byte c3NormI8, byte c4NormI8) - Specified by:
encode4CompI8in interfacePixelFormat.Composition
-
toFloat
public final float toFloat(int i32, int cIdx, boolean i32Shifted) - Specified by:
toFloatin interfacePixelFormat.Composition
-
fromFloat
public final int fromFloat(float f, int cIdx, boolean shiftResult) - Specified by:
fromFloatin interfacePixelFormat.Composition
-
defaultValue
public final int defaultValue(int cIdx, boolean shiftResult) - Specified by:
defaultValuein interfacePixelFormat.Composition
-
hashCode
public final int hashCode()Description copied from interface:PixelFormat.CompositionReturns cached immutable hash value, seeObject.hashCode().- Specified by:
hashCodein interfacePixelFormat.Composition- Overrides:
hashCodein classObject
-
equals
Description copied from interface:PixelFormat.CompositionReturnsObject.equals(Object)- Specified by:
equalsin interfacePixelFormat.Composition- Overrides:
equalsin classObject
-