JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java™ (public API).
CLImageFormatImpl.java
Go to the documentation of this file.
1/* !---- DO NOT EDIT: This file autogenerated by com/jogamp/gluegen/procaddress/ProcAddressEmitter.java on Tue Jul 22 05:27:32 CEST 2025 ----! */
2/* !---- Java-Unit: [pkg com.jogamp.opencl.llb.impl, cls CLImageFormatImpl], ../build/gensrc/java/com/jogamp/opencl/llb/impl/CLImageFormatImpl.java ----! */
3
4
5package com.jogamp.opencl.llb.impl;
6
7import java.nio.*;
8import java.nio.charset.Charset;
9import java.nio.charset.StandardCharsets;
10
11import com.jogamp.gluegen.runtime.*;
12import com.jogamp.common.os.*;
13import com.jogamp.common.nio.*;
14import jogamp.common.os.MachineDataInfoRuntime;
15
16import com.jogamp.opencl.llb.impl.CLImageFormatImpl;
17import com.jogamp.opencl.llb.impl.CLImageDescImpl;
18import com.jogamp.opencl.llb.CL20;
19import java.security.AccessController;
20import java.security.PrivilegedAction;
21import com.jogamp.common.nio.PointerBuffer;
22import com.jogamp.common.util.LongLongHashMap;
23import com.jogamp.opencl.CLErrorHandler;
24import com.jogamp.opencl.CLException;
25import java.nio.ByteBuffer;
26import java.nio.IntBuffer;
27import com.jogamp.common.nio.Buffers;
28
29 /**
30 * Struct accessor for cl_image_format.
31 * @author Michael Bien, GlueGen, et al.
32 */
33public class CLImageFormatImpl {
34
35 StructAccessor accessor;
36
37 private static final int mdIdx = MachineDataInfoRuntime.getStatic().ordinal();
38 private final MachineDataInfo md;
39
40 private static final int[] CLImageFormatImpl_size = new int[] { 8 /* ARM_MIPS_32 */, 8 /* X86_32_UNIX */, 8 /* X86_32_ANDROID */, 8 /* X86_32_MACOS */, 8 /* PPC_32_UNIX */, 8 /* SPARC_32_SUNOS */, 8 /* X86_32_WINDOWS */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */, 8 /* ARM64_IOS */ };
41 private static final int[] imageChannelOrder_offset = new int[] { 0 /* ARM_MIPS_32 */, 0 /* X86_32_UNIX */, 0 /* X86_32_ANDROID */, 0 /* X86_32_MACOS */, 0 /* PPC_32_UNIX */, 0 /* SPARC_32_SUNOS */, 0 /* X86_32_WINDOWS */, 0 /* LP64_UNIX */, 0 /* X86_64_WINDOWS */, 0 /* ARM64_IOS */ };
42//private static final int[] imageChannelOrder_size = new int[] { 4 /* ARM_MIPS_32 */, 4 /* X86_32_UNIX */, 4 /* X86_32_ANDROID */, 4 /* X86_32_MACOS */, 4 /* PPC_32_UNIX */, 4 /* SPARC_32_SUNOS */, 4 /* X86_32_WINDOWS */, 4 /* LP64_UNIX */, 4 /* X86_64_WINDOWS */, 4 /* ARM64_IOS */ };
43 private static final int[] imageChannelDataType_offset = new int[] { 4 /* ARM_MIPS_32 */, 4 /* X86_32_UNIX */, 4 /* X86_32_ANDROID */, 4 /* X86_32_MACOS */, 4 /* PPC_32_UNIX */, 4 /* SPARC_32_SUNOS */, 4 /* X86_32_WINDOWS */, 4 /* LP64_UNIX */, 4 /* X86_64_WINDOWS */, 4 /* ARM64_IOS */ };
44//private static final int[] imageChannelDataType_size = new int[] { 4 /* ARM_MIPS_32 */, 4 /* X86_32_UNIX */, 4 /* X86_32_ANDROID */, 4 /* X86_32_MACOS */, 4 /* PPC_32_UNIX */, 4 /* SPARC_32_SUNOS */, 4 /* X86_32_WINDOWS */, 4 /* LP64_UNIX */, 4 /* X86_64_WINDOWS */, 4 /* ARM64_IOS */ };
45
46 /** Returns true if this generated implementation uses native code, otherwise false. */
47 public static boolean usesNativeCode() {
48 return false;
49 }
50
51 /** Returns the aligned total size of a native instance. */
52 public static int size() {
53 return CLImageFormatImpl_size[mdIdx];
54 }
55
56 /** Returns a new instance with all bytes set to zero. */
57 public static CLImageFormatImpl create() {
58 return create(Buffers.newDirectByteBuffer(size()));
59 }
60
61 /** Returns a new instance using the given ByteBuffer having at least {#link size()} bytes capacity. The ByteBuffer will be {@link ByteBuffer#rewind()} and native-order set. */
62 public static CLImageFormatImpl create(java.nio.ByteBuffer buf) {
63 return new CLImageFormatImpl(buf);
64 }
65
66 /** Returns new instance dereferencing ByteBuffer at given native address `addr` with size {@link #size()}. */
67 public static CLImageFormatImpl derefPointer(final long addr) {
68 return create( ElementBuffer.derefPointer(size(), addr, 1).getByteBuffer() );
69 }
70
71 CLImageFormatImpl(java.nio.ByteBuffer buf) {
72 md = MachineDataInfo.StaticConfig.values()[mdIdx].md;
73 accessor = new StructAccessor(buf);
74 }
75
76 /** Return the underlying native direct ByteBuffer */
77 public final java.nio.ByteBuffer getBuffer() {
78 return accessor.getBuffer();
79 }
80
81 /** Returns the native address of the underlying native ByteBuffer {@link #getBuffer()} */
82 public final long getDirectBufferAddress() {
83 return accessor.getDirectBufferAddress();
84 }
85
86 /**
87 * Setter for native field <code>imageChannelOrder</code>, being a <i>struct</i> owned IntType.
88 * <p>
89 * Native Field Signature <code>(IntType) typedef 'cl_channel_order', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
90 * </p>
91 */
93 accessor.setIntAt(imageChannelOrder_offset[mdIdx], src);
94 return this;
95 }
96
97 /**
98 * Getter for native field <code>imageChannelOrder</code>, being a <i>struct</i> owned IntType.
99 * <p>
100 * Native Field Signature <code>(IntType) typedef 'cl_channel_order', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
101 * </p>
102 */
103 public final int getImageChannelOrder() {
104 return accessor.getIntAt(imageChannelOrder_offset[mdIdx]);
105 }
106
107 /**
108 * Setter for native field <code>imageChannelDataType</code>, being a <i>struct</i> owned IntType.
109 * <p>
110 * Native Field Signature <code>(IntType) typedef 'cl_channel_type', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
111 * </p>
112 */
114 accessor.setIntAt(imageChannelDataType_offset[mdIdx], src);
115 return this;
116 }
117
118 /**
119 * Getter for native field <code>imageChannelDataType</code>, being a <i>struct</i> owned IntType.
120 * <p>
121 * Native Field Signature <code>(IntType) typedef 'cl_channel_type', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
122 * </p>
123 */
124 public final int getImageChannelDataType() {
125 return accessor.getIntAt(imageChannelDataType_offset[mdIdx]);
126 }
127
128}
Struct accessor for cl_image_format.
static CLImageFormatImpl create()
Returns a new instance with all bytes set to zero.
final CLImageFormatImpl setImageChannelDataType(int src)
Setter for native field imageChannelDataType, being a struct owned IntType.
final java.nio.ByteBuffer getBuffer()
Return the underlying native direct ByteBuffer.
static CLImageFormatImpl derefPointer(final long addr)
Returns new instance dereferencing ByteBuffer at given native address addr with size size().
static CLImageFormatImpl create(java.nio.ByteBuffer buf)
Returns a new instance using the given ByteBuffer having at least {#link size()} bytes capacity.
final int getImageChannelDataType()
Getter for native field imageChannelDataType, being a struct owned IntType.
final long getDirectBufferAddress()
Returns the native address of the underlying native ByteBuffer getBuffer().
static boolean usesNativeCode()
Returns true if this generated implementation uses native code, otherwise false.
static int size()
Returns the aligned total size of a native instance.
final int getImageChannelOrder()
Getter for native field imageChannelOrder, being a struct owned IntType.
final CLImageFormatImpl setImageChannelOrder(int src)
Setter for native field imageChannelOrder, being a struct owned IntType.