Class SDL_Palette
- java.lang.Object
-
- com.sun.jna.PointerType
-
- io.github.libsdl4j.api.pixels.SDL_Palette
-
- All Implemented Interfaces:
com.sun.jna.NativeMapped
public final class SDL_Palette extends com.sun.jna.PointerType
A structure that contains palette information.Each pixel in an 8-bit surface is an index into the
colors
field of theSDL_Palette
structure stored inSDL_PixelFormat
. AnSDL_Palette
should never need to be created manually. It is automatically created when SDL allocates anSDL_PixelFormat
for a surface. Thecolors
values of anSDL_Surface
's palette can be set withSdlPixels.SDL_SetPaletteColors(SDL_Palette, List, int, int)
SDL_SetPaletteColors(...)}.Implementation note:
SDL_Palette
would normally be implemented as a JNAStructure
but other SDL structures keep references toSDL_Palette
s and can change their internal fields via various SDL functions. Thus it is implemented as an opaque Pointer and there is a co-locatedSDL_Palette_internal
which allows a read-only access to the fields.
-
-
Constructor Summary
Constructors Constructor Description SDL_Palette()
SDL_Palette(com.sun.jna.Pointer p)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SDL_Color
getColors(int index)
int
getNcolors()
int
getVersion()
-
-
-
Method Detail
-
getNcolors
public int getNcolors()
-
getColors
public SDL_Color getColors(int index)
-
getVersion
public int getVersion()
-
-