plottype = buildMatplotType(MATPLOT_Char, (DataOrder)dataorder, (ImageType)imagetype);
bRGB = true;
}
- else if (piDimsArray[2] != 1 && (DataType)datatype != MATPLOT_HM1_Char)
+ else if (piDimsArray[2] == 1 && (DataType)datatype != MATPLOT_HM1_Char)
{
plottype = buildMatplotType(MATPLOT_HM1_Char, (DataOrder)dataorder, (ImageType)imagetype);
}
- else if (piDimsArray[2] != 3 && (DataType)datatype != MATPLOT_HM3_Char)
+ else if (piDimsArray[2] == 3 && (DataType)datatype != MATPLOT_HM3_Char)
{
plottype = buildMatplotType(MATPLOT_HM3_Char, (DataOrder)dataorder, (ImageType)imagetype);
}
- else if (piDimsArray[2] != 4 && (DataType)datatype != MATPLOT_HM4_Char)
+ else if (piDimsArray[2] == 4 && (DataType)datatype != MATPLOT_HM4_Char)
{
plottype = buildMatplotType(MATPLOT_HM4_Char, (DataOrder)dataorder, (ImageType)imagetype);
}
plottype = buildMatplotType(MATPLOT_UChar, (DataOrder)dataorder, (ImageType)imagetype);
bRGB = true;
}
- else if ((DataType)datatype != MATPLOT_HM1_Char)
+ else if (piDimsArray[2] == 1 && (DataType)datatype != MATPLOT_HM1_UChar)
{
plottype = buildMatplotType(MATPLOT_HM1_UChar, (DataOrder)dataorder, (ImageType)imagetype);
}
- else if (piDimsArray[2] != 3 && (DataType)datatype != MATPLOT_HM3_UChar)
+ else if (piDimsArray[2] == 3 && (DataType)datatype != MATPLOT_HM3_UChar)
{
plottype = buildMatplotType(MATPLOT_HM3_UChar, (DataOrder)dataorder, (ImageType)imagetype);
}
- else if (piDimsArray[2] != 4 && (DataType)datatype != MATPLOT_HM4_UChar)
+ else if (piDimsArray[2] == 4 && (DataType)datatype != MATPLOT_HM4_UChar)
{
plottype = buildMatplotType(MATPLOT_HM4_UChar, (DataOrder)dataorder, (ImageType)imagetype);
}
{
plottype = buildMatplotType(MATPLOT_Double, (DataOrder)dataorder, (ImageType)imagetype);
}
- else if ((DataType)datatype != MATPLOT_HM1_Double)
+ else if (piDimsArray[2] == 1 && (DataType)datatype != MATPLOT_HM1_Double)
{
plottype = buildMatplotType(MATPLOT_HM1_Double, (DataOrder)dataorder, (ImageType)imagetype);
}
- else if (piDimsArray[2] != 3 && (DataType)datatype != MATPLOT_HM3_Double)
+ else if (piDimsArray[2] == 3 && (DataType)datatype != MATPLOT_HM3_Double)
{
plottype = buildMatplotType(MATPLOT_HM3_Double, (DataOrder)dataorder, (ImageType)imagetype);
}
- else if (piDimsArray[2] != 4 && (DataType)datatype != MATPLOT_HM4_Double)
+ else if (piDimsArray[2] == 4 && (DataType)datatype != MATPLOT_HM4_Double)
{
plottype = buildMatplotType(MATPLOT_HM4_Double, (DataOrder)dataorder, (ImageType)imagetype);
}
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2017 - ESI - Antoine ELIAS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH GRAPHIC -->
+// <-- NO CHECK REF -->
+//
+// <-- Non-regression test for bug 15057 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/15057
+//
+// <-- Short Description -->
+// update of data of matplot does not take care of dimension >2
+
+a = uint8(zeros(480,640,3));
+a(:,:,1) = uint8(255);
+a(:,:,2) = uint8(180);
+a(:,:,3) = uint8(60);
+Matplot(a);
+e = gce();
+
+//change `data` values to be sure data are updated
+e.data = a + 1;
+assert_checkequal(e.data, a+1);