Method: UIImage#apply_filter

Defined in:
lib/sugarcube-image/uiimage.rb

#apply_filter(filter) ⇒ Object

Returns a CIImage with the filter applied to the receiver. The return value is a CIImage object, which also defines | to work the same way, so filters can be chained.

Examples:

image = 'test'.uiimage
new_image = image.apply_filter(CIFilter.gaussian_blur)


319
320
321
322
# File 'lib/sugarcube-image/uiimage.rb', line 319

def apply_filter(filter)
  filter.setValue(self.ciimage, forKey: 'inputImage')
  return filter.valueForKey('outputImage')
end