Class: AAlib::RenderParams

Inherits:
CPtr show all
Defined in:
lib/aalib.rb

Constant Summary collapse

TYPE =

:nodoc:

'IIFIII'
NAMES =

:nodoc:

[:bright, :contrast, :gamma, :dither, :inversion, :randomval]
DEFAULT =

Notably defined before we redifine initialize() to take no arguments

new(Foreign.defrenderparams).freeze

Instance Method Summary collapse

Methods inherited from CPtr

#[], #[]=, #inspect, new_ptr

Methods included from ArgumentChecks

included

Methods inherited from DL::PtrData

#string?

Constructor Details

#initializeRenderParams

Returns a new instance of RenderParams.



511
512
513
514
# File 'lib/aalib.rb', line 511

def initialize
  super
  copy_from(DEFAULT)
end

Instance Method Details

#copy_from(other) ⇒ Object



516
517
518
519
520
521
# File 'lib/aalib.rb', line 516

def copy_from(other)
  NAMES.each do |get|
    set = (get.to_s + '=').to_sym
    self.send(set, other.send(get))
  end
end