Class POINTFLOAT

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer


    public class POINTFLOAT
    extends Struct
    Contains the x and y coordinates of a point.

    Member documentation

    • x – specifies the horizontal (x) coordinate of a point
    • y – specifies the vertical (y) coordinate of a point

    Layout

    struct POINTFLOAT {
        FLOAT x;
        FLOAT y;
    }
    • Field Detail

      • SIZEOF

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

      • POINTFLOAT

        public POINTFLOAT(java.nio.ByteBuffer container)
        Creates a POINTFLOAT 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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns the sizeof(struct).
        Specified by:
        sizeof in class Struct
      • x

        public float x()
        Returns the value of the x field.
      • y

        public float y()
        Returns the value of the y field.
      • x

        public POINTFLOAT x(float value)
        Sets the specified value to the x field.
      • y

        public POINTFLOAT y(float value)
        Sets the specified value to the y field.
      • set

        public POINTFLOAT set(float x,
                              float y)
        Initializes this struct with the specified values.
      • nset

        public POINTFLOAT nset(long struct)
        Unsafe version of set.
      • set

        public POINTFLOAT set(POINTFLOAT src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

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

        public static POINTFLOAT create(long address)
        Returns a new POINTFLOAT instance for the specified memory address or null if the address is NULL.
      • malloc

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

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

        public static POINTFLOAT callocStack()
        Returns a new POINTFLOAT instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • callocStack

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

        public static POINTFLOAT.Buffer callocStack(int capacity)
        Returns a new POINTFLOAT.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

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