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

Pixel Rectangle Utilities. More...

Collaboration diagram for com.jogamp.nativewindow.util.PixelFormatUtil:

Classes

class  ComponentMap
 

Static Public Member Functions

static final int find (final PixelFormat.CType s, final PixelFormat.CType[] pool, final boolean mapRGB2Y)
 
static int getShiftedI32 (final int bytesPerPixel, final byte[] data, final int offset)
 Returns shifted bytes from the given data at given offset of maximal 4 bytesPerPixel. More...
 
static long getShiftedI64 (final int bytesPerPixel, final byte[] data, final int offset)
 Returns shifted bytes from the given data at given offset of maximal 8 bytesPerPixel. More...
 
static int getShiftedI32 (final int bytesPerPixel, final ByteBuffer data, final boolean retainDataPos)
 Returns shifted bytes from the given data at current position of maximal 4 bytesPerPixel. More...
 
static long getShiftedI64 (final int bytesPerPixel, final ByteBuffer data, final boolean retainDataPos)
 Returns shifted bytes from the given data at current position of maximal 8 bytesPerPixel. More...
 
static PixelFormat getReversed (final PixelFormat fmt)
 Returns the PixelFormat with reversed components of fmt. More...
 
static int convertToInt32 (final PixelFormat dst_fmt, final byte r, final byte g, final byte b, final byte a)
 
static int convertToInt32 (final PixelFormat dst_fmt, final PixelFormat src_fmt, final ByteBuffer src, int srcOff)
 
static int convertToInt32 (final PixelFormat dest_fmt, final PixelFormat src_fmt, final int src_pixel)
 
static PixelRectangle convert (final PixelRectangle src, final PixelFormat destFmt, final int ddestStride, final boolean isGLOriented, final boolean destIsDirect)
 
static void convert (final PixelRectangle src, final ByteBuffer dst_bb, final PixelFormat dst_fmt, final boolean dst_glOriented, final int dst_lineStride) throws IllegalStateException
 
static void convert (final int width, final int height, final ByteBuffer src_bb, final PixelFormat src_fmt, final boolean src_glOriented, int src_lineStride, final ByteBuffer dst_bb, final PixelFormat dst_fmt, final boolean dst_glOriented, int dst_lineStride) throws IllegalStateException, IllegalArgumentException
 
static void convert (final ComponentMap cmap, final PixelFormat.Composition dstComp, final Bitstream< ByteBuffer > dstBitStream, final PixelFormat.Composition srcComp, final Bitstream< ByteBuffer > srcBitStream) throws IllegalStateException, IOException
 

Detailed Description

Pixel Rectangle Utilities.

All conversion methods are endian independent.

Definition at line 43 of file PixelFormatUtil.java.

Member Function Documentation

◆ convert() [1/4]

static void com.jogamp.nativewindow.util.PixelFormatUtil.convert ( final ComponentMap  cmap,
final PixelFormat.Composition  dstComp,
final Bitstream< ByteBuffer >  dstBitStream,
final PixelFormat.Composition  srcComp,
final Bitstream< ByteBuffer >  srcBitStream 
) throws IllegalStateException, IOException
static

Definition at line 511 of file PixelFormatUtil.java.

◆ convert() [2/4]

static void com.jogamp.nativewindow.util.PixelFormatUtil.convert ( final int  width,
final int  height,
final ByteBuffer  src_bb,
final PixelFormat  src_fmt,
final boolean  src_glOriented,
int  src_lineStride,
final ByteBuffer  dst_bb,
final PixelFormat  dst_fmt,
final boolean  dst_glOriented,
int  dst_lineStride 
) throws IllegalStateException, IllegalArgumentException
static
Parameters
widthwidth of the to be converted pixel rectangle
heightheight of the to be converted pixel rectangle
src_bbByteBuffer source
src_fmtsource PixelFormat
src_glOrientedif true, the source memory is laid out in OpenGL's coordinate system, origin at bottom left, otherwise origin at top left.
src_lineStrideline stride in byte-size for source, i.e. byte count from one line to the next. Must be >= src_fmt.comp.bytesPerPixel() * width or zero for default stride.
dst_bbByteBuffer sink
dst_fmtdestination PixelFormat
dst_glOrientedif true, the source memory is laid out in OpenGL's coordinate system, origin at bottom left, otherwise origin at top left.
dst_lineStrideline stride in byte-size for destination, i.e. byte count from one line to the next. Must be >= dst_fmt.comp.bytesPerPixel() * width or zero for default stride.
Exceptions
IllegalStateException
IllegalArgumentExceptionif src_lineStride or dst_lineStride is invalid

Definition at line 415 of file PixelFormatUtil.java.

Here is the call graph for this function:

◆ convert() [3/4]

static void com.jogamp.nativewindow.util.PixelFormatUtil.convert ( final PixelRectangle  src,
final ByteBuffer  dst_bb,
final PixelFormat  dst_fmt,
final boolean  dst_glOriented,
final int  dst_lineStride 
) throws IllegalStateException
static
Parameters
src
dst_bbByteBuffer sink
dst_fmtdestination PixelFormat
dst_glOrientedif true, the source memory is laid out in OpenGL's coordinate system, origin at bottom left, otherwise origin at top left.
dst_lineStrideline stride in byte-size for destination, i.e. byte count from one line to the next. Must be >= dst_fmt.comp.bytesPerPixel() * width or zero for default stride.
Exceptions
IllegalStateException
IllegalArgumentExceptionif src_lineStride or dst_lineStride is invalid

Definition at line 384 of file PixelFormatUtil.java.

Here is the call graph for this function:

◆ convert() [4/4]

static PixelRectangle com.jogamp.nativewindow.util.PixelFormatUtil.convert ( final PixelRectangle  src,
final PixelFormat  destFmt,
final int  ddestStride,
final boolean  isGLOriented,
final boolean  destIsDirect 
)
static

Definition at line 353 of file PixelFormatUtil.java.

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

◆ convertToInt32() [1/3]

static int com.jogamp.nativewindow.util.PixelFormatUtil.convertToInt32 ( final PixelFormat  dest_fmt,
final PixelFormat  src_fmt,
final int  src_pixel 
)
static

Definition at line 302 of file PixelFormatUtil.java.

Here is the call graph for this function:

◆ convertToInt32() [2/3]

static int com.jogamp.nativewindow.util.PixelFormatUtil.convertToInt32 ( final PixelFormat  dst_fmt,
final byte  r,
final byte  g,
final byte  b,
final byte  a 
)
static

Definition at line 228 of file PixelFormatUtil.java.

Here is the caller graph for this function:

◆ convertToInt32() [3/3]

static int com.jogamp.nativewindow.util.PixelFormatUtil.convertToInt32 ( final PixelFormat  dst_fmt,
final PixelFormat  src_fmt,
final ByteBuffer  src,
int  srcOff 
)
static

Definition at line 251 of file PixelFormatUtil.java.

Here is the call graph for this function:

◆ find()

static final int com.jogamp.nativewindow.util.PixelFormatUtil.find ( final PixelFormat.CType  s,
final PixelFormat.CType[]  pool,
final boolean  mapRGB2Y 
)
static

Definition at line 87 of file PixelFormatUtil.java.

Here is the caller graph for this function:

◆ getReversed()

static PixelFormat com.jogamp.nativewindow.util.PixelFormatUtil.getReversed ( final PixelFormat  fmt)
static

Returns the PixelFormat with reversed components of fmt.

If no reversed PixelFormat is available, returns fmt.

Definition at line 201 of file PixelFormatUtil.java.

◆ getShiftedI32() [1/2]

static int com.jogamp.nativewindow.util.PixelFormatUtil.getShiftedI32 ( final int  bytesPerPixel,
final byte[]  data,
final int  offset 
)
static

Returns shifted bytes from the given data at given offset of maximal 4 bytesPerPixel.

Parameters
bytesPerPixelnumber of bytes per pixel to fetch, a maximum of 4 are allowed
databyte buffer covering complete pixel at position offset
offsetbyte offset of pixel data start
Returns
the shifted 32bit integer value of the pixel

Definition at line 112 of file PixelFormatUtil.java.

◆ getShiftedI32() [2/2]

static int com.jogamp.nativewindow.util.PixelFormatUtil.getShiftedI32 ( final int  bytesPerPixel,
final ByteBuffer  data,
final boolean  retainDataPos 
)
static

Returns shifted bytes from the given data at current position of maximal 4 bytesPerPixel.

Parameters
bytesPerPixelnumber of bytes per pixel to fetch, a maximum of 4 are allowed
databyte buffer covering complete pixel at position offset
retainDataPosif true, absolute ByteBuffer#get(int) is used and the data position stays unchanged. Otherwise relative ByteBuffer#get() is used and the data position changes.
Returns
the shifted 32bit integer value of the pixel

Definition at line 151 of file PixelFormatUtil.java.

◆ getShiftedI64() [1/2]

static long com.jogamp.nativewindow.util.PixelFormatUtil.getShiftedI64 ( final int  bytesPerPixel,
final byte[]  data,
final int  offset 
)
static

Returns shifted bytes from the given data at given offset of maximal 8 bytesPerPixel.

Parameters
bytesPerPixelnumber of bytes per pixel to fetch, a maximum of 4 are allowed
databyte buffer covering complete pixel at position offset
offsetbyte offset of pixel data start
Returns
the shifted 64bit integer value of the pixel

Definition at line 131 of file PixelFormatUtil.java.

◆ getShiftedI64() [2/2]

static long com.jogamp.nativewindow.util.PixelFormatUtil.getShiftedI64 ( final int  bytesPerPixel,
final ByteBuffer  data,
final boolean  retainDataPos 
)
static

Returns shifted bytes from the given data at current position of maximal 8 bytesPerPixel.

Parameters
bytesPerPixelnumber of bytes per pixel to fetch, a maximum of 4 are allowed
databyte buffer covering complete pixel at position offset
retainDataPosif true, absolute ByteBuffer#get(int) is used and the data position stays unchanged. Otherwise relative ByteBuffer#get() is used and the data position changes.
Returns
the shifted 64bit integer value of the pixel

Definition at line 178 of file PixelFormatUtil.java.


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