Method: Vips::Image#ifthenelse
- Defined in:
- lib/vips/image.rb
#ifthenelse(th, el, opts = {}) ⇒ Image
Select pixels from th if self is non-zero and from el if
self is zero. Use the :blend option to fade smoothly
between th and el.
1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 |
# File 'lib/vips/image.rb', line 1239 def ifthenelse(th, el, opts = {}) match_image = [th, el, self].find {|x| x.is_a? Vips::Image} if not th.is_a? Vips::Image th = Argument::imageize match_image, th end if not el.is_a? Vips::Image el = Argument::imageize match_image, el end Vips::call_base "ifthenelse", self, "", [th, el, opts] end |