lib/chunky_png/color.rb
# Returns the number of sample values per pixel.
# @param [Integer] color_mode The color mode being used.
# @return [Integer] The number of sample values per pixel.
Returns the number of sample values per pixel.
Returns the number of sample values per pixel .
def samples_per_pixel(color_mode)
      case color_mode
        when ChunkyPNG::COLOR_INDEXED         then 1
        when ChunkyPNG::COLOR_TRUECOLOR       then 3
        when ChunkyPNG::COLOR_TRUECOLOR_ALPHA then 4
        when ChunkyPNG::COLOR_GRAYSCALE       then 1
        when ChunkyPNG::COLOR_GRAYSCALE_ALPHA then 2
        else raise ChunkyPNG::NotSupported, "Don't know the number of samples for this colormode: #{color_mode}!"
      end
    end
def samples_per_pixel ( color_mode ) case color_mode when ChunkyPNG :: COLOR_INDEXED then 1 when ChunkyPNG :: COLOR_TRUECOLOR then 3 when ChunkyPNG :: COLOR_TRUECOLOR_ALPHA then 4 when ChunkyPNG :: COLOR_GRAYSCALE then 1 when ChunkyPNG :: COLOR_GRAYSCALE_ALPHA then 2 else raise ChunkyPNG :: NotSupported , "Don't know the number of samples for this colormode: #{color_mode}!" end end
Returns the number of sample values per pixel.
Returns the number of sample values per pixel .
The number of sample values per pixel.
The number of sample values per pixel .
Integer
color_mode
<not_specific>
<not_specific>
color_mode The color mode being used.
color_mode The color mode being used .