Class: OpenCV::Cv::Rect
- Inherits:
-
Object
- Object
- OpenCV::Cv::Rect
- Extended by:
- FFI::DataConverter
- Defined in:
- lib/ropencv/ropencv_types.rb
Class Method Summary collapse
- .new(*args) ⇒ Object
-
.null ⇒ Object
returns a null pointer to the object.
Instance Method Summary collapse
- #area ⇒ Fixnum
- #br ⇒ Cv::Point
- #contains(point) ⇒ Bool
- #height ⇒ Fixnum (also: #get_height)
- #height=(value) ⇒ Void (also: #set_height)
- #size ⇒ Cv::Size
- #tl ⇒ Cv::Point
-
#to_s ⇒ Object
converts Rect into a string by crawling through all its attributes.
- #width ⇒ Fixnum (also: #get_width)
- #width=(value) ⇒ Void (also: #set_width)
-
#x ⇒ Fixnum
(also: #get_x)
methods.
- #x=(value) ⇒ Void (also: #set_x)
- #y ⇒ Fixnum (also: #get_y)
- #y=(value) ⇒ Void (also: #set_y)
Class Method Details
.rect ⇒ Object .rect(rect) ⇒ Object .rect(x, y, width, height) ⇒ Object
18066 18067 18068 18069 18070 18071 18072 18073 18074 18075 18076 18077 18078 18079 18080 18081 18082 18083 18084 18085 18086 18087 18088 18089 18090 18091 18092 18093 18094 18095 18096 18097 18098 18099 18100 18101 18102 18103 18104 18105 18106 18107 18108 18109 18110 18111 18112 18113 18114 |
# File 'lib/ropencv/ropencv_types.rb', line 18066 def self.new(*args) if args.first.is_a?(FFI::Pointer) || args.first.is_a?(RectStruct) raise ArgumentError, "too many arguments for creating #{self.name} from Pointer" unless args.size == 1 return super(args.first) end # overloaded method wrapper for cv::Rect::Rect() @@cv_rect_rect_defaults0 ||= [] if(args.size >= 0 && args.size <= 0) targs = args.clone targs.size.upto(-1) do |i| targs[i] = @@cv_rect_rect_defaults0[i] end begin return Rbind::cv_rect_rect(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for cv::Rect::Rect(const cv::Rect rect) @@cv_rect_rect__2_defaults1 ||= [nil] if(args.size >= 1 && args.size <= 1) targs = args.clone targs.size.upto(0) do |i| targs[i] = @@cv_rect_rect__2_defaults1[i] end begin return Rbind::cv_rect_rect__2(*targs) rescue TypeError => e @error = e end end # overloaded method wrapper for cv::Rect::Rect(int x, int y, int width, int height) @@cv_rect_rect__3_defaults2 ||= [nil, nil, nil, nil] if(args.size >= 4 && args.size <= 4) targs = args.clone targs.size.upto(3) do |i| targs[i] = @@cv_rect_rect__3_defaults2[i] end begin return Rbind::cv_rect_rect__3(*targs) rescue TypeError => e @error = e end end raise ArgumentError, "no constructor for #{self}(#{args.inspect})" end |
.null ⇒ Object
returns a null pointer to the object
18052 18053 18054 |
# File 'lib/ropencv/ropencv_types.rb', line 18052 def self.null new(RectStruct.new) end |
Instance Method Details
#area ⇒ Fixnum
Note:
method wrapper for int cv::Rect::area()
18295 18296 18297 18298 |
# File 'lib/ropencv/ropencv_types.rb', line 18295 def area() __validate_pointer__ Rbind::cv_rect_area( self) end |
#br ⇒ Cv::Point
Note:
method wrapper for const cv::Point cv::Rect::br()
18271 18272 18273 18274 18275 18276 18277 18278 18279 |
# File 'lib/ropencv/ropencv_types.rb', line 18271 def br() __validate_pointer__ result = Rbind::cv_rect_br( self) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#contains(point) ⇒ Bool
Note:
method wrapper for bool cv::Rect::contains(const cv::Point point)
18303 18304 18305 18306 |
# File 'lib/ropencv/ropencv_types.rb', line 18303 def contains(point) __validate_pointer__ Rbind::cv_rect_contains( self, point) end |
#height ⇒ Fixnum Also known as: get_height
Note:
method wrapper for int height
18242 18243 18244 18245 |
# File 'lib/ropencv/ropencv_types.rb', line 18242 def height() __validate_pointer__ Rbind::cv_rect_get_height( self) end |
#height=(value) ⇒ Void Also known as: set_height
Note:
method wrapper for int height
18251 18252 18253 18254 |
# File 'lib/ropencv/ropencv_types.rb', line 18251 def height=(value) __validate_pointer__ Rbind::cv_rect_set_height( self, value) end |
#size ⇒ Cv::Size
Note:
method wrapper for const cv::Size cv::Rect::size()
18283 18284 18285 18286 18287 18288 18289 18290 18291 |
# File 'lib/ropencv/ropencv_types.rb', line 18283 def size() __validate_pointer__ result = Rbind::cv_rect_size( self) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#tl ⇒ Cv::Point
Note:
method wrapper for const cv::Point cv::Rect::tl()
18259 18260 18261 18262 18263 18264 18265 18266 18267 |
# File 'lib/ropencv/ropencv_types.rb', line 18259 def tl() __validate_pointer__ result = Rbind::cv_rect_tl( self) if result.respond_to?(:__owner__?) && !result.__owner__? # store owner insight the pointer to not get garbage collected result.instance_variable_get(:@__obj_ptr__).instance_variable_set(:@__owner__,self) end result end |
#to_s ⇒ Object
converts Rect into a string by crawling through all its attributes
18180 18181 18182 |
# File 'lib/ropencv/ropencv_types.rb', line 18180 def to_s "#<cv::Rect x=#{self.x} y=#{self.y} width=#{self.width} height=#{self.height}>" end |
#width ⇒ Fixnum Also known as: get_width
Note:
method wrapper for int width
18225 18226 18227 18228 |
# File 'lib/ropencv/ropencv_types.rb', line 18225 def width() __validate_pointer__ Rbind::cv_rect_get_width( self) end |
#width=(value) ⇒ Void Also known as: set_width
Note:
method wrapper for int width
18234 18235 18236 18237 |
# File 'lib/ropencv/ropencv_types.rb', line 18234 def width=(value) __validate_pointer__ Rbind::cv_rect_set_width( self, value) end |
#x ⇒ Fixnum Also known as: get_x
Note:
method wrapper for int x
methods
18191 18192 18193 18194 |
# File 'lib/ropencv/ropencv_types.rb', line 18191 def x() __validate_pointer__ Rbind::cv_rect_getx( self) end |
#x=(value) ⇒ Void Also known as: set_x
Note:
method wrapper for int x
18200 18201 18202 18203 |
# File 'lib/ropencv/ropencv_types.rb', line 18200 def x=(value) __validate_pointer__ Rbind::cv_rect_setx( self, value) end |
#y ⇒ Fixnum Also known as: get_y
Note:
method wrapper for int y
18208 18209 18210 18211 |
# File 'lib/ropencv/ropencv_types.rb', line 18208 def y() __validate_pointer__ Rbind::cv_rect_gety( self) end |
#y=(value) ⇒ Void Also known as: set_y
Note:
method wrapper for int y
18217 18218 18219 18220 |
# File 'lib/ropencv/ropencv_types.rb', line 18217 def y=(value) __validate_pointer__ Rbind::cv_rect_sety( self, value) end |