examples/histogram.rb
# Use AnnotateImage to write the stats.
Use AnnotateImage to write the stats.
Use AnnotateImage to write the stats .
def info_text(fg, bg)
      klass = class_type == DirectClass ? 'DirectClass' : 'PsuedoClass'
      text = <<~END_TEXT
        Format: #{format}
        Geometry: #{columns}x#{rows}
        Class: #{klass}
        Depth: #{depth} bits-per-pixel component
        Colors: #{number_colors}
      END_TEXT
      info = Image.new(HISTOGRAM_COLS, HISTOGRAM_ROWS) do |options|
        options.background_color = bg
        options.border_color = fg
      end
      gc = Draw.new
      gc.annotate(info, 0, 0, 0, 0, text) do |options|
        options.stroke = 'transparent'
        options.fill = fg
        options.gravity = CenterGravity
      end
      info['Label'] = 'Info'
      info
    end
def info_text ( fg , bg ) klass = class_type == DirectClass ? 'DirectClass' : 'PsuedoClass' text = <<~END_TEXT 
        Format:  #{ format } 
        Geometry:  #{ columns } x #{ rows } 
        Class:  #{ klass } 
        Depth:  #{ depth }  bits-per-pixel component
        Colors:  #{ number_colors } END_TEXT info = Image . new ( HISTOGRAM_COLS , HISTOGRAM_ROWS ) do | options | options . background_color = bg options . border_color = fg end gc = Draw . new gc . annotate ( info , 0 , 0 , 0 , 0 , text ) do | options | options . stroke = 'transparent' options . fill = fg options . gravity = CenterGravity end info [ 'Label' ] = 'Info' info end
Use AnnotateImage to write the stats.
Use AnnotateImage to write the stats .
fg
<not_specific>
bg
<not_specific>