JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java™ (public API).
CLImageDescImpl.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 CLImageDescImpl], ../build/gensrc/java/com/jogamp/opencl/llb/impl/CLImageDescImpl.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_desc.
31 * @author Wade Walker, GlueGen, et al.
32 */
33public class CLImageDescImpl {
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[] CLImageDescImpl_size = new int[] { 40 /* ARM_MIPS_32 */, 40 /* X86_32_UNIX */, 40 /* X86_32_ANDROID */, 40 /* X86_32_MACOS */, 40 /* PPC_32_UNIX */, 40 /* SPARC_32_SUNOS */, 40 /* X86_32_WINDOWS */, 72 /* LP64_UNIX */, 72 /* X86_64_WINDOWS */, 72 /* ARM64_IOS */ };
41 private static final int[] imageType_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[] imageType_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[] imageWidth_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 */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */, 8 /* ARM64_IOS */ };
44//private static final int[] imageWidth_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 */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */, 8 /* ARM64_IOS */ };
45 private static final int[] imageHeight_offset = 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 */, 16 /* LP64_UNIX */, 16 /* X86_64_WINDOWS */, 16 /* ARM64_IOS */ };
46//private static final int[] imageHeight_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 */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */, 8 /* ARM64_IOS */ };
47 private static final int[] imageDepth_offset = new int[] { 12 /* ARM_MIPS_32 */, 12 /* X86_32_UNIX */, 12 /* X86_32_ANDROID */, 12 /* X86_32_MACOS */, 12 /* PPC_32_UNIX */, 12 /* SPARC_32_SUNOS */, 12 /* X86_32_WINDOWS */, 24 /* LP64_UNIX */, 24 /* X86_64_WINDOWS */, 24 /* ARM64_IOS */ };
48//private static final int[] imageDepth_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 */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */, 8 /* ARM64_IOS */ };
49 private static final int[] imageArraySize_offset = new int[] { 16 /* ARM_MIPS_32 */, 16 /* X86_32_UNIX */, 16 /* X86_32_ANDROID */, 16 /* X86_32_MACOS */, 16 /* PPC_32_UNIX */, 16 /* SPARC_32_SUNOS */, 16 /* X86_32_WINDOWS */, 32 /* LP64_UNIX */, 32 /* X86_64_WINDOWS */, 32 /* ARM64_IOS */ };
50//private static final int[] imageArraySize_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 */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */, 8 /* ARM64_IOS */ };
51 private static final int[] imageRowPitch_offset = new int[] { 20 /* ARM_MIPS_32 */, 20 /* X86_32_UNIX */, 20 /* X86_32_ANDROID */, 20 /* X86_32_MACOS */, 20 /* PPC_32_UNIX */, 20 /* SPARC_32_SUNOS */, 20 /* X86_32_WINDOWS */, 40 /* LP64_UNIX */, 40 /* X86_64_WINDOWS */, 40 /* ARM64_IOS */ };
52//private static final int[] imageRowPitch_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 */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */, 8 /* ARM64_IOS */ };
53 private static final int[] imageSlicePitch_offset = new int[] { 24 /* ARM_MIPS_32 */, 24 /* X86_32_UNIX */, 24 /* X86_32_ANDROID */, 24 /* X86_32_MACOS */, 24 /* PPC_32_UNIX */, 24 /* SPARC_32_SUNOS */, 24 /* X86_32_WINDOWS */, 48 /* LP64_UNIX */, 48 /* X86_64_WINDOWS */, 48 /* ARM64_IOS */ };
54//private static final int[] imageSlicePitch_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 */, 8 /* LP64_UNIX */, 8 /* X86_64_WINDOWS */, 8 /* ARM64_IOS */ };
55 private static final int[] numMipLevels_offset = new int[] { 28 /* ARM_MIPS_32 */, 28 /* X86_32_UNIX */, 28 /* X86_32_ANDROID */, 28 /* X86_32_MACOS */, 28 /* PPC_32_UNIX */, 28 /* SPARC_32_SUNOS */, 28 /* X86_32_WINDOWS */, 56 /* LP64_UNIX */, 56 /* X86_64_WINDOWS */, 56 /* ARM64_IOS */ };
56//private static final int[] numMipLevels_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 */ };
57 private static final int[] numSamples_offset = new int[] { 32 /* ARM_MIPS_32 */, 32 /* X86_32_UNIX */, 32 /* X86_32_ANDROID */, 32 /* X86_32_MACOS */, 32 /* PPC_32_UNIX */, 32 /* SPARC_32_SUNOS */, 32 /* X86_32_WINDOWS */, 60 /* LP64_UNIX */, 60 /* X86_64_WINDOWS */, 60 /* ARM64_IOS */ };
58//private static final int[] numSamples_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 */ };
59
60 /** Returns true if this generated implementation uses native code, otherwise false. */
61 public static boolean usesNativeCode() {
62 return false;
63 }
64
65 /** Returns the aligned total size of a native instance. */
66 public static int size() {
67 return CLImageDescImpl_size[mdIdx];
68 }
69
70 /** Returns a new instance with all bytes set to zero. */
71 public static CLImageDescImpl create() {
72 return create(Buffers.newDirectByteBuffer(size()));
73 }
74
75 /** 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. */
76 public static CLImageDescImpl create(java.nio.ByteBuffer buf) {
77 return new CLImageDescImpl(buf);
78 }
79
80 /** Returns new instance dereferencing ByteBuffer at given native address `addr` with size {@link #size()}. */
81 public static CLImageDescImpl derefPointer(final long addr) {
82 return create( ElementBuffer.derefPointer(size(), addr, 1).getByteBuffer() );
83 }
84
85 CLImageDescImpl(java.nio.ByteBuffer buf) {
86 md = MachineDataInfo.StaticConfig.values()[mdIdx].md;
87 accessor = new StructAccessor(buf);
88 }
89
90 /** Return the underlying native direct ByteBuffer */
91 public final java.nio.ByteBuffer getBuffer() {
92 return accessor.getBuffer();
93 }
94
95 /** Returns the native address of the underlying native ByteBuffer {@link #getBuffer()} */
96 public final long getDirectBufferAddress() {
97 return accessor.getDirectBufferAddress();
98 }
99
100 /**
101 * Setter for native field <code>imageType</code>, being a <i>struct</i> owned IntType.
102 * <p>
103 * Native Field Signature <code>(IntType) typedef 'cl_mem_object_type', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
104 * </p>
105 */
106 public final CLImageDescImpl setImageType(int src) {
107 accessor.setIntAt(imageType_offset[mdIdx], src);
108 return this;
109 }
110
111 /**
112 * Getter for native field <code>imageType</code>, being a <i>struct</i> owned IntType.
113 * <p>
114 * Native Field Signature <code>(IntType) typedef 'cl_mem_object_type', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
115 * </p>
116 */
117 public final int getImageType() {
118 return accessor.getIntAt(imageType_offset[mdIdx]);
119 }
120
121 /**
122 * Setter for native field <code>imageWidth</code>, being a <i>struct</i> owned IntType.
123 * <p>
124 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
125 * </p>
126 */
127 public final CLImageDescImpl setImageWidth(long src) {
128 accessor.setLongAt(imageWidth_offset[mdIdx], src, md.longSizeInBytes());
129 return this;
130 }
131
132 /**
133 * Getter for native field <code>imageWidth</code>, being a <i>struct</i> owned IntType.
134 * <p>
135 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
136 * </p>
137 */
138 public final long getImageWidth() {
139 return accessor.getLongAt(imageWidth_offset[mdIdx], md.longSizeInBytes());
140 }
141
142 /**
143 * Setter for native field <code>imageHeight</code>, being a <i>struct</i> owned IntType.
144 * <p>
145 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
146 * </p>
147 */
148 public final CLImageDescImpl setImageHeight(long src) {
149 accessor.setLongAt(imageHeight_offset[mdIdx], src, md.longSizeInBytes());
150 return this;
151 }
152
153 /**
154 * Getter for native field <code>imageHeight</code>, being a <i>struct</i> owned IntType.
155 * <p>
156 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
157 * </p>
158 */
159 public final long getImageHeight() {
160 return accessor.getLongAt(imageHeight_offset[mdIdx], md.longSizeInBytes());
161 }
162
163 /**
164 * Setter for native field <code>imageDepth</code>, being a <i>struct</i> owned IntType.
165 * <p>
166 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
167 * </p>
168 */
169 public final CLImageDescImpl setImageDepth(long src) {
170 accessor.setLongAt(imageDepth_offset[mdIdx], src, md.longSizeInBytes());
171 return this;
172 }
173
174 /**
175 * Getter for native field <code>imageDepth</code>, being a <i>struct</i> owned IntType.
176 * <p>
177 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
178 * </p>
179 */
180 public final long getImageDepth() {
181 return accessor.getLongAt(imageDepth_offset[mdIdx], md.longSizeInBytes());
182 }
183
184 /**
185 * Setter for native field <code>imageArraySize</code>, being a <i>struct</i> owned IntType.
186 * <p>
187 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
188 * </p>
189 */
190 public final CLImageDescImpl setImageArraySize(long src) {
191 accessor.setLongAt(imageArraySize_offset[mdIdx], src, md.longSizeInBytes());
192 return this;
193 }
194
195 /**
196 * Getter for native field <code>imageArraySize</code>, being a <i>struct</i> owned IntType.
197 * <p>
198 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
199 * </p>
200 */
201 public final long getImageArraySize() {
202 return accessor.getLongAt(imageArraySize_offset[mdIdx], md.longSizeInBytes());
203 }
204
205 /**
206 * Setter for native field <code>imageRowPitch</code>, being a <i>struct</i> owned IntType.
207 * <p>
208 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
209 * </p>
210 */
211 public final CLImageDescImpl setImageRowPitch(long src) {
212 accessor.setLongAt(imageRowPitch_offset[mdIdx], src, md.longSizeInBytes());
213 return this;
214 }
215
216 /**
217 * Getter for native field <code>imageRowPitch</code>, being a <i>struct</i> owned IntType.
218 * <p>
219 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
220 * </p>
221 */
222 public final long getImageRowPitch() {
223 return accessor.getLongAt(imageRowPitch_offset[mdIdx], md.longSizeInBytes());
224 }
225
226 /**
227 * Setter for native field <code>imageSlicePitch</code>, being a <i>struct</i> owned IntType.
228 * <p>
229 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
230 * </p>
231 */
232 public final CLImageDescImpl setImageSlicePitch(long src) {
233 accessor.setLongAt(imageSlicePitch_offset[mdIdx], src, md.longSizeInBytes());
234 return this;
235 }
236
237 /**
238 * Getter for native field <code>imageSlicePitch</code>, being a <i>struct</i> owned IntType.
239 * <p>
240 * Native Field Signature <code>(IntType) typedef 'size_t', size[fixed false, lnx64 8], const[false], is[primitive, int]</code>
241 * </p>
242 */
243 public final long getImageSlicePitch() {
244 return accessor.getLongAt(imageSlicePitch_offset[mdIdx], md.longSizeInBytes());
245 }
246
247 /**
248 * Setter for native field <code>numMipLevels</code>, being a <i>struct</i> owned IntType.
249 * <p>
250 * Native Field Signature <code>(IntType) typedef 'cl_uint', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
251 * </p>
252 */
253 public final CLImageDescImpl setNumMipLevels(int src) {
254 accessor.setIntAt(numMipLevels_offset[mdIdx], src);
255 return this;
256 }
257
258 /**
259 * Getter for native field <code>numMipLevels</code>, being a <i>struct</i> owned IntType.
260 * <p>
261 * Native Field Signature <code>(IntType) typedef 'cl_uint', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
262 * </p>
263 */
264 public final int getNumMipLevels() {
265 return accessor.getIntAt(numMipLevels_offset[mdIdx]);
266 }
267
268 /**
269 * Setter for native field <code>numSamples</code>, being a <i>struct</i> owned IntType.
270 * <p>
271 * Native Field Signature <code>(IntType) typedef 'cl_uint', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
272 * </p>
273 */
274 public final CLImageDescImpl setNumSamples(int src) {
275 accessor.setIntAt(numSamples_offset[mdIdx], src);
276 return this;
277 }
278
279 /**
280 * Getter for native field <code>numSamples</code>, being a <i>struct</i> owned IntType.
281 * <p>
282 * Native Field Signature <code>(IntType) typedef 'cl_uint', size[fixed true, lnx64 4], const[false], is[primitive, int]</code>
283 * </p>
284 */
285 public final int getNumSamples() {
286 return accessor.getIntAt(numSamples_offset[mdIdx]);
287 }
288
289}
Struct accessor for cl_image_desc.
final CLImageDescImpl setNumMipLevels(int src)
Setter for native field numMipLevels, being a struct owned IntType.
final CLImageDescImpl setImageRowPitch(long src)
Setter for native field imageRowPitch, being a struct owned IntType.
final CLImageDescImpl setImageHeight(long src)
Setter for native field imageHeight, being a struct owned IntType.
final CLImageDescImpl setImageType(int src)
Setter for native field imageType, being a struct owned IntType.
static CLImageDescImpl create(java.nio.ByteBuffer buf)
Returns a new instance using the given ByteBuffer having at least {#link size()} bytes capacity.
final long getImageSlicePitch()
Getter for native field imageSlicePitch, being a struct owned IntType.
static int size()
Returns the aligned total size of a native instance.
final CLImageDescImpl setImageSlicePitch(long src)
Setter for native field imageSlicePitch, being a struct owned IntType.
final CLImageDescImpl setImageDepth(long src)
Setter for native field imageDepth, being a struct owned IntType.
final long getImageHeight()
Getter for native field imageHeight, being a struct owned IntType.
final CLImageDescImpl setNumSamples(int src)
Setter for native field numSamples, being a struct owned IntType.
final long getImageWidth()
Getter for native field imageWidth, being a struct owned IntType.
final long getImageDepth()
Getter for native field imageDepth, being a struct owned IntType.
static boolean usesNativeCode()
Returns true if this generated implementation uses native code, otherwise false.
final java.nio.ByteBuffer getBuffer()
Return the underlying native direct ByteBuffer.
static CLImageDescImpl derefPointer(final long addr)
Returns new instance dereferencing ByteBuffer at given native address addr with size size().
final CLImageDescImpl setImageWidth(long src)
Setter for native field imageWidth, being a struct owned IntType.
static CLImageDescImpl create()
Returns a new instance with all bytes set to zero.
final long getImageArraySize()
Getter for native field imageArraySize, being a struct owned IntType.
final CLImageDescImpl setImageArraySize(long src)
Setter for native field imageArraySize, being a struct owned IntType.
final long getImageRowPitch()
Getter for native field imageRowPitch, being a struct owned IntType.
final int getImageType()
Getter for native field imageType, being a struct owned IntType.
final int getNumMipLevels()
Getter for native field numMipLevels, being a struct owned IntType.
final long getDirectBufferAddress()
Returns the native address of the underlying native ByteBuffer getBuffer().
final int getNumSamples()
Getter for native field numSamples, being a struct owned IntType.