Class: SimpleMapnik::Bounds
- Inherits:
-
Object
- Object
- SimpleMapnik::Bounds
- Includes:
- FFI
- Defined in:
- lib/simple_mapnik/bounds.rb
Constant Summary
Constants included from FFI
Instance Attribute Summary collapse
-
#ptr ⇒ Object
Returns the value of attribute ptr.
-
#x_max ⇒ Object
Returns the value of attribute x_max.
-
#x_min ⇒ Object
Returns the value of attribute x_min.
-
#y_max ⇒ Object
Returns the value of attribute y_max.
-
#y_min ⇒ Object
Returns the value of attribute y_min.
Class Method Summary collapse
Instance Method Summary collapse
- #free ⇒ Object
-
#initialize(x_min, y_min, x_max, y_max) ⇒ Bounds
constructor
A new instance of Bounds.
Methods included from FFI
attach_functions, find_lib, mapnik_c_api_path
Constructor Details
#initialize(x_min, y_min, x_max, y_max) ⇒ Bounds
Returns a new instance of Bounds.
7 8 9 10 11 12 13 14 15 |
# File 'lib/simple_mapnik/bounds.rb', line 7 def initialize(x_min, y_min, x_max, y_max) @x_min = x_min @y_min = y_min @x_max = x_max @y_max = y_max ptr = mapnik_bbox x_min, y_min, x_max, y_max @ptr = ::FFI::AutoPointer.new ptr, self.class.method(:release) @ptr.autorelease = false end |
Instance Attribute Details
#ptr ⇒ Object
Returns the value of attribute ptr.
5 6 7 |
# File 'lib/simple_mapnik/bounds.rb', line 5 def ptr @ptr end |
#x_max ⇒ Object
Returns the value of attribute x_max.
5 6 7 |
# File 'lib/simple_mapnik/bounds.rb', line 5 def x_max @x_max end |
#x_min ⇒ Object
Returns the value of attribute x_min.
5 6 7 |
# File 'lib/simple_mapnik/bounds.rb', line 5 def x_min @x_min end |
#y_max ⇒ Object
Returns the value of attribute y_max.
5 6 7 |
# File 'lib/simple_mapnik/bounds.rb', line 5 def y_max @y_max end |
#y_min ⇒ Object
Returns the value of attribute y_min.
5 6 7 |
# File 'lib/simple_mapnik/bounds.rb', line 5 def y_min @y_min end |
Class Method Details
.release ⇒ Object
17 |
# File 'lib/simple_mapnik/bounds.rb', line 17 def self.release; end |
Instance Method Details
#free ⇒ Object
19 20 21 |
# File 'lib/simple_mapnik/bounds.rb', line 19 def free mapnik_bbox_free @ptr end |