Class: OpenCL::ImageDesc
- Defined in:
- lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb
Overview
Map the :cl_image_desc type of OpenCL
Instance Method Summary collapse
- #buffer ⇒ Object
- #buffer=(buffer) ⇒ Object
- #image_array_size ⇒ Object
- #image_array_size=(array_size) ⇒ Object
- #image_depth ⇒ Object
- #image_depth=(depth) ⇒ Object
- #image_height ⇒ Object
- #image_height=(height) ⇒ Object
- #image_row_pitch ⇒ Object
- #image_row_pitch=(row_pitch) ⇒ Object
- #image_slice_pitch ⇒ Object
- #image_slice_pitch=(slice_pitch) ⇒ Object
- #image_type ⇒ Object
- #image_type=(type) ⇒ Object
- #image_width ⇒ Object
- #image_width=(width) ⇒ Object
-
#initialize(image_type = nil, image_width = nil, image_height = nil, image_depth = nil, image_array_size = nil, image_row_pitch = nil, image_slice_pitch = nil, num_mip_levels = nil, num_samples = nil, buffer = nil) ⇒ ImageDesc
constructor
Creates anew ImageDesc using the values provided by the user.
- #num_mip_levels ⇒ Object
- #num_mip_levels=(num_mip_levels) ⇒ Object
- #num_samples ⇒ Object
- #num_samples=(num_samples) ⇒ Object
-
#to_s ⇒ Object
Returns a String containing a user friendly representation of the ImageDesc.
Constructor Details
#initialize(image_type = nil, image_width = nil, image_height = nil, image_depth = nil, image_array_size = nil, image_row_pitch = nil, image_slice_pitch = nil, num_mip_levels = nil, num_samples = nil, buffer = nil) ⇒ ImageDesc
Creates anew ImageDesc using the values provided by the user
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 101 def initialize( image_type = nil, image_width = nil, image_height = nil, image_depth = nil, image_array_size = nil, image_row_pitch = nil, image_slice_pitch = nil, num_mip_levels = nil, num_samples = nil, buffer = nil ) if (image_type.is_a?(FFI::Pointer)) super(image_type) else super() self[:image_type] = image_type if image_type self[:image_width] = image_width if image_width self[:image_height] = image_height if image_height self[:image_depth] = image_depth if image_depth self[:image_array_size] = image_array_size if image_array_size self[:image_row_pitch] = image_row_pitch if image_row_pitch self[:image_slice_pitch] = image_slice_pitch if image_slice_pitch self[:num_mip_levels] = num_mip_levels if num_mip_levels self[:num_samples] = num_samples if num_samples self[:buffer] = buffer if buffer end end |
Instance Method Details
#buffer ⇒ Object
191 192 193 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 191 def buffer return self[:buffer] end |
#buffer=(buffer) ⇒ Object
195 196 197 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 195 def buffer=(buffer) return self[:buffer] = buffer end |
#image_array_size ⇒ Object
151 152 153 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 151 def image_array_size return self[:image_array_size] end |
#image_array_size=(array_size) ⇒ Object
155 156 157 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 155 def image_array_size=(array_size) return self[:image_array_size] = array_size end |
#image_depth ⇒ Object
143 144 145 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 143 def image_depth return self[:image_depth] end |
#image_depth=(depth) ⇒ Object
147 148 149 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 147 def image_depth=(depth) return self[:image_depth] = depth end |
#image_height ⇒ Object
135 136 137 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 135 def image_height return self[:image_height] end |
#image_height=(height) ⇒ Object
139 140 141 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 139 def image_height=(height) return self[:image_height] = height end |
#image_row_pitch ⇒ Object
159 160 161 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 159 def image_row_pitch return self[:image_row_pitch] end |
#image_row_pitch=(row_pitch) ⇒ Object
163 164 165 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 163 def image_row_pitch=(row_pitch) return self[:image_row_pitch] = row_pitch end |
#image_slice_pitch ⇒ Object
167 168 169 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 167 def image_slice_pitch return self[:image_slice_pitch] end |
#image_slice_pitch=(slice_pitch) ⇒ Object
171 172 173 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 171 def image_slice_pitch=(slice_pitch) return self[:image_slice_pitch] = slice_pitch end |
#image_type ⇒ Object
119 120 121 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 119 def image_type return Mem::Type.new(self[:image_type]) end |
#image_type=(type) ⇒ Object
123 124 125 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 123 def image_type=(type) return self[:image_type] = type end |
#image_width ⇒ Object
127 128 129 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 127 def image_width return self[:image_width] end |
#image_width=(width) ⇒ Object
131 132 133 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 131 def image_width=(width) return self[:image_width] = width end |
#num_mip_levels ⇒ Object
175 176 177 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 175 def num_mip_levels return self[:num_mip_levels] end |
#num_mip_levels=(num_mip_levels) ⇒ Object
179 180 181 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 179 def num_mip_levels=(num_mip_levels) return self[:num_mip_levels] = num_mip_levels end |
#num_samples ⇒ Object
183 184 185 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 183 def num_samples return self[:num_samples] end |
#num_samples=(num_samples) ⇒ Object
187 188 189 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 187 def num_samples=(num_samples) return self[:num_samples] = num_samples end |
#to_s ⇒ Object
Returns a String containing a user friendly representation of the ImageDesc
200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb', line 200 def to_s return "{ image_type: #{image_type},"\ " image_width: #{self[:image_width]},"\ " image_height: #{self[:image_height]},"\ " image_depth: #{self[:image_depth]},"\ " image_array_size: #{self[:image_array_size]},"\ " image_row_pitch: #{self[:image_row_pitch]},"\ " image_slice_pitch: #{self[:image_slice_pitch]},"\ " num_mip_levels: #{self[:num_mip_levels]},"\ " num_samples: #{self[:num_samples]},"\ " buffer: #{self[:buffer].to_i.to_s(16)} }" end |