java.lang.Object
overrungl.Pointer
overrungl.Struct
overrungl.glfw.GLFWImage
- All Implemented Interfaces:
Addressable
- Direct Known Subclasses:
GLFWImage.Buffer
GLFWImage
relies on preview features of the Java platform:
GLFWImage
refers to one or more preview APIs:MemoryLayout
,MemorySegment
,SegmentAllocator
,StructLayout
.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
This describes a single 2D image. See the documentation for each related
function what the expected pixel format is.
Layout
struct GLFWimage {
int width
;
int height
;
unsigned char* pixels
PREVIEW;
}
- Since:
- 0.1.0
- Author:
- squid233
-
Nested Class Summary
-
Field Summary
Fields inherited from class overrungl.Pointer
address, allocator, managedSegment
-
Constructor Summary
ModifierConstructorDescriptionGLFWImage
(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator) Create aGLFWimage
instance.protected
GLFWImage
(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator, MemoryLayoutPREVIEW layout) Creates a struct instance with the given memory layout. -
Method Summary
Modifier and TypeMethodDescriptionstatic GLFWImage
create
(SegmentAllocatorPREVIEW allocator) Creates aGLFWImage
instance with the given allocator.static GLFWImage.Buffer
create
(SegmentAllocatorPREVIEW allocator, long count) Creates aGLFWImage.Buffer
instance with the given allocator and count.int
height()
Gets the image height.height
(int height) Sets the image height.pixels()
Gets the image pixels address.pixels
(MemorySegmentPREVIEW pixels) Sets the image pixels address.int
width()
Gets the image width.width
(int width) Sets the image width.
-
Field Details
-
LAYOUT
The struct layout.
-
-
Constructor Details
-
GLFWImage
Create aGLFWimage
instance.- Parameters:
address
- the address.allocator
- the allocator of this address.
-
GLFWImage
protected GLFWImage(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator, MemoryLayoutPREVIEW layout) Creates a struct instance with the given memory layout.- Parameters:
address
- the address.allocator
- the allocator of this address.layout
- the memory layout of this struct.
-
-
Method Details
-
create
Creates aGLFWImage
instance with the given allocator.- Parameters:
allocator
- the allocator- Returns:
- the instance
-
create
Creates aGLFWImage.Buffer
instance with the given allocator and count.- Parameters:
allocator
- the allocatorcount
- the count- Returns:
- the instance
-
width
Sets the image width.- Parameters:
width
- The width, in pixels, of this image.- Returns:
- this
-
height
Sets the image height.- Parameters:
height
- The height, in pixels, of this image.- Returns:
- this
-
pixels
Sets the image pixels address.- Parameters:
pixels
- The pixel data address of this image, arranged left-to-right, top-to-bottom.- Returns:
- this
-
width
public int width()Gets the image width.- Returns:
- The width, in pixels, of this image.
-
height
public int height()Gets the image height.- Returns:
- The height, in pixels, of this image.
-
pixels
Gets the image pixels address.- Returns:
- The pixel data address of this image, arranged left-to-right, top-to-bottom.
-
GLFWImage
when preview features are enabled.