Class: OpenCL::Sampler
- Inherits:
-
ExtendedStruct
- Object
- ManagedStruct
- ExtendedStruct
- OpenCL::Sampler
- Defined in:
- lib/opencl_ruby_ffi/Sampler.rb,
lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb
Overview
Maps the cl_sampler object of OpenCL
Instance Method Summary collapse
-
#addressing_mode ⇒ Object
Returns the OpenCL::Sampler::addressing_mode info.
-
#context ⇒ Object
Returns the context associated with the Sampler.
-
#filter_mode ⇒ Object
Returns the OpenCL::Sampler::filter_mode info.
-
#initialize(ptr, retain = true) ⇒ Sampler
constructor
Creates a new Sampler and retains it if specified and aplicable.
- #inspect ⇒ Object
-
#normalized_coords ⇒ Object
Returns the OpenCL::Sampler::normalized_coords info.
-
#reference_count ⇒ Object
Returns the OpenCL::Sampler::reference_count info.
Methods inherited from ExtendedStruct
Constructor Details
#initialize(ptr, retain = true) ⇒ Sampler
Creates a new Sampler and retains it if specified and aplicable
1597 1598 1599 1600 1601 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 1597 def initialize(ptr, retain = true) super(ptr) OpenCL.clRetainSampler(ptr) if retain #STDERR.puts "Allocating Sampler: #{ptr}" end |
Instance Method Details
#addressing_mode ⇒ Object
Returns the OpenCL::Sampler::addressing_mode info
84 |
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 84 get_info("Sampler", :cl_addressing_mode, "addressing_mode") |
#context ⇒ Object
Returns the context associated with the Sampler
73 74 75 76 77 78 79 80 |
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 73 def context @_context ||= begin ptr = MemoryPointer::new( Context ) error = OpenCL.clGetSamplerInfo(self, CONTEXT, Context.size, ptr, nil) error_check(error) Context::new( ptr.read_pointer ) end end |
#filter_mode ⇒ Object
Returns the OpenCL::Sampler::filter_mode info
85 |
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 85 get_info("Sampler", :cl_filter_mode, "filter_mode") |
#inspect ⇒ Object
68 69 70 |
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 68 def inspect return "#<#{self.class.name}: #{addressing_mode} #{filter_mode} normalized: #{normalized_coords}>" end |
#normalized_coords ⇒ Object
Returns the OpenCL::Sampler::normalized_coords info
83 |
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 83 get_info("Sampler", :cl_bool, "normalized_coords") |
#reference_count ⇒ Object
Returns the OpenCL::Sampler::reference_count info
82 |
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 82 get_info("Sampler", :cl_uint, "reference_count") |
Constant Summary collapse
- REFERENCE_COUNT =
0x1150
- CONTEXT =
0x1151
- NORMALIZED_COORDS =
0x1152
- ADDRESSING_MODE =
0x1153
- FILTER_MODE =
0x1154
- MIP_FILTER_MODE =
0x1155
- LOD_MIN =
0x1156
- LOD_MAX =
0x1157