public
Description: Host your Google AppEngine apps on your own server.
Homepage: http://appdrop.com
Clone URL: git://github.com/jchris/appdrop.git
100644 25 lines (20 sloc) 0.956 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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