Class NSVGGradient

All Implemented Interfaces:
Pointer

public class NSVGGradient extends Struct<NSVGGradient>

 struct NSVGgradient {
     float xform[6];
     char spread;
     float fx;
     float fy;
     int nstops;
     {@link NSVGGradientStop NSVGgradientStop} pstops[1];
 }
  • Field Details

    • SIZEOF

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

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

      public static final int XFORM
      The struct member offsets.
    • SPREAD

      public static final int SPREAD
      The struct member offsets.
    • FX

      public static final int FX
      The struct member offsets.
    • FY

      public static final int FY
      The struct member offsets.
    • NSTOPS

      public static final int NSTOPS
      The struct member offsets.
    • PSTOPS

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

    • NSVGGradient

      public NSVGGradient(ByteBuffer container)
      Creates a NSVGGradient 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<NSVGGradient>
    • xform

      public FloatBuffer xform()
      Returns:
      a FloatBuffer view of the xform field.
    • xform

      public float xform(int index)
      Returns:
      the value at the specified index of the xform field.
    • spread

      public byte spread()
      Returns:
      the value of the spread field.
    • fx

      public float fx()
      Returns:
      the value of the fx field.
    • fy

      public float fy()
      Returns:
      the value of the fy field.
    • nstops

      public int nstops()
      Returns:
      the value of the nstops field.
    • pstops

      public NSVGGradientStop.Buffer pstops()
      Returns:
      a NSVGGradientStop.Buffer view of the pstops field.
    • pstops

      public NSVGGradientStop pstops(int index)
      Returns:
      a NSVGGradientStop view of the struct at the specified index of the pstops field.
    • create

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

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

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

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

      public static FloatBuffer nxform(long struct)
      Unsafe version of xform().
    • nxform

      public static float nxform(long struct, int index)
      Unsafe version of xform.
    • nspread

      public static byte nspread(long struct)
      Unsafe version of spread().
    • nfx

      public static float nfx(long struct)
      Unsafe version of fx().
    • nfy

      public static float nfy(long struct)
      Unsafe version of fy().
    • nnstops

      public static int nnstops(long struct)
      Unsafe version of nstops().
    • npstops

      public static NSVGGradientStop.Buffer npstops(long struct)
      Unsafe version of pstops().
    • npstops

      public static NSVGGradientStop npstops(long struct, int index)
      Unsafe version of pstops.