Method: Processing::Image#blend

Defined in:
lib/processing/image.rb

#blend(sx, sy, sw, sh, dx, dy, dw, dh, mode) ⇒ nil #blend(img, sx, sy, sw, sh, dx, dy, dw, dh, mode) ⇒ nil

Blends image.

Parameters:

  • img (Image) (defaults to: nil)

    image for blend source

  • sx (Numeric)

    x position of source region

  • sy (Numeric)

    y position of source region

  • sw (Numeric)

    width of source region

  • sh (Numeric)

    height of source region

  • dx (Numeric)

    x position of destination region

  • dy (Numeric)

    y position of destination region

  • dw (Numeric)

    width of destination region

  • dh (Numeric)

    height of destination region

  • mode (BLEND, ADD, SUBTRACT, LIGHTEST, DARKEST, EXCLUSION, MULTIPLY, SCREEN, REPLACE)

    blend mode

Returns:

  • (nil)

    nil

See Also:



199
200
201
202
203
204
205
# File 'lib/processing/image.rb', line 199

def blend(img = nil, sx, sy, sw, sh, dx, dy, dw, dh, mode)
  img ||= self
  getInternal__.paint do |painter|
    img.drawImage__ painter, sx, sy, sw, sh, dx, dy, dw, dh, blend_mode: mode
  end
  nil
end