Class: OpenCL::Sampler

Inherits:
ExtendedStruct show all
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

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

Instance Method Summary collapse

Methods inherited from ExtendedStruct

register_extension

Constructor Details

#initialize(ptr, retain = true) ⇒ Sampler

Creates a new Sampler and retains it if specified and aplicable



1528
1529
1530
1531
1532
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 1528

def initialize(ptr, retain = true)
  super(ptr)
  OpenCL.clRetainSampler(ptr) if retain
  #STDERR.puts "Allocating Sampler: #{ptr}"
end

Instance Method Details

#addressing_modeObject

Returns the OpenCL::Sampler::addressing_mode info

Returns:

  • cl_addressing_mode



82
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 82

get_info("Sampler", :cl_addressing_mode, "addressing_mode")

#contextObject

Returns the context associated with the Sampler



73
74
75
76
77
78
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 73

def context
  ptr = MemoryPointer::new( Context )
  error = OpenCL.clGetSamplerInfo(self, CONTEXT, Context.size, ptr, nil)
  error_check(error)
  return Context::new( ptr.read_pointer )
end

#filter_modeObject

Returns the OpenCL::Sampler::filter_mode info

Returns:

  • cl_filter_mode



83
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 83

get_info("Sampler", :cl_filter_mode, "filter_mode")

#inspectObject



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_coordsObject

Returns the OpenCL::Sampler::normalized_coords info

Returns:

  • cl_bool



81
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 81

get_info("Sampler", :cl_bool, "normalized_coords")

#reference_countObject

Returns the OpenCL::Sampler::reference_count info

Returns:

  • cl_uint



80
# File 'lib/opencl_ruby_ffi/Sampler.rb', line 80

get_info("Sampler", :cl_uint, "reference_count")