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:
GLFWImagerefers 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* pixelsPREVIEW;
}- Since:
- 0.1.0
- Author:
- squid233
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class overrungl.Pointer
address, allocator, managedSegment -
Constructor Summary
ConstructorsModifierConstructorDescriptionGLFWImage(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator) Create aGLFWimageinstance.protectedGLFWImage(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator, MemoryLayoutPREVIEW layout) Creates a struct instance with the given memory layout. -
Method Summary
Modifier and TypeMethodDescriptionstatic GLFWImagecreate(SegmentAllocatorPREVIEW allocator) Creates aGLFWImageinstance with the given allocator.static GLFWImage.Buffercreate(SegmentAllocatorPREVIEW allocator, long count) Creates aGLFWImage.Bufferinstance with the given allocator and count.intheight()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.intwidth()Gets the image width.width(int width) Sets the image width.
-
Field Details
-
LAYOUT
The struct layout.
-
-
Constructor Details
-
GLFWImage
Create aGLFWimageinstance.- 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 aGLFWImageinstance with the given allocator.- Parameters:
allocator- the allocator- Returns:
- the instance
-
create
Creates aGLFWImage.Bufferinstance 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.
-
GLFWImagewhen preview features are enabled.