Bug 1707794 - Add support for CMYK to the fuzzing target. r=aosmond

Differential Revision: https://phabricator.services.mozilla.com/D113460
This commit is contained in:
Jeff Muizelaar 2021-04-27 14:38:51 +00:00
parent 60c8a028ed
commit db8307e53c
2 changed files with 6 additions and 3 deletions

View File

@ -8,7 +8,7 @@ extern crate libc;
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use qcms::c_bindings::{qcms_profile, icSigRgbData, qcms_profile_is_bogus, icSigGrayData};
use qcms::c_bindings::{qcms_profile, icSigRgbData, icSigCmykData, icSigGrayData, qcms_profile_is_bogus};
use qcms::c_bindings::{qcms_profile_get_color_space, qcms_profile_get_rendering_intent, qcms_profile_from_memory, qcms_profile_release, qcms_profile_sRGB, qcms_transform_create};
use qcms::c_bindings::{qcms_profile_precache_output_transform, qcms_transform_data, qcms_transform_release, qcms_enable_iccv4};
@ -22,6 +22,8 @@ use qcms::DataType::*;
let mut src_type = if (size & 1) != 0 { RGBA8 } else { RGB8 };
if src_color_space == icSigGrayData {
src_type = if (size & 1) != 0 { GrayA8 } else { Gray8 };
} else if src_color_space == icSigCmykData {
src_type = CMYK;
} else if src_color_space != icSigRgbData {
return;
}

View File

@ -359,8 +359,9 @@ pub unsafe extern "C" fn qcms_transform_data(
}
pub type icColorSpaceSignature = u32;
pub const icSigGrayData: icColorSpaceSignature = 1196573017;
pub const icSigRgbData: icColorSpaceSignature = 1380401696;
pub const icSigGrayData: icColorSpaceSignature = 0x47524159; // 'GRAY'
pub const icSigRgbData: icColorSpaceSignature = 0x52474220; // 'RGB '
pub const icSigCmykData: icColorSpaceSignature = 0x434d594b; // 'CMYK'
pub use crate::iccread::qcms_profile_is_bogus;
pub use crate::iccread::Profile as qcms_profile;