X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/a38724bea6c09b479a93948b6ef4ef61edd24f39..e75d29998f5348be83dde4b6fd8f5aa437c2dc74:/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/perspective.rb diff --git a/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/perspective.rb b/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/perspective.rb new file mode 100644 index 0000000..6160dd8 --- /dev/null +++ b/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/perspective.rb @@ -0,0 +1,25 @@ +module RedArtisan + module CoreImage + module Filters + module Perspective + + def perspective(top_left, top_right, bottom_left, bottom_right) + create_core_image_context(@original.extent.size.width, @original.extent.size.height) + + @original.perspective_transform :inputTopLeft => top_left, :inputTopRight => top_right, :inputBottomLeft => bottom_left, :inputBottomRight => bottom_right do |transformed| + @target = transformed + end + end + + def perspective_tiled(top_left, top_right, bottom_left, bottom_right) + create_core_image_context(@original.extent.size.width, @original.extent.size.height) + + @original.perspective_tile :inputTopLeft => top_left, :inputTopRight => top_right, :inputBottomLeft => bottom_left, :inputBottomRight => bottom_right do |tiled| + @target = tiled + end + end + + end + end + end +end \ No newline at end of file