Package org.lwjgl.nanovg
Class NVGPaint
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nanovg.NVGPaint
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class NVGPaint extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceA NanoVG paint.Member documentation
xform– the transformation matrixextent– the extentradius– the radiusfeather– the feather amountinnerColor– the inner colorouterColor– the outer colorimage– the image handle
Layout
struct NVGpaint { float xform[6]; float extent[2]; float radius; float feather;NVGcolorinnerColor;NVGcolorouterColor; int image; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNVGPaint.BufferAn array ofNVGPaintstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intEXTENT
FEATHER
IMAGE
INNERCOLOR
OUTERCOLOR
RADIUSThe struct member offsets.static intSIZEOFThe struct size in bytes.static intXFORMThe struct member offsets.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NVGPaintcalloc()Returns a newNVGPaintinstance allocated withmemCalloc.static NVGPaint.Buffercalloc(int capacity)Returns a newNVGPaint.Bufferinstance allocated withmemCalloc.static NVGPaintcallocStack()Returns a newNVGPaintinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NVGPaint.BuffercallocStack(int capacity)Returns a newNVGPaint.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NVGPaint.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNVGPaint.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NVGPaintcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNVGPaintinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NVGPaintcreate()Returns a newNVGPaintinstance allocated withBufferUtils.static NVGPaint.Buffercreate(int capacity)Returns a newNVGPaint.Bufferinstance allocated withBufferUtils.static NVGPaintcreate(long address)Returns a newNVGPaintinstance for the specified memory address.static NVGPaint.Buffercreate(long address, int capacity)Create aNVGPaint.Bufferinstance at the specified memory.static NVGPaintcreateSafe(long address)static NVGPaint.BuffercreateSafe(long address, int capacity)java.nio.FloatBufferextent()Returns aFloatBufferview of theextentfield.floatextent(int index)Returns the value at the specified index of theextentfield.NVGPaintextent(int index, float value)Sets the specified value at the specified index of theextentfield.NVGPaintextent(java.nio.FloatBuffer value)Copies the specifiedFloatBufferto theextentfield.floatfeather()Returns the value of thefeatherfield.NVGPaintfeather(float value)Sets the specified value to thefeatherfield.intimage()Returns the value of theimagefield.NVGPaintimage(int value)Sets the specified value to theimagefield.NVGColorinnerColor()Returns aNVGColorview of theinnerColorfield.NVGPaintinnerColor(java.util.function.Consumer<NVGColor> consumer)Passes theinnerColorfield to the specifiedConsumer.NVGPaintinnerColor(NVGColor value)Copies the specifiedNVGColorto theinnerColorfield.static NVGPaintmalloc()Returns a newNVGPaintinstance allocated withmemAlloc.static NVGPaint.Buffermalloc(int capacity)Returns a newNVGPaint.Bufferinstance allocated withmemAlloc.static NVGPaintmallocStack()Returns a newNVGPaintinstance allocated on the thread-localMemoryStack.static NVGPaint.BuffermallocStack(int capacity)Returns a newNVGPaint.Bufferinstance allocated on the thread-localMemoryStack.static NVGPaint.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNVGPaint.Bufferinstance allocated on the specifiedMemoryStack.static NVGPaintmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNVGPaintinstance allocated on the specifiedMemoryStack.static java.nio.FloatBuffernextent(long struct)Unsafe version ofextent().static floatnextent(long struct, int index)Unsafe version ofextent.static voidnextent(long struct, int index, float value)Unsafe version ofextent.static voidnextent(long struct, java.nio.FloatBuffer value)Unsafe version ofextent.static floatnfeather(long struct)Unsafe version offeather().static voidnfeather(long struct, float value)Unsafe version offeather.static intnimage(long struct)Unsafe version ofimage().static voidnimage(long struct, int value)Unsafe version ofimage.static NVGColorninnerColor(long struct)Unsafe version ofinnerColor().static voidninnerColor(long struct, NVGColor value)Unsafe version ofinnerColor.static NVGColornouterColor(long struct)Unsafe version ofouterColor().static voidnouterColor(long struct, NVGColor value)Unsafe version ofouterColor.static floatnradius(long struct)Unsafe version ofradius().static voidnradius(long struct, float value)Unsafe version ofradius.static java.nio.FloatBuffernxform(long struct)Unsafe version ofxform().static floatnxform(long struct, int index)Unsafe version ofxform.static voidnxform(long struct, int index, float value)Unsafe version ofxform.static voidnxform(long struct, java.nio.FloatBuffer value)Unsafe version ofxform.NVGColorouterColor()Returns aNVGColorview of theouterColorfield.NVGPaintouterColor(java.util.function.Consumer<NVGColor> consumer)Passes theouterColorfield to the specifiedConsumer.NVGPaintouterColor(NVGColor value)Copies the specifiedNVGColorto theouterColorfield.floatradius()Returns the value of theradiusfield.NVGPaintradius(float value)Sets the specified value to theradiusfield.NVGPaintset(java.nio.FloatBuffer xform, java.nio.FloatBuffer extent, float radius, float feather, NVGColor innerColor, NVGColor outerColor, int image)Initializes this struct with the specified values.NVGPaintset(NVGPaint src)Copies the specified struct data to this struct.intsizeof()java.nio.FloatBufferxform()Returns aFloatBufferview of thexformfield.floatxform(int index)Returns the value at the specified index of thexformfield.NVGPaintxform(int index, float value)Sets the specified value at the specified index of thexformfield.NVGPaintxform(java.nio.FloatBuffer value)Copies the specifiedFloatBufferto thexformfield.
-
-
-
Constructor Detail
-
NVGPaint
public NVGPaint(java.nio.ByteBuffer container)
Creates aNVGPaintinstance at the current position of the specifiedByteBuffercontainer. 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()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
xform
public java.nio.FloatBuffer xform()
Returns aFloatBufferview of thexformfield.
-
xform
public float xform(int index)
Returns the value at the specified index of thexformfield.
-
extent
public java.nio.FloatBuffer extent()
Returns aFloatBufferview of theextentfield.
-
extent
public float extent(int index)
Returns the value at the specified index of theextentfield.
-
radius
public float radius()
Returns the value of theradiusfield.
-
feather
public float feather()
Returns the value of thefeatherfield.
-
innerColor
public NVGPaint innerColor(java.util.function.Consumer<NVGColor> consumer)
Passes theinnerColorfield to the specifiedConsumer.
-
outerColor
public NVGPaint outerColor(java.util.function.Consumer<NVGColor> consumer)
Passes theouterColorfield to the specifiedConsumer.
-
image
public int image()
Returns the value of theimagefield.
-
xform
public NVGPaint xform(java.nio.FloatBuffer value)
Copies the specifiedFloatBufferto thexformfield.
-
xform
public NVGPaint xform(int index, float value)
Sets the specified value at the specified index of thexformfield.
-
extent
public NVGPaint extent(java.nio.FloatBuffer value)
Copies the specifiedFloatBufferto theextentfield.
-
extent
public NVGPaint extent(int index, float value)
Sets the specified value at the specified index of theextentfield.
-
radius
public NVGPaint radius(float value)
Sets the specified value to theradiusfield.
-
feather
public NVGPaint feather(float value)
Sets the specified value to thefeatherfield.
-
innerColor
public NVGPaint innerColor(NVGColor value)
Copies the specifiedNVGColorto theinnerColorfield.
-
outerColor
public NVGPaint outerColor(NVGColor value)
Copies the specifiedNVGColorto theouterColorfield.
-
image
public NVGPaint image(int value)
Sets the specified value to theimagefield.
-
set
public NVGPaint set(java.nio.FloatBuffer xform, java.nio.FloatBuffer extent, float radius, float feather, NVGColor innerColor, NVGColor outerColor, int image)
Initializes this struct with the specified values.
-
set
public NVGPaint set(NVGPaint src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static NVGPaint malloc()
Returns a newNVGPaintinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static NVGPaint calloc()
Returns a newNVGPaintinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static NVGPaint create(long address)
Returns a newNVGPaintinstance for the specified memory address.
-
createSafe
@Nullable public static NVGPaint createSafe(long address)
-
malloc
public static NVGPaint.Buffer malloc(int capacity)
Returns a newNVGPaint.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static NVGPaint.Buffer calloc(int capacity)
Returns a newNVGPaint.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static NVGPaint.Buffer create(int capacity)
Returns a newNVGPaint.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static NVGPaint.Buffer create(long address, int capacity)
Create aNVGPaint.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static NVGPaint.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NVGPaint mallocStack()
Returns a newNVGPaintinstance allocated on the thread-localMemoryStack.
-
callocStack
public static NVGPaint callocStack()
Returns a newNVGPaintinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static NVGPaint mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNVGPaintinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static NVGPaint callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNVGPaintinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static NVGPaint.Buffer mallocStack(int capacity)
Returns a newNVGPaint.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static NVGPaint.Buffer callocStack(int capacity)
Returns a newNVGPaint.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static NVGPaint.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNVGPaint.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static NVGPaint.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNVGPaint.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nxform
public static java.nio.FloatBuffer nxform(long struct)
Unsafe version ofxform().
-
nxform
public static float nxform(long struct, int index)Unsafe version ofxform.
-
nextent
public static java.nio.FloatBuffer nextent(long struct)
Unsafe version ofextent().
-
nextent
public static float nextent(long struct, int index)Unsafe version ofextent.
-
nradius
public static float nradius(long struct)
Unsafe version ofradius().
-
nfeather
public static float nfeather(long struct)
Unsafe version offeather().
-
ninnerColor
public static NVGColor ninnerColor(long struct)
Unsafe version ofinnerColor().
-
nouterColor
public static NVGColor nouterColor(long struct)
Unsafe version ofouterColor().
-
nimage
public static int nimage(long struct)
Unsafe version ofimage().
-
nxform
public static void nxform(long struct, java.nio.FloatBuffer value)Unsafe version ofxform.
-
nxform
public static void nxform(long struct, int index, float value)Unsafe version ofxform.
-
nextent
public static void nextent(long struct, java.nio.FloatBuffer value)Unsafe version ofextent.
-
nextent
public static void nextent(long struct, int index, float value)Unsafe version ofextent.
-
nradius
public static void nradius(long struct, float value)Unsafe version ofradius.
-
nfeather
public static void nfeather(long struct, float value)Unsafe version offeather.
-
ninnerColor
public static void ninnerColor(long struct, NVGColor value)Unsafe version ofinnerColor.
-
nouterColor
public static void nouterColor(long struct, NVGColor value)Unsafe version ofouterColor.
-
nimage
public static void nimage(long struct, int value)Unsafe version ofimage.
-
-