Method: Processing::GraphicsContext#updatePixels

Defined in:
lib/processing/graphics_context.rb

#updatePixels(&block) ⇒ nil

Update the image pixels with the ‘pixels’ array.



2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
# File 'lib/processing/graphics_context.rb', line 2098

def updatePixels(&block)
  return if !block && !@pixels__
  if block
    loadPixels
    block.call pixels
  end
  getInternal__.tap do |img|
    img.pixels = @pixels__
    img.paint {} # update texture and set modifiied
  end
  @pixels__ = nil
end