29package com.jogamp.opencl;
31import com.jogamp.common.nio.PointerBuffer;
32import com.jogamp.opencl.impl.CLTLInfoAccessor;
33import com.jogamp.opencl.llb.CL;
35import java.nio.Buffer;
37import static com.jogamp.opencl.CLException.*;
38import static com.jogamp.opencl.llb.CL.*;
39import static com.jogamp.opencl.util.CLUtil.*;
48 private final CLSamplerInfoAccessor samplerInfo;
49 private final CL binding;
54 this.samplerInfo =
new CLSamplerInfoAccessor();
58 final int[] error =
new int[1];
63 checkForError(error[0],
"can not create sampler");
68 final int info = (int)samplerInfo.getLong(CL_SAMPLER_FILTER_MODE);
73 final int info = (int)samplerInfo.getLong(CL_SAMPLER_ADDRESSING_MODE);
78 return samplerInfo.getLong(CL_SAMPLER_NORMALIZED_COORDS) == CL_TRUE;
85 context.onSamplerReleased(
this);
86 if(ret != CL_SUCCESS) {
87 throw newException(ret,
"can not release "+
this);
94 protected int getInfo(
final int name,
final long valueSize,
final Buffer value,
final PointerBuffer valueSizeRet) {
116 case(CL_FILTER_NEAREST):
118 case(CL_FILTER_LINEAR):
143 case(CL_ADDRESS_REPEAT):
145 case(CL_ADDRESS_CLAMP_TO_EDGE):
146 return CLAMP_TO_EDGE;
147 case(CL_ADDRESS_CLAMP):
149 case(CL_ADDRESS_NONE):
CLContext is responsible for managing objects such as command-queues, memory, program and kernel obje...
CLPlatform getPlatform()
Returns the CLPlatform this context is running on.
final long ID
The OpenCL object handle.
Object representing an OpenCL sampler.
boolean hasNormalizedCoords()
AddressingMode getAddressingMode()
void release()
Releases the OpenCL resource.
FilteringMode getFilteringMode()
Internal utility for common OpenCL clGetFooInfo calls.
final int MODE
Value of wrapped OpenCL sampler addressing mode type.
static AddressingMode valueOf(final int mode)
static FilteringMode valueOf(final int mode)
final int MODE
Value of wrapped OpenCL sampler filtering mode type.
Java bindings to OpenCL, the Open Computing Language.
int clReleaseSampler(long sampler)
Interface to C language function: cl_int {@native clReleaseSampler}(cl_sampler sampler)
long clCreateSampler(long context, int normalized_coords, int addressing_mode, int filter_mode, IntBuffer errcode_ret)
Interface to C language function: cl_sampler {@native clCreateSampler}(cl_context context,...
int clGetSamplerInfo(long sampler, int param_name, long param_value_size, Buffer param_value, PointerBuffer param_value_size_ret)
Interface to C language function: cl_int {@native clGetSamplerInfo}(cl_sampler sampler,...