本文整理汇总了Java中org.lwjgl.opencl.api.CLImageFormat类的典型用法代码示例。如果您正苦于以下问题:Java CLImageFormat类的具体用法?Java CLImageFormat怎么用?Java CLImageFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CLImageFormat类属于org.lwjgl.opencl.api包,在下文中一共展示了CLImageFormat类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSupportedImageFormats
import org.lwjgl.opencl.api.CLImageFormat; //导入依赖的package包/类
public List<CLImageFormat> getSupportedImageFormats(final CLContext context, final long flags, final int image_type, final Filter<CLImageFormat> filter) {
final IntBuffer numBuffer = APIUtil.getBufferInt();
clGetSupportedImageFormats(context, flags, image_type, null, numBuffer);
final int num_image_formats = numBuffer.get(0);
if ( num_image_formats == 0 )
return null;
final ByteBuffer formatBuffer = BufferUtils.createByteBuffer(num_image_formats * CLImageFormat.STRUCT_SIZE);
clGetSupportedImageFormats(context, flags, image_type, formatBuffer, null);
final List<CLImageFormat> formats = new ArrayList<CLImageFormat>(num_image_formats);
for ( int i = 0; i < num_image_formats; i++ ) {
final int offset = num_image_formats * CLImageFormat.STRUCT_SIZE;
final CLImageFormat format = new CLImageFormat(
formatBuffer.getInt(offset),
formatBuffer.getInt(offset + 4)
);
if ( filter == null || filter.accept(format) )
formats.add(format);
}
return formats.size() == 0 ? null : formats;
}
示例2: createImage2D
import org.lwjgl.opencl.api.CLImageFormat; //导入依赖的package包/类
public CLMem createImage2D(final CLContext context, final long flags, final CLImageFormat image_format, final long image_width, final long image_height, final long image_row_pitch, final Buffer host_ptr, IntBuffer errcode_ret) {
final ByteBuffer formatBuffer = APIUtil.getBufferByte(2 * 4);
formatBuffer.putInt(0, image_format.getChannelOrder());
formatBuffer.putInt(4, image_format.getChannelType());
final long function_pointer = CLCapabilities.clCreateImage2D;
BufferChecks.checkFunctionAddress(function_pointer);
if ( errcode_ret != null )
BufferChecks.checkBuffer(errcode_ret, 1);
else if ( LWJGLUtil.DEBUG )
errcode_ret = APIUtil.getBufferInt();
CLMem __result = new CLMem(nclCreateImage2D(context.getPointer(), flags, MemoryUtil.getAddress(formatBuffer, 0), image_width, image_height, image_row_pitch, MemoryUtil.getAddress0Safe(host_ptr) +
(host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage2DSize(formatBuffer, image_width, image_height, image_row_pitch)) : 0),
MemoryUtil.getAddressSafe(errcode_ret), function_pointer), context);
if ( LWJGLUtil.DEBUG )
Util.checkCLError(errcode_ret.get(0));
return __result;
}
示例3: createImage3D
import org.lwjgl.opencl.api.CLImageFormat; //导入依赖的package包/类
public CLMem createImage3D(final CLContext context, final long flags, final CLImageFormat image_format, final long image_width, final long image_height, final long image_depth, final long image_row_pitch, final long image_slice_pitch, final Buffer host_ptr, IntBuffer errcode_ret) {
final ByteBuffer formatBuffer = APIUtil.getBufferByte(2 * 4);
formatBuffer.putInt(0, image_format.getChannelOrder());
formatBuffer.putInt(4, image_format.getChannelType());
final long function_pointer = CLCapabilities.clCreateImage3D;
BufferChecks.checkFunctionAddress(function_pointer);
if ( errcode_ret != null )
BufferChecks.checkBuffer(errcode_ret, 1);
else if ( LWJGLUtil.DEBUG )
errcode_ret = APIUtil.getBufferInt();
CLMem __result = new CLMem(nclCreateImage3D(context.getPointer(), flags, MemoryUtil.getAddress(formatBuffer, 0), image_width, image_height, image_depth, image_row_pitch, image_slice_pitch, MemoryUtil.getAddress0Safe(host_ptr) +
(host_ptr != null ? BufferChecks.checkBuffer(host_ptr, CLChecks.calculateImage3DSize(formatBuffer, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch)) : 0),
MemoryUtil.getAddressSafe(errcode_ret), function_pointer), context);
if ( LWJGLUtil.DEBUG )
Util.checkCLError(errcode_ret.get(0));
return __result;
}
示例4: getSupportedImageFormats
import org.lwjgl.opencl.api.CLImageFormat; //导入依赖的package包/类
public List<CLImageFormat> getSupportedImageFormats(final long flags, final int image_type) {
return getSupportedImageFormats(flags, image_type, null);
}
示例5: getImageInfoFormat
import org.lwjgl.opencl.api.CLImageFormat; //导入依赖的package包/类
public CLImageFormat getImageInfoFormat(final CLMem mem) {
mem.checkValid();
final ByteBuffer format = APIUtil.getBufferByte(2 * 4);
clGetImageInfo(mem, CL_IMAGE_FORMAT, format, null);
return new CLImageFormat(format.getInt(0), format.getInt(4));
}