updated top the the new version of attachment_fu plugin to work out some
[selectricity-live] / 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 (file)
index 0000000..6160dd8
--- /dev/null
@@ -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

Benjamin Mako Hill || Want to submit a patch?