Revert "some more fixes towards binary compatibility"

This reverts commit a8c5e35619.

Conflicts:
	modules/imgproc/src/imgwarp.cpp
This commit is contained in:
Andrey Kamaev
2012-10-16 19:35:28 +04:00
parent 3ffe0f0117
commit 18ab16dbd3
5 changed files with 14 additions and 52 deletions

View File

@@ -456,27 +456,18 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
if( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL )
{
CV_Assert( p->type == Param::INT || p->type == Param::REAL || p->type == Param::BOOLEAN ||
(p->type == Param::SHORT && argType == Param::INT) );
CV_Assert( p->type == Param::INT || p->type == Param::REAL || p->type == Param::BOOLEAN );
if( p->type == Param::INT )
{
int val = argType == Param::INT ? *(const int*)value :
argType == Param::BOOLEAN ? (int)*(const bool*)value :
saturate_cast<int>(*(const double*)value);
argType == Param::BOOLEAN ? (int)*(const bool*)value :
saturate_cast<int>(*(const double*)value);
if( p->setter )
(algo->*f.set_int)(val);
else
*(int*)((uchar*)algo + p->offset) = val;
}
else if( p->type == Param::SHORT )
{
int val = *(const int*)value;
if( p->setter )
(algo->*f.set_int)(val);
else
*(short*)((uchar*)algo + p->offset) = (short)val;
}
else if( p->type == Param::BOOLEAN )
{
bool val = argType == Param::INT ? *(const int*)value != 0 :
@@ -563,13 +554,6 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
else
*(double*)value = val;
}
else if( p->type == Param::SHORT )
{
CV_Assert( argType == Param::INT );
int val = p->getter ? (algo->*f.get_int)() : *(short*)((uchar*)algo + p->offset);
*(int*)value = val;
}
else if( p->type == Param::BOOLEAN )
{
CV_Assert( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL );
@@ -655,7 +639,7 @@ void AlgorithmInfo::addParam_(Algorithm& algo, const char* parameter, int argTyp
CV_Assert( argType == Param::INT || argType == Param::BOOLEAN ||
argType == Param::REAL || argType == Param::STRING ||
argType == Param::MAT || argType == Param::MAT_VECTOR ||
argType == Param::ALGORITHM || argType == Param::SHORT );
argType == Param::ALGORITHM );
data->params.add(string(parameter), Param(argType, readOnly,
(int)((size_t)value - (size_t)(void*)&algo),
getter, setter, help));
@@ -672,16 +656,6 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
short& value, bool readOnly,
int (Algorithm::*getter)(),
void (Algorithm::*setter)(int),
const string& help)
{
addParam_(algo, parameter, ParamType<int>::type, &value, readOnly,
(Algorithm::Getter)getter, (Algorithm::Setter)setter, help);
}
void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
bool& value, bool readOnly,
int (Algorithm::*getter)(),