Class 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 the pixels property of an SDL_Surface. Every surface stores an SDL_PixelFormat in the format 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 JNA Structure but the SDL internals keep references to all allocated SDL_PixelFormats and change their internal fields via various functions. Thus it is implemented as an opaque Pointer and there is a co-located SDL_PixelFormat_internal which allows a read-only access to the fields.

    • Constructor Detail

      • SDL_PixelFormat

        public SDL_PixelFormat()
      • SDL_PixelFormat

        public SDL_PixelFormat​(com.sun.jna.Pointer p)
    • Method Detail

      • getFormat

        public int getFormat()
      • 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()