break;
}
case kTAG_ParaCurveType: {
+ enum ParaCurveType {
+ kExponential_ParaCurveType = 0,
+ kGAB_ParaCurveType = 1,
+ kGABC_ParaCurveType = 2,
+ kGABDE_ParaCurveType = 3,
+ kGABCDEF_ParaCurveType = 4,
+ };
+
// Determine the format of the parametric curve tag.
uint16_t format = read_big_endian_short(src + 8);
- if (0 == format) {
+ if (kExponential_ParaCurveType == format) {
tagBytes = 12 + 4;
if (len < tagBytes) {
SkColorSpacePrintf("gamma tag is too small (%d bytes)", len);
// We will fill in with zeros as necessary to always match the above form.
float g = 0.0f, a = 0.0f, b = 0.0f, c = 0.0f, d = 0.0f, e = 0.0f, f = 0.0f;
switch(format) {
- case 1: {
+ case kGAB_ParaCurveType: {
tagBytes = 12 + 12;
if (len < tagBytes) {
SkColorSpacePrintf("gamma tag is too small (%d bytes)", len);
d = -b / a;
break;
}
- case 2:
+ case kGABC_ParaCurveType:
tagBytes = 12 + 16;
if (len < tagBytes) {
SkColorSpacePrintf("gamma tag is too small (%d bytes)", len);
d = -b / a;
f = c;
break;
- case 3:
+ case kGABDE_ParaCurveType:
tagBytes = 12 + 20;
if (len < tagBytes) {
SkColorSpacePrintf("gamma tag is too small (%d bytes)", len);
d = SkFixedToFloat(read_big_endian_int(src + 28));
e = SkFixedToFloat(read_big_endian_int(src + 24));
break;
- case 4:
+ case kGABCDEF_ParaCurveType:
tagBytes = 12 + 28;
if (len < tagBytes) {
SkColorSpacePrintf("gamma tag is too small (%d bytes)", len);