public class GLFWImage
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
This describes a single 2D image. See the documentation for each related function to see what the expected pixel format is.
width – the width, in pixels, of this imageheight – the height, in pixels, of this imagepixels – the pixel data of this image, arranged left-to-right, top-to-bottom
struct GLFWimage {
int width;
int height;
unsigned char * pixels;
}| Modifier and Type | Class and Description |
|---|---|
static class |
GLFWImage.Buffer
An array of
GLFWImage structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
HEIGHT
The struct member offsets.
|
static int |
PIXELS
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
static int |
WIDTH
The struct member offsets.
|
| Constructor and Description |
|---|
GLFWImage(java.nio.ByteBuffer container)
Creates a
GLFWImage instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
static GLFWImage |
calloc()
Returns a new
GLFWImage instance allocated with memCalloc. |
static GLFWImage.Buffer |
calloc(int capacity)
Returns a new
GLFWImage.Buffer instance allocated with memCalloc. |
static GLFWImage |
callocStack()
Returns a new
GLFWImage instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static GLFWImage.Buffer |
callocStack(int capacity)
Returns a new
GLFWImage.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static GLFWImage.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
GLFWImage.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static GLFWImage |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
GLFWImage instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static GLFWImage |
create()
Returns a new
GLFWImage instance allocated with BufferUtils. |
static GLFWImage.Buffer |
create(int capacity)
Returns a new
GLFWImage.Buffer instance allocated with BufferUtils. |
static GLFWImage |
create(long address)
Returns a new
GLFWImage instance for the specified memory address. |
static GLFWImage.Buffer |
create(long address,
int capacity)
Create a
GLFWImage.Buffer instance at the specified memory. |
static GLFWImage |
createSafe(long address)
|
static GLFWImage.Buffer |
createSafe(long address,
int capacity)
|
int |
height()
Returns the value of the
height field. |
GLFWImage |
height(int value)
Sets the specified value to the
height field. |
static GLFWImage |
malloc()
Returns a new
GLFWImage instance allocated with memAlloc. |
static GLFWImage.Buffer |
malloc(int capacity)
Returns a new
GLFWImage.Buffer instance allocated with memAlloc. |
static GLFWImage |
mallocStack()
Returns a new
GLFWImage instance allocated on the thread-local MemoryStack. |
static GLFWImage.Buffer |
mallocStack(int capacity)
Returns a new
GLFWImage.Buffer instance allocated on the thread-local MemoryStack. |
static GLFWImage.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
GLFWImage.Buffer instance allocated on the specified MemoryStack. |
static GLFWImage |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
GLFWImage instance allocated on the specified MemoryStack. |
static int |
nheight(long struct)
Unsafe version of
height(). |
static void |
nheight(long struct,
int value)
Unsafe version of
height. |
static void |
npixels(long struct,
java.nio.ByteBuffer value)
Unsafe version of
pixels. |
static java.nio.ByteBuffer |
npixels(long struct,
int capacity)
Unsafe version of
pixels. |
static int |
nwidth(long struct)
Unsafe version of
width(). |
static void |
nwidth(long struct,
int value)
Unsafe version of
width. |
GLFWImage |
pixels(java.nio.ByteBuffer value)
Sets the address of the specified
ByteBuffer to the pixels field. |
java.nio.ByteBuffer |
pixels(int capacity)
Returns a
ByteBuffer view of the data pointed to by the pixels field. |
GLFWImage |
set(GLFWImage src)
Copies the specified struct data to this struct.
|
GLFWImage |
set(int width,
int height,
java.nio.ByteBuffer pixels)
Initializes this struct with the specified values.
|
int |
sizeof() |
static void |
validate(long struct)
Validates pointer members that should not be
NULL. |
static void |
validate(long array,
int count)
Calls
validate(long) for each struct contained in the specified struct array. |
int |
width()
Returns the value of the
width field. |
GLFWImage |
width(int value)
Sets the specified value to the
width field. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int WIDTH
public static final int HEIGHT
public static final int PIXELS
public GLFWImage(java.nio.ByteBuffer container)
GLFWImage 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic int width()
width field.public int height()
height field.public java.nio.ByteBuffer pixels(int capacity)
ByteBuffer view of the data pointed to by the pixels field.capacity - the number of elements in the returned bufferpublic GLFWImage width(int value)
width field.public GLFWImage height(int value)
height field.public GLFWImage pixels(java.nio.ByteBuffer value)
ByteBuffer to the pixels field.public GLFWImage set(int width, int height, java.nio.ByteBuffer pixels)
public GLFWImage set(GLFWImage src)
src - the source structpublic static GLFWImage malloc()
GLFWImage instance allocated with memAlloc. The instance must be explicitly freed.public static GLFWImage calloc()
GLFWImage instance allocated with memCalloc. The instance must be explicitly freed.public static GLFWImage create()
GLFWImage instance allocated with BufferUtils.public static GLFWImage create(long address)
GLFWImage instance for the specified memory address.@Nullable public static GLFWImage createSafe(long address)
public static GLFWImage.Buffer malloc(int capacity)
GLFWImage.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static GLFWImage.Buffer calloc(int capacity)
GLFWImage.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static GLFWImage.Buffer create(int capacity)
GLFWImage.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static GLFWImage.Buffer create(long address, int capacity)
GLFWImage.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static GLFWImage.Buffer createSafe(long address, int capacity)
public static GLFWImage mallocStack()
GLFWImage instance allocated on the thread-local MemoryStack.public static GLFWImage callocStack()
GLFWImage instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static GLFWImage mallocStack(org.lwjgl.system.MemoryStack stack)
GLFWImage instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static GLFWImage callocStack(org.lwjgl.system.MemoryStack stack)
GLFWImage instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static GLFWImage.Buffer mallocStack(int capacity)
GLFWImage.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static GLFWImage.Buffer callocStack(int capacity)
GLFWImage.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static GLFWImage.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
GLFWImage.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static GLFWImage.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
GLFWImage.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static int nwidth(long struct)
width().public static int nheight(long struct)
height().public static java.nio.ByteBuffer npixels(long struct,
int capacity)
pixels.public static void nwidth(long struct,
int value)
width.public static void nheight(long struct,
int value)
height.public static void npixels(long struct,
java.nio.ByteBuffer value)
pixels.public static void validate(long struct)
NULL.struct - the struct to validatepublic static void validate(long array,
int count)
validate(long) for each struct contained in the specified struct array.array - the struct array to validatecount - the number of structs in arrayCopyright LWJGL. All Rights Reserved. License terms.