Module: Klear::Filters

Extended by:
Filters
Included in:
Filters
Defined in:
lib/klear/filters.rb

Instance Method Summary collapse

Instance Method Details

#f14jj(values) ⇒ Object

hack: sample(F14 by JJ) 600 down to 2 times 20 => 40 frame positions



13
14
15
16
# File 'lib/klear/filters.rb', line 13

def f14jj values 
  no = -1
  values.select { (no += 1) % 30 == 0 }
end

#project(values, low, high) ⇒ Object

scale input onto manta geometry



3
4
5
6
7
8
9
10
# File 'lib/klear/filters.rb', line 3

def project values, low, high
  #low, high = @config[:low], @config[:high]
  d = (high - low).to_f

  values.map do |val|
    (low + d * (val.to_f / 0xffff)).to_i
  end
end