merged in from code from the other master
[selectricity-live] / vendor / plugins / attachment_fu / vendor / red_artisan / core_image / filters / perspective.rb
1 module RedArtisan
2   module CoreImage
3     module Filters
4       module Perspective
5         
6         def perspective(top_left, top_right, bottom_left, bottom_right)
7           create_core_image_context(@original.extent.size.width, @original.extent.size.height)
8           
9           @original.perspective_transform :inputTopLeft => top_left, :inputTopRight => top_right, :inputBottomLeft => bottom_left, :inputBottomRight => bottom_right do |transformed|
10             @target = transformed
11           end
12         end
13
14         def perspective_tiled(top_left, top_right, bottom_left, bottom_right)
15           create_core_image_context(@original.extent.size.width, @original.extent.size.height)
16           
17           @original.perspective_tile :inputTopLeft => top_left, :inputTopRight => top_right, :inputBottomLeft => bottom_left, :inputBottomRight => bottom_right do |tiled|
18             @target = tiled
19           end
20         end
21         
22       end
23     end
24   end
25 end

Benjamin Mako Hill || Want to submit a patch?