lib/chunky_png/canvas/resampling.rb
# Integer Interpolation between two values
#
# Used for generating indicies for interpolation (eg, nearest
# neighbour).
#
# @param [Integer] width The width of the source
# @param [Integer] new_width The width of the destination
# @return [Array<Integer>] An Array of Integer indicies
Integer Interpolation between two values
Used for generating indicies for interpolation .
Integer Interpolation between two values Used for generating indicies for interpolation .
def steps(width, new_width)
        indicies, residues = steps_residues(width, new_width)
        for i in 1..new_width
          indicies[i - 1] = (indicies[i - 1] + (residues[i - 1] + 127) / 255)
        end
        indicies
      end
def steps ( width , new_width ) indicies , residues = steps_residues ( width , new_width ) for i in 1 .. new_width indicies [ i - 1 ] = ( indicies [ i - 1 ] + ( residues [ i - 1 ] + 127 ) / 255 ) end indicies end
Integer Interpolation between two values
Used for generating indicies for interpolation (eg, nearest
neighbour).
Integer Interpolation between two values Used for generating indicies for interpolation ( eg nearest neighbour ) .
An Array of Integer indicies
An Array of Integer indicies
Array<Integer>
width
<not_specific>
new_width
<not_specific>
<not_specific>
new_width The width of the destination
new_width The width of the destination