lib/psd_native/compose.rb in psd_native-0.4.0 vs lib/psd_native/compose.rb in psd_native-0.5.0
- old
+ new
@@ -1,11 +1,19 @@
require 'psd'
require 'psd_native/psd_native'
class PSD
module Compose
- def normal(fg, bg, opts={})
+ PSDNative::Compose.methods(false).each do |meth|
+ define_method(meth) do |*args|
+ do_blend meth, *args
+ end
+ end
+
+ private
+
+ def do_blend(blend, fg, bg, opts={})
opts = DEFAULT_OPTS.merge(opts)
- PSDNative::Compose.normal(fg, bg, opts)
+ PSDNative::Compose.send(blend, fg, bg, opts)
end
end
end
\ No newline at end of file