Commit 31dff1e0 authored by Pavel Rojtberg's avatar Pavel Rojtberg

ovis: add more CV_MAT <> Ogre::PixelFormat conversions

parent 6bd26d33
...@@ -43,8 +43,14 @@ void _createTexture(const String& name, Mat image) ...@@ -43,8 +43,14 @@ void _createTexture(const String& name, Mat image)
case CV_8UC1: case CV_8UC1:
format = PF_BYTE_L; format = PF_BYTE_L;
break; break;
case CV_16UC1:
format = PF_L16;
break;
case CV_32FC1:
format = PF_FLOAT32_R;
break;
default: default:
CV_Error(Error::StsBadArg, "currently only CV_8UC1, CV_8UC3, CV_8UC4 textures are supported"); CV_Error(Error::StsBadArg, "currently supported formats are only CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_32FC1");
break; break;
} }
...@@ -388,18 +394,26 @@ public: ...@@ -388,18 +394,26 @@ public:
int dst_type; int dst_type;
switch(src_type) switch(src_type)
{ {
case PF_R8:
case PF_L8:
dst_type = CV_8U;
break;
case PF_BYTE_RGB: case PF_BYTE_RGB:
dst_type = CV_8UC3; dst_type = CV_8UC3;
break; break;
case PF_BYTE_RGBA: case PF_BYTE_RGBA:
dst_type = CV_8UC4; dst_type = CV_8UC4;
break; break;
case PF_FLOAT32_R:
dst_type = CV_32F;
break;
case PF_FLOAT32_RGB: case PF_FLOAT32_RGB:
dst_type = CV_32FC3; dst_type = CV_32FC3;
break; break;
case PF_FLOAT32_RGBA: case PF_FLOAT32_RGBA:
dst_type = CV_32FC4; dst_type = CV_32FC4;
break; break;
case PF_L16:
case PF_DEPTH16: case PF_DEPTH16:
dst_type = CV_16U; dst_type = CV_16U;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment