PSDTranslator: Add limited doutone support (mapped to grayscale)

This commit is contained in:
Gerasim Troeglazov
2013-12-14 12:04:30 +00:00
parent c5f9ac7e0b
commit 9d4b8b1f71
2 changed files with 11 additions and 2 deletions
+8 -1
View File
@@ -47,7 +47,7 @@ PSDLoader::PSDLoader(BPositionIO *src)
fCompression = _GetInt16FromStream(fStream);
fStreamPos = fStream->Position();
fLoaded = true;
}
@@ -108,6 +108,8 @@ PSDLoader::ColorFormatName(void)
return "Multichannel";
case PSD_COLOR_MODE_LAB:
return "Lab";
case PSD_COLOR_MODE_DUOTONE:
return "Duotone";
}
return "";
}
@@ -154,6 +156,10 @@ PSDLoader::_ColorFormat(void)
else if (fChannels > 3)
format = PSD_COLOR_FORMAT_LAB_A;
break;
case PSD_COLOR_MODE_DUOTONE:
if (fChannels >= 1)
format = PSD_COLOR_FORMAT_DUOTONE;
break;
default:
break;
};
@@ -269,6 +275,7 @@ PSDLoader::Decode(BPositionIO *target)
target->Write(imageData[0], rowBytes);
break;
}
case PSD_COLOR_FORMAT_DUOTONE:
case PSD_COLOR_FORMAT_GRAY:
case PSD_COLOR_FORMAT_GRAY_A:
{
+3 -1
View File
@@ -36,6 +36,7 @@ enum psd_color_mode {
PSD_COLOR_MODE_RGB = 3,
PSD_COLOR_MODE_CMYK = 4,
PSD_COLOR_MODE_MULTICHANNEL = 7,
PSD_COLOR_MODE_DUOTONE = 8,
PSD_COLOR_MODE_LAB = 9
};
@@ -51,7 +52,8 @@ enum psd_color_format {
PSD_COLOR_FORMAT_CMYK,
PSD_COLOR_FORMAT_CMYK_A,
PSD_COLOR_FORMAT_LAB,
PSD_COLOR_FORMAT_LAB_A
PSD_COLOR_FORMAT_LAB_A,
PSD_COLOR_FORMAT_DUOTONE
};