JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.nativewindow.util.PixelFormat.PackedComposition Class Reference

Packed pixel composition, see Composition. More...

Inheritance diagram for com.jogamp.nativewindow.util.PixelFormat.PackedComposition:
Collaboration diagram for com.jogamp.nativewindow.util.PixelFormat.PackedComposition:

Public Member Functions

final String toString ()
 Returns Object#toString(). More...
 
 PackedComposition (final CType[] componentOrder, final int componentCount, final int bpc, final int bitStride)
 
 PackedComposition (final CType[] componentOrder, final int[] componentMask, final int[] componentBitShift, final int bitStride)
 
final boolean isUniform ()
 Returns true if all components are of same bit-size, e.g. More...
 
final boolean isInterleaved ()
 Returns true if all components are packed, i.e.interleaved, e.g. RGBA8888, otherwise false. More...
 
final int componentCount ()
 Number of components per pixel, e.g. More...
 
final int bitsPerPixel ()
 Number of bits per pixel, e.g. More...
 
final int bitStride ()
 Bit distance between pixels. More...
 
final int bytesPerPixel ()
 Number of bytes per pixel, i.e. More...
 
final CType[] componentOrder ()
 Returns the Component type order of all components, see componentBitMask(). More...
 
final int find (final PixelFormat.CType s)
 Returns the index of given CType within componentOrder(), -1 if not exists. More...
 
final int[] componentBitMask ()
 Returns the un-shifted bit-mask of all components. More...
 
final int[] componentBitCount ()
 Returns the number of bits of all components, see componentBitMask(). More...
 
final int[] componentBitShift ()
 Returns the bit-shift of all components, see componentBitMask(). More...
 
final int decodeSingleI32 (final int shifted, final int cIdx)
 Decodes a component from the shifted pixel data with a bytesPerPixel() of up to 32bit. More...
 
final int decodeSingleI64 (final long shifted, final int cIdx)
 Decodes a component from the shifted pixel data with a bytesPerPixel() of up to 64bit. More...
 
final int encodeSingleI32 (final int norm, final int cIdx)
 
final long encodeSingleI64 (final int norm, final int cIdx)
 
final int encode3CompI32 (final int c1NormI32, final int c2NormI32, final int c3NormI32)
 
final int encode4CompI32 (final int c1NormI32, final int c2NormI32, final int c3NormI32, final int c4NormI32)
 
final int encodeSingleI8 (final byte normI8, final int cIdx)
 
final int encode3CompI8 (final byte c1NormI8, final byte c2NormI8, final byte c3NormI8)
 
final int encode4CompI8 (final byte c1NormI8, final byte c2NormI8, final byte c3NormI8, final byte c4NormI8)
 
final float toFloat (final int i32, final int cIdx, final boolean i32Shifted)
 
final int fromFloat (final float f, final int cIdx, final boolean shiftResult)
 
final int defaultValue (final int cIdx, final boolean shiftResult)
 
final int hashCode ()
 Returns cached immutable hash value, see Object#hashCode(). More...
 
final boolean equals (final Object obj)
 Returns Object#equals(Object). More...
 
boolean isUniform ()
 Returns true if all components are of same bit-size, e.g. More...
 
boolean isInterleaved ()
 Returns true if all components are packed, i.e. More...
 
int componentCount ()
 Number of components per pixel, e.g. More...
 
int bitsPerPixel ()
 Number of bits per pixel, e.g. More...
 
int bitStride ()
 Bit distance between pixels. More...
 
int bytesPerPixel ()
 Number of bytes per pixel, i.e. More...
 
CType[] componentOrder ()
 Returns the Component type order of all components, see componentBitMask(). More...
 
int find (final PixelFormat.CType s)
 Returns the index of given CType within componentOrder(), -1 if not exists. More...
 
int[] componentBitMask ()
 Returns the un-shifted bit-mask of all components. More...
 
int[] componentBitCount ()
 Returns the number of bits of all components, see componentBitMask(). More...
 
int[] componentBitShift ()
 Returns the bit-shift of all components, see componentBitMask(). More...
 
int decodeSingleI32 (final int shifted, final int cIdx)
 Decodes a component from the shifted pixel data with a bytesPerPixel() of up to 32bit. More...
 
int decodeSingleI64 (final long shifted, final int cIdx)
 Decodes a component from the shifted pixel data with a bytesPerPixel() of up to 64bit. More...
 
int encodeSingleI32 (final int norm, final int cIdx)
 
long encodeSingleI64 (final int norm, final int cIdx)
 
int encode3CompI32 (final int c1NormI32, final int c2NormI32, final int c3NormI32)
 
int encode4CompI32 (final int c1NormI32, final int c2NormI32, final int c3NormI32, final int c4NormI32)
 
int encodeSingleI8 (final byte normalI8, final int cIdx)
 
int encode3CompI8 (final byte c1NormI8, final byte c2NormI8, final byte c3NormI8)
 
int encode4CompI8 (final byte c1NormI8, final byte c2NormI8, final byte c3NormI8, final byte c4NormI8)
 
float toFloat (final int i32, final int cIdx, final boolean i32Shifted)
 
int fromFloat (final float f, final int cIdx, final boolean shiftResult)
 
int defaultValue (final int cIdx, final boolean shiftResult)
 
int hashCode ()
 Returns cached immutable hash value, see Object#hashCode(). More...
 
boolean equals (final Object o)
 Returns Object#equals(Object). More...
 
String toString ()
 Returns Object#toString(). More...
 

Additional Inherited Members

- Static Public Attributes inherited from com.jogamp.nativewindow.util.PixelFormat.Composition
static final int UNDEF = -1
 {@value} More...
 

Detailed Description

Packed pixel composition, see Composition.

Components are interleaved, i.e. packed.

Definition at line 521 of file PixelFormat.java.

Constructor & Destructor Documentation

◆ PackedComposition() [1/2]

com.jogamp.nativewindow.util.PixelFormat.PackedComposition.PackedComposition ( final CType[]  componentOrder,
final int  componentCount,
final int  bpc,
final int  bitStride 
)
Parameters
componentOrderComponent type order of all components, see componentBitMask().
componentCountnumber of components
bpcbits per component
bitStridestride bits to next pixel

Definition at line 543 of file PixelFormat.java.

◆ PackedComposition() [2/2]

com.jogamp.nativewindow.util.PixelFormat.PackedComposition.PackedComposition ( final CType[]  componentOrder,
final int[]  componentMask,
final int[]  componentBitShift,
final int  bitStride 
)
Parameters
componentOrderComponent type order of all components, see componentBitMask().
componentMaskbit-mask of of all components, see componentBitMask().
componentBitShiftbit-shift of all components, see componentBitMask().
bitStridestride bits to next pixel

Definition at line 569 of file PixelFormat.java.

Member Function Documentation

◆ bitsPerPixel()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.bitsPerPixel ( )

Number of bits per pixel, e.g.

24 bits for RGBx8888.

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 607 of file PixelFormat.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitStride()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.bitStride ( )

Bit distance between pixels.

For packed pixels e.g. 32 bits for RGBx8888.

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 609 of file PixelFormat.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bytesPerPixel()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.bytesPerPixel ( )

Number of bytes per pixel, i.e.

packed bitStride() in bytes, e.g. 4 for RGBx8888.

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 611 of file PixelFormat.java.

◆ componentBitCount()

final int[] com.jogamp.nativewindow.util.PixelFormat.PackedComposition.componentBitCount ( )

Returns the number of bits of all components, see componentBitMask().

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 619 of file PixelFormat.java.

◆ componentBitMask()

final int[] com.jogamp.nativewindow.util.PixelFormat.PackedComposition.componentBitMask ( )

Returns the un-shifted bit-mask of all components.

Components mask is returned in the order Low-Index to High-Index, e.g.:

  • RGB565: 0: R 0x1F, 1: G 0x3F, 2: B 0x1F
  • RGBA5551: 0: R 0x1F, 1: G 0x1F, 2: B 0x1F, 3: A 0x01
  • RGBA8888: 0: R 0xFF, 1: G 0xFF, 2: B 0xFF, 3: A 0xFF

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 617 of file PixelFormat.java.

◆ componentBitShift()

final int[] com.jogamp.nativewindow.util.PixelFormat.PackedComposition.componentBitShift ( )

Returns the bit-shift of all components, see componentBitMask().

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 621 of file PixelFormat.java.

◆ componentCount()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.componentCount ( )

Number of components per pixel, e.g.

3 for RGBx8888.

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 605 of file PixelFormat.java.

◆ componentOrder()

final CType[] com.jogamp.nativewindow.util.PixelFormat.PackedComposition.componentOrder ( )

Returns the Component type order of all components, see componentBitMask().

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 613 of file PixelFormat.java.

◆ decodeSingleI32()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.decodeSingleI32 ( final int  shifted,
final int  cIdx 
)

Decodes a component from the shifted pixel data with a bytesPerPixel() of up to 32bit.

Parameters
shiftedcomplete pixel encoded into on 32bit integer
cIdxthe desired component index
Returns
the decoded component value

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 624 of file PixelFormat.java.

◆ decodeSingleI64()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.decodeSingleI64 ( final long  shifted,
final int  cIdx 
)

Decodes a component from the shifted pixel data with a bytesPerPixel() of up to 64bit.

Parameters
shiftedcomplete pixel encoded into on 64bit integer
cIdxthe desired component index
Returns
the decoded component value

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 628 of file PixelFormat.java.

◆ defaultValue()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.defaultValue ( final int  cIdx,
final boolean  shiftResult 
)

◆ encode3CompI32()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.encode3CompI32 ( final int  c1NormI32,
final int  c2NormI32,
final int  c3NormI32 
)

◆ encode3CompI8()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.encode3CompI8 ( final byte  c1NormI8,
final byte  c2NormI8,
final byte  c3NormI8 
)

◆ encode4CompI32()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.encode4CompI32 ( final int  c1NormI32,
final int  c2NormI32,
final int  c3NormI32,
final int  c4NormI32 
)

◆ encode4CompI8()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.encode4CompI8 ( final byte  c1NormI8,
final byte  c2NormI8,
final byte  c3NormI8,
final byte  c4NormI8 
)

◆ encodeSingleI32()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.encodeSingleI32 ( final int  norm,
final int  cIdx 
)

◆ encodeSingleI64()

final long com.jogamp.nativewindow.util.PixelFormat.PackedComposition.encodeSingleI64 ( final int  norm,
final int  cIdx 
)

◆ encodeSingleI8()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.encodeSingleI8 ( final byte  normI8,
final int  cIdx 
)

◆ equals()

final boolean com.jogamp.nativewindow.util.PixelFormat.PackedComposition.equals ( final Object  o)

Returns Object#equals(Object).

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 711 of file PixelFormat.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.find ( final PixelFormat.CType  s)

Returns the index of given CType within componentOrder(), -1 if not exists.

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 615 of file PixelFormat.java.

Here is the call graph for this function:

◆ fromFloat()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.fromFloat ( final float  f,
final int  cIdx,
final boolean  shiftResult 
)

◆ hashCode()

final int com.jogamp.nativewindow.util.PixelFormat.PackedComposition.hashCode ( )

Returns cached immutable hash value, see Object#hashCode().

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 692 of file PixelFormat.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInterleaved()

final boolean com.jogamp.nativewindow.util.PixelFormat.PackedComposition.isInterleaved ( )

Returns true if all components are packed, i.e.interleaved, e.g. RGBA8888, otherwise false.

Instances of PackedComposition returns true.

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 603 of file PixelFormat.java.

◆ isUniform()

final boolean com.jogamp.nativewindow.util.PixelFormat.PackedComposition.isUniform ( )

Returns true if all components are of same bit-size, e.g.

RGBA8888, otherwise false, e.g. RGBA5551

Implements com.jogamp.nativewindow.util.PixelFormat.Composition.

Definition at line 595 of file PixelFormat.java.

◆ toFloat()

final float com.jogamp.nativewindow.util.PixelFormat.PackedComposition.toFloat ( final int  i32,
final int  cIdx,
final boolean  i32Shifted 
)

◆ toString()

final String com.jogamp.nativewindow.util.PixelFormat.PackedComposition.toString ( )

The documentation for this class was generated from the following file: