Sha256: c302ecef52d7ec2384216bfa68d3ff5e92ca5fb6b21701266784f0952efdf223

Contents?: true

Size: 445 Bytes

Versions: 4

Compression:

Stored size: 445 Bytes

Contents

require 'ruby-processing'

class BrightnessThresholdWithFilterSketch < Processing::App

  def setup
    @img = load_image 'sunflower.jpg'
  end

  def draw
    # Draw the image
    image @img, 0, 0
    # Filter the window with a threshold effect
    # 0.5 means threshold is 50% brightness
    filter THRESHOLD, 0.5
  end

end

BrightnessThresholdWithFilterSketch.new :title => "Brightness Threshold With Filter", :width => 200, :height => 200

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-processing-1.0.1 samples/learning_processing/chapter_15/11_brightness_threshold_with_filter.rb
ruby-processing-1.0.2 samples/learning_processing/chapter_15/11_brightness_threshold_with_filter.rb
ruby-processing-1.0.3 samples/learning_processing/chapter_15/11_brightness_threshold_with_filter.rb
ruby-processing-1.0.4 samples/learning_processing/chapter_15/11_brightness_threshold_with_filter.rb