Class: Magick::Image::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/rmagick4j/rmagick4j.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&add) ⇒ Info

Returns a new instance of Info.



305
306
307
308
# File 'lib/rmagick4j/rmagick4j.rb', line 305

def initialize(&add)
	@info = Magick4J.ImageInfo.new
	instance_eval &add if add
end

Instance Attribute Details

#formatObject

Returns the value of attribute format.



299
300
301
# File 'lib/rmagick4j/rmagick4j.rb', line 299

def format
  @format
end

Instance Method Details

#_infoObject



301
302
303
# File 'lib/rmagick4j/rmagick4j.rb', line 301

def _info
	@info
end

#background_color=(background_color) ⇒ Object

TODO Replace with call to Java, or is this the better way? Should it be converted to the Java version only later?



295
296
297
# File 'lib/rmagick4j/rmagick4j.rb', line 295

def background_color= background_color
	@info.setBackgroundColor(Magick4J.ColorDatabase.queryDefault(background_color))
end

#size=(size) ⇒ Object



310
311
312
313
314
315
316
# File 'lib/rmagick4j/rmagick4j.rb', line 310

def size= size
	size = Geometry.from_s(size) if size.is_a? String
	geometry = Magick4J.Geometry.new
	geometry.setWidth(size.width)
	geometry.setHeight(size.height)
	@info.setSize(geometry)
end