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

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



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_modeObject

Returns the OpenCL::Sampler::addressing_mode info

Returns:

  • cl_addressing_mode



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

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

#contextObject

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_modeObject

Returns the OpenCL::Sampler::filter_mode info

Returns:

  • cl_filter_mode



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

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



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

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

#reference_countObject

Returns the OpenCL::Sampler::reference_count info

Returns:

  • cl_uint



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