Skip to content

Commit 31dff1e

Browse files
committed
ovis: add more CV_MAT <> Ogre::PixelFormat conversions
1 parent 6bd26d3 commit 31dff1e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

modules/ovis/src/ovis.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ void _createTexture(const String& name, Mat image)
4343
case CV_8UC1:
4444
format = PF_BYTE_L;
4545
break;
46+
case CV_16UC1:
47+
format = PF_L16;
48+
break;
49+
case CV_32FC1:
50+
format = PF_FLOAT32_R;
51+
break;
4652
default:
47-
CV_Error(Error::StsBadArg, "currently only CV_8UC1, CV_8UC3, CV_8UC4 textures are supported");
53+
CV_Error(Error::StsBadArg, "currently supported formats are only CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_32FC1");
4854
break;
4955
}
5056

@@ -388,18 +394,26 @@ class WindowSceneImpl : public WindowScene
388394
int dst_type;
389395
switch(src_type)
390396
{
397+
case PF_R8:
398+
case PF_L8:
399+
dst_type = CV_8U;
400+
break;
391401
case PF_BYTE_RGB:
392402
dst_type = CV_8UC3;
393403
break;
394404
case PF_BYTE_RGBA:
395405
dst_type = CV_8UC4;
396406
break;
407+
case PF_FLOAT32_R:
408+
dst_type = CV_32F;
409+
break;
397410
case PF_FLOAT32_RGB:
398411
dst_type = CV_32FC3;
399412
break;
400413
case PF_FLOAT32_RGBA:
401414
dst_type = CV_32FC4;
402415
break;
416+
case PF_L16:
403417
case PF_DEPTH16:
404418
dst_type = CV_16U;
405419
break;

0 commit comments

Comments
 (0)