Class SDL_PixelFormat
- java.lang.Object
-
- com.sun.jna.PointerType
-
- io.github.libsdl4j.api.pixels.SDL_PixelFormat
-
- All Implemented Interfaces:
com.sun.jna.NativeMapped
public final class SDL_PixelFormat extends com.sun.jna.PointerType
A structure that contains pixel format information.A pixel format has either a palette or masks. If a palette is used, then rMask, gMask, bMask, and aMask will be 0.
The data types used to represent pixels are as follows:Pixel datatypes Bytes Per Pixel Related Data Types 1 byte (Uint8) 2 short (Unit16) 3 3×byte (3×Uint8) 4 int (Uint32) An
SDL_PixelFormat
describes the format of the pixel data stored at thepixels
property of anSDL_Surface
. Every surface stores anSDL_PixelFormat
in theformat
property.If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential.
Note: Everything in the pixel format structure is read-only.
Implementation note:
SDL_SDL_PixelFormat
would normally be implemented as a JNAStructure
but the SDL internals keep references to all allocatedSDL_PixelFormat
s and change their internal fields via various functions. Thus it is implemented as an opaque Pointer and there is a co-locatedSDL_PixelFormat_internal
which allows a read-only access to the fields.
-
-
Constructor Summary
Constructors Constructor Description SDL_PixelFormat()
SDL_PixelFormat(com.sun.jna.Pointer p)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
getALoss()
int
getAMask()
byte
getAShift()
byte
getBitsPerPixel()
byte
getBLoss()
int
getBMask()
byte
getBShift()
byte
getBytesPerPixel()
int
getFormat()
byte
getGLoss()
int
getGMask()
byte
getGShift()
SDL_Palette
getPalette()
byte
getRLoss()
int
getRMask()
byte
getRShift()
-
-
-
Method Detail
-
getFormat
public int getFormat()
-
getPalette
public SDL_Palette getPalette()
-
getBitsPerPixel
public byte getBitsPerPixel()
-
getBytesPerPixel
public byte getBytesPerPixel()
-
getRMask
public int getRMask()
-
getGMask
public int getGMask()
-
getBMask
public int getBMask()
-
getAMask
public int getAMask()
-
getRLoss
public byte getRLoss()
-
getGLoss
public byte getGLoss()
-
getBLoss
public byte getBLoss()
-
getALoss
public byte getALoss()
-
getRShift
public byte getRShift()
-
getGShift
public byte getGShift()
-
getBShift
public byte getBShift()
-
getAShift
public byte getAShift()
-
-