mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
added type check to some CvMat methods (6)
This commit is contained in:
parent
1dc04e0e3d
commit
0d56ef2762
4 changed files with 287 additions and 59 deletions
|
@ -32,6 +32,23 @@ VALUE rb_anchor_y(VALUE self);
|
|||
|
||||
__NAMESPACE_END_IPLCONVKERNEL
|
||||
|
||||
inline IplConvKernel*
|
||||
IPLCONVKERNEL(VALUE object)
|
||||
{
|
||||
IplConvKernel *ptr;
|
||||
Data_Get_Struct(object, IplConvKernel, ptr);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline IplConvKernel*
|
||||
IPLCONVKERNEL_WITH_CHECK(VALUE object)
|
||||
{
|
||||
if (!rb_obj_is_kind_of(object, cIplConvKernel::rb_class()))
|
||||
raise_typeerror(object, cIplConvKernel::rb_class());
|
||||
return IPLCONVKERNEL(object);
|
||||
}
|
||||
|
||||
/*
|
||||
inline IplConvKernel*
|
||||
IPLCONVKERNEL(VALUE object)
|
||||
{
|
||||
|
@ -41,11 +58,13 @@ IPLCONVKERNEL(VALUE object)
|
|||
else if (rb_obj_is_kind_of(object, cIplConvKernel::rb_class())) {
|
||||
Data_Get_Struct(object, IplConvKernel, ptr);
|
||||
return ptr;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rb_warn("invalid kernel. use default kernel (3x3 rectangle).");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
__NAMESPACE_END_OPENCV
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue