1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

4-bit_palette_color

This commit is contained in:
Harvey
2022-08-29 10:21:17 +08:00
parent 3651831e7e
commit a4b191a7e0
2 changed files with 22 additions and 0 deletions
+12
View File
@@ -312,6 +312,18 @@ bool TiffDecoder::readHeader()
result = true;
break;
}
case 4:
//support 4-bit palette.
if (photometric == PHOTOMETRIC_PALETTE)
{
CV_Check((int)sample_format, sample_format == SAMPLEFORMAT_UINT || sample_format == SAMPLEFORMAT_INT, "");
int depth = sample_format == SAMPLEFORMAT_INT ? CV_8S : CV_8U;
m_type = CV_MAKETYPE(depth, 3);
result = true;
}
else
CV_Error(cv::Error::StsError, "bitsperpixel value is 4 should be palette.");
break;
case 8:
{
//Palette color, the value of the component is used as an index into the red,