lib/ios/sugarcube-image/uiimage.rb in sugarcube-2.0.1 vs lib/ios/sugarcube-image/uiimage.rb in sugarcube-2.0.2
- old
+ new
@@ -412,9 +412,21 @@
darken_filter = CIFilter.color_controls(filter_options)
output = self.apply_filter(darken_filter)
return UIImage.imageWithCIImage(output, scale:self.scale, orientation:self.imageOrientation)
end
+ # Invert the image
+ # @options - none
+ #
+ # @example
+ # image.inverted
+ #
+ # similar to (image | CIFilter.color_invert).uiimage
+ def inverted
+ output = self.apply_filter(CIFilter.color_invert)
+ return UIImage.imageWithCIImage(output, scale:self.scale, orientation:self.imageOrientation)
+ end
+
# Apply a gaussian filter
# @options radius, default: 10
#
# @example
# image.gaussian_blur(radius: 5)