Class FT_Bitmap

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class FT_Bitmap extends Struct<FT_Bitmap> implements NativeResource

 struct FT_Bitmap {
     unsigned int rows;
     unsigned int width;
     int pitch;
     unsigned char * buffer;
     unsigned short num_grays;
     unsigned char pixel_mode;
     unsigned char palette_mode;
     void * palette;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • ROWS

      public static final int ROWS
      The struct member offsets.
    • WIDTH

      public static final int WIDTH
      The struct member offsets.
    • PITCH

      public static final int PITCH
      The struct member offsets.
    • BUFFER

      public static final int BUFFER
      The struct member offsets.
    • NUM_GRAYS

      public static final int NUM_GRAYS
      The struct member offsets.
    • PIXEL_MODE

      public static final int PIXEL_MODE
      The struct member offsets.
    • PALETTE_MODE

      public static final int PALETTE_MODE
      The struct member offsets.
    • PALETTE

      public static final int PALETTE
      The struct member offsets.
  • Constructor Details

    • FT_Bitmap

      public FT_Bitmap(ByteBuffer container)
      Creates a FT_Bitmap instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<FT_Bitmap>
    • rows

      public int rows()
      Returns:
      the value of the rows field.
    • width

      public int width()
      Returns:
      the value of the width field.
    • pitch

      public int pitch()
      Returns:
      the value of the pitch field.
    • buffer

      public @Nullable ByteBuffer buffer(int capacity)
      Returns:
      a ByteBuffer view of the data pointed to by the buffer field.
    • num_grays

      public short num_grays()
      Returns:
      the value of the num_grays field.
    • pixel_mode

      public byte pixel_mode()
      Returns:
      the value of the pixel_mode field.
    • palette_mode

      public byte palette_mode()
      Returns:
      the value of the palette_mode field.
    • palette

      public long palette()
      Returns:
      the value of the palette field.
    • malloc

      public static FT_Bitmap malloc()
      Returns a new FT_Bitmap instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static FT_Bitmap calloc()
      Returns a new FT_Bitmap instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static FT_Bitmap create()
      Returns a new FT_Bitmap instance allocated with BufferUtils.
    • create

      public static FT_Bitmap create(long address)
      Returns a new FT_Bitmap instance for the specified memory address.
    • createSafe

      public static @Nullable FT_Bitmap createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static FT_Bitmap.Buffer malloc(int capacity)
      Returns a new FT_Bitmap.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static FT_Bitmap.Buffer calloc(int capacity)
      Returns a new FT_Bitmap.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static FT_Bitmap.Buffer create(int capacity)
      Returns a new FT_Bitmap.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static FT_Bitmap.Buffer create(long address, int capacity)
      Create a FT_Bitmap.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable FT_Bitmap.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static FT_Bitmap malloc(MemoryStack stack)
      Returns a new FT_Bitmap instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static FT_Bitmap calloc(MemoryStack stack)
      Returns a new FT_Bitmap instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static FT_Bitmap.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new FT_Bitmap.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static FT_Bitmap.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new FT_Bitmap.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nrows

      public static int nrows(long struct)
      Unsafe version of rows().
    • nwidth

      public static int nwidth(long struct)
      Unsafe version of width().
    • npitch

      public static int npitch(long struct)
      Unsafe version of pitch().
    • nbuffer

      public static @Nullable ByteBuffer nbuffer(long struct, int capacity)
      Unsafe version of buffer.
    • nnum_grays

      public static short nnum_grays(long struct)
      Unsafe version of num_grays().
    • npixel_mode

      public static byte npixel_mode(long struct)
      Unsafe version of pixel_mode().
    • npalette_mode

      public static byte npalette_mode(long struct)
      Unsafe version of palette_mode().
    • npalette

      public static long npalette(long struct)
      Unsafe version of palette().