use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
use crate::*;
pub const icVersion4Number: c_uint = 0x04000000;
pub const COLORSYNC_PROFILE_INSTALL_ENTITLEMENT: &CStr = unsafe {
CStr::from_bytes_with_nul_unchecked(b"com.apple.developer.ColorSync.profile.install\0")
};
pub const COLORSYNC_MD5_LENGTH: c_uint = 16;
#[doc(alias = "ColorSyncProfileRef")]
#[repr(C)]
pub struct ColorSyncProfile {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl ColorSyncProfile {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"ColorSyncProfile"> for ColorSyncProfile {}
);
#[doc(alias = "ColorSyncMutableProfileRef")]
#[repr(C)]
pub struct ColorSyncMutableProfile {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl ColorSyncMutableProfile: ColorSyncProfile {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"ColorSyncProfile"> for ColorSyncMutableProfile {}
);
extern "C" {
pub static kColorSyncGenericGrayProfile: &'static CFString;
}
extern "C" {
pub static kColorSyncGenericGrayGamma22Profile: &'static CFString;
}
extern "C" {
pub static kColorSyncGenericRGBProfile: &'static CFString;
}
extern "C" {
pub static kColorSyncGenericCMYKProfile: &'static CFString;
}
extern "C" {
pub static kColorSyncDisplayP3Profile: &'static CFString;
}
extern "C" {
pub static kColorSyncSRGBProfile: &'static CFString;
}
extern "C" {
pub static kColorSyncAdobeRGB1998Profile: &'static CFString;
}
extern "C" {
pub static kColorSyncGenericLabProfile: &'static CFString;
}
extern "C" {
pub static kColorSyncGenericXYZProfile: &'static CFString;
}
extern "C" {
pub static kColorSyncACESCGLinearProfile: &'static CFString;
}
extern "C" {
pub static kColorSyncDCIP3Profile: &'static CFString;
}
extern "C" {
pub static kColorSyncITUR709Profile: &'static CFString;
}
extern "C" {
pub static kColorSyncITUR2020Profile: &'static CFString;
}
extern "C" {
pub static kColorSyncROMMRGBProfile: &'static CFString;
}
extern "C" {
pub static kColorSyncWebSafeColorsProfile: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileHeader: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileClass: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileColorSpace: &'static CFString;
}
extern "C" {
pub static kColorSyncProfilePCS: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileURL: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileDescription: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileMD5Digest: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileIsValid: &'static CFString;
}
extern "C" {
pub static kColorSyncSigAToB0Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigAToB1Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigAToB2Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigBToA0Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigBToA1Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigBToA2Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigCmykData: &'static CFString;
}
extern "C" {
pub static kColorSyncSigGrayData: &'static CFString;
}
extern "C" {
pub static kColorSyncSigLabData: &'static CFString;
}
extern "C" {
pub static kColorSyncSigRgbData: &'static CFString;
}
extern "C" {
pub static kColorSyncSigXYZData: &'static CFString;
}
extern "C" {
pub static kColorSyncSigAbstractClass: &'static CFString;
}
extern "C" {
pub static kColorSyncSigBlueTRCTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigBlueColorantTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigMediaBlackPointTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigCopyrightTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigProfileDescriptionTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigDeviceModelDescTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigDeviceMfgDescTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigGreenTRCTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigGreenColorantTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigGamutTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigGrayTRCTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigLinkClass: &'static CFString;
}
extern "C" {
pub static kColorSyncSigDisplayClass: &'static CFString;
}
extern "C" {
pub static kColorSyncSigNamedColor2Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigNamedColorClass: &'static CFString;
}
extern "C" {
pub static kColorSyncSigPreview0Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigPreview1Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigPreview2Tag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigOutputClass: &'static CFString;
}
extern "C" {
pub static kColorSyncSigProfileSequenceDescTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigRedTRCTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigRedColorantTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigInputClass: &'static CFString;
}
extern "C" {
pub static kColorSyncSigColorSpaceClass: &'static CFString;
}
extern "C" {
pub static kColorSyncSigTechnologyTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigViewingConditionsTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigViewingCondDescTag: &'static CFString;
}
extern "C" {
pub static kColorSyncSigMediaWhitePointTag: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileComputerDomain: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileUserDomain: &'static CFString;
}
unsafe impl ConcreteType for ColorSyncProfile {
#[doc(alias = "ColorSyncProfileGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn ColorSyncProfileGetTypeID() -> CFTypeID;
}
unsafe { ColorSyncProfileGetTypeID() }
}
}
impl ColorSyncProfile {
#[doc(alias = "ColorSyncProfileCreate")]
#[inline]
pub unsafe fn new(
data: &CFData,
error: *mut *mut CFError,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreate(
data: &CFData,
error: *mut *mut CFError,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreate(data, error) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncProfileCreateWithURL")]
#[inline]
pub unsafe fn with_url(
url: &CFURL,
error: *mut *mut CFError,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateWithURL(
url: &CFURL,
error: *mut *mut CFError,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateWithURL(url, error) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncProfileCreateWithName")]
#[inline]
pub unsafe fn with_name(name: &CFString) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateWithName(name: &CFString)
-> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateWithName(name) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncProfileCreateWithDisplayID")]
#[inline]
pub unsafe fn with_display_id(display_id: u32) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateWithDisplayID(
display_id: u32,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateWithDisplayID(display_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncProfileCreateDeviceProfile")]
#[inline]
pub unsafe fn new_device_profile(
device_class: &CFString,
device_id: &CFUUID,
profile_id: &CFType,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateDeviceProfile(
device_class: &CFString,
device_id: &CFUUID,
profile_id: &CFType,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret =
unsafe { ColorSyncProfileCreateDeviceProfile(device_class, device_id, profile_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
impl ColorSyncMutableProfile {
#[doc(alias = "ColorSyncProfileCreateMutable")]
#[inline]
pub unsafe fn new() -> Option<CFRetained<ColorSyncMutableProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateMutable() -> Option<NonNull<ColorSyncMutableProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateMutable() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncProfileCreateMutableCopy")]
#[inline]
pub unsafe fn new_copy(prof: &ColorSyncProfile) -> Option<CFRetained<ColorSyncMutableProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateMutableCopy(
prof: &ColorSyncProfile,
) -> Option<NonNull<ColorSyncMutableProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateMutableCopy(prof) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
impl ColorSyncProfile {
#[doc(alias = "ColorSyncProfileCreateLink")]
#[inline]
pub unsafe fn new_link(
profile_info: &CFArray,
options: Option<&CFDictionary>,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateLink(
profile_info: &CFArray,
options: Option<&CFDictionary>,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateLink(profile_info, options) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncProfileVerify")]
#[inline]
pub unsafe fn verify(&self, errors: *mut *mut CFError, warnings: *mut *mut CFError) -> bool {
extern "C-unwind" {
fn ColorSyncProfileVerify(
prof: &ColorSyncProfile,
errors: *mut *mut CFError,
warnings: *mut *mut CFError,
) -> bool;
}
unsafe { ColorSyncProfileVerify(self, errors, warnings) }
}
#[doc(alias = "ColorSyncProfileIsWideGamut")]
#[inline]
pub unsafe fn is_wide_gamut(&self) -> bool {
extern "C-unwind" {
fn ColorSyncProfileIsWideGamut(param1: &ColorSyncProfile) -> bool;
}
unsafe { ColorSyncProfileIsWideGamut(self) }
}
#[doc(alias = "ColorSyncProfileIsMatrixBased")]
#[inline]
pub unsafe fn is_matrix_based(&self) -> bool {
extern "C-unwind" {
fn ColorSyncProfileIsMatrixBased(param1: &ColorSyncProfile) -> bool;
}
unsafe { ColorSyncProfileIsMatrixBased(self) }
}
#[doc(alias = "ColorSyncProfileIsPQBased")]
#[inline]
pub unsafe fn is_pq_based(&self) -> bool {
extern "C-unwind" {
fn ColorSyncProfileIsPQBased(param1: &ColorSyncProfile) -> bool;
}
unsafe { ColorSyncProfileIsPQBased(self) }
}
#[doc(alias = "ColorSyncProfileIsHLGBased")]
#[inline]
pub unsafe fn is_hlg_based(&self) -> bool {
extern "C-unwind" {
fn ColorSyncProfileIsHLGBased(param1: &ColorSyncProfile) -> bool;
}
unsafe { ColorSyncProfileIsHLGBased(self) }
}
#[doc(alias = "ColorSyncProfileEstimateGammaWithDisplayID")]
#[inline]
pub unsafe fn estimate_gamma_with_display_id(
display_id: i32,
error: *mut *mut CFError,
) -> c_float {
extern "C-unwind" {
fn ColorSyncProfileEstimateGammaWithDisplayID(
display_id: i32,
error: *mut *mut CFError,
) -> c_float;
}
unsafe { ColorSyncProfileEstimateGammaWithDisplayID(display_id, error) }
}
#[doc(alias = "ColorSyncProfileEstimateGamma")]
#[inline]
pub unsafe fn estimate_gamma(&self, error: *mut *mut CFError) -> c_float {
extern "C-unwind" {
fn ColorSyncProfileEstimateGamma(
prof: &ColorSyncProfile,
error: *mut *mut CFError,
) -> c_float;
}
unsafe { ColorSyncProfileEstimateGamma(self, error) }
}
#[doc(alias = "ColorSyncProfileGetDisplayTransferFormulaFromVCGT")]
#[inline]
pub unsafe fn display_transfer_formula_from_vcgt(
&self,
red_min: NonNull<c_float>,
red_max: NonNull<c_float>,
red_gamma: NonNull<c_float>,
green_min: NonNull<c_float>,
green_max: NonNull<c_float>,
green_gamma: NonNull<c_float>,
blue_min: NonNull<c_float>,
blue_max: NonNull<c_float>,
blue_gamma: NonNull<c_float>,
) -> bool {
extern "C-unwind" {
fn ColorSyncProfileGetDisplayTransferFormulaFromVCGT(
profile: &ColorSyncProfile,
red_min: NonNull<c_float>,
red_max: NonNull<c_float>,
red_gamma: NonNull<c_float>,
green_min: NonNull<c_float>,
green_max: NonNull<c_float>,
green_gamma: NonNull<c_float>,
blue_min: NonNull<c_float>,
blue_max: NonNull<c_float>,
blue_gamma: NonNull<c_float>,
) -> bool;
}
unsafe {
ColorSyncProfileGetDisplayTransferFormulaFromVCGT(
self,
red_min,
red_max,
red_gamma,
green_min,
green_max,
green_gamma,
blue_min,
blue_max,
blue_gamma,
)
}
}
#[doc(alias = "ColorSyncProfileCreateDisplayTransferTablesFromVCGT")]
#[inline]
pub unsafe fn display_transfer_tables_from_vcgt(
&self,
n_samples_per_channel: NonNull<usize>,
) -> Option<CFRetained<CFData>> {
extern "C-unwind" {
fn ColorSyncProfileCreateDisplayTransferTablesFromVCGT(
profile: &ColorSyncProfile,
n_samples_per_channel: NonNull<usize>,
) -> Option<NonNull<CFData>>;
}
let ret = unsafe {
ColorSyncProfileCreateDisplayTransferTablesFromVCGT(self, n_samples_per_channel)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct ColorSyncMD5 {
pub digest: [u8; 16],
}
#[cfg(feature = "objc2")]
unsafe impl Encode for ColorSyncMD5 {
const ENCODING: Encoding = Encoding::Struct("?", &[<[u8; 16]>::ENCODING]);
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for ColorSyncMD5 {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl ColorSyncProfile {
#[doc(alias = "ColorSyncProfileGetMD5")]
#[inline]
pub unsafe fn md_5(&self) -> ColorSyncMD5 {
extern "C-unwind" {
fn ColorSyncProfileGetMD5(prof: &ColorSyncProfile) -> ColorSyncMD5;
}
unsafe { ColorSyncProfileGetMD5(self) }
}
#[doc(alias = "ColorSyncProfileCopyData")]
#[inline]
pub unsafe fn data(&self, error: *mut *mut CFError) -> CFRetained<CFData> {
extern "C-unwind" {
fn ColorSyncProfileCopyData(
prof: &ColorSyncProfile,
error: *mut *mut CFError,
) -> Option<NonNull<CFData>>;
}
let ret = unsafe { ColorSyncProfileCopyData(self, error) };
let ret =
ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[doc(alias = "ColorSyncProfileGetURL")]
#[inline]
pub unsafe fn url(&self, error: *mut *mut CFError) -> CFRetained<CFURL> {
extern "C-unwind" {
fn ColorSyncProfileGetURL(
prof: &ColorSyncProfile,
error: *mut *mut CFError,
) -> Option<NonNull<CFURL>>;
}
let ret = unsafe { ColorSyncProfileGetURL(self, error) };
let ret =
ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::retain(ret) }
}
#[doc(alias = "ColorSyncProfileCopyHeader")]
#[inline]
pub unsafe fn header(&self) -> CFRetained<CFData> {
extern "C-unwind" {
fn ColorSyncProfileCopyHeader(prof: &ColorSyncProfile) -> Option<NonNull<CFData>>;
}
let ret = unsafe { ColorSyncProfileCopyHeader(self) };
let ret =
ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
}
impl ColorSyncMutableProfile {
#[doc(alias = "ColorSyncProfileSetHeader")]
#[inline]
pub unsafe fn set_header(&self, header: &CFData) {
extern "C-unwind" {
fn ColorSyncProfileSetHeader(prof: &ColorSyncMutableProfile, header: &CFData);
}
unsafe { ColorSyncProfileSetHeader(self, header) }
}
}
impl ColorSyncProfile {
#[doc(alias = "ColorSyncProfileCopyDescriptionString")]
#[inline]
pub unsafe fn description_string(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn ColorSyncProfileCopyDescriptionString(
prof: &ColorSyncProfile,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { ColorSyncProfileCopyDescriptionString(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncProfileCopyTagSignatures")]
#[inline]
pub unsafe fn tag_signatures(&self) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn ColorSyncProfileCopyTagSignatures(
prof: &ColorSyncProfile,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { ColorSyncProfileCopyTagSignatures(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncProfileContainsTag")]
#[inline]
pub unsafe fn contains_tag(&self, signature: &CFString) -> bool {
extern "C-unwind" {
fn ColorSyncProfileContainsTag(prof: &ColorSyncProfile, signature: &CFString) -> bool;
}
unsafe { ColorSyncProfileContainsTag(self, signature) }
}
#[doc(alias = "ColorSyncProfileCopyTag")]
#[inline]
pub unsafe fn tag(&self, signature: &CFString) -> Option<CFRetained<CFData>> {
extern "C-unwind" {
fn ColorSyncProfileCopyTag(
prof: &ColorSyncProfile,
signature: &CFString,
) -> Option<NonNull<CFData>>;
}
let ret = unsafe { ColorSyncProfileCopyTag(self, signature) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
impl ColorSyncMutableProfile {
#[doc(alias = "ColorSyncProfileSetTag")]
#[inline]
pub unsafe fn set_tag(&self, signature: &CFString, data: &CFData) {
extern "C-unwind" {
fn ColorSyncProfileSetTag(
prof: &ColorSyncMutableProfile,
signature: &CFString,
data: &CFData,
);
}
unsafe { ColorSyncProfileSetTag(self, signature, data) }
}
#[doc(alias = "ColorSyncProfileRemoveTag")]
#[inline]
pub unsafe fn remove_tag(&self, signature: &CFString) {
extern "C-unwind" {
fn ColorSyncProfileRemoveTag(prof: &ColorSyncMutableProfile, signature: &CFString);
}
unsafe { ColorSyncProfileRemoveTag(self, signature) }
}
}
pub type ColorSyncProfileIterateCallback =
Option<unsafe extern "C-unwind" fn(NonNull<CFDictionary>, NonNull<c_void>) -> bool>;
extern "C" {
pub static kColorSyncProfileCacheSeed: &'static CFString;
}
extern "C-unwind" {
pub fn ColorSyncIterateInstalledProfiles(
call_back: ColorSyncProfileIterateCallback,
seed: *mut u32,
user_info: *mut c_void,
error: *mut *mut CFError,
);
}
extern "C" {
pub static kColorSyncWaitForCacheReply: &'static CFString;
}
extern "C-unwind" {
pub fn ColorSyncIterateInstalledProfilesWithOptions(
call_back: ColorSyncProfileIterateCallback,
seed: *mut u32,
user_info: *mut c_void,
options: Option<&CFDictionary>,
error: *mut *mut CFError,
);
}
impl ColorSyncProfile {
#[doc(alias = "ColorSyncProfileInstall")]
#[inline]
pub unsafe fn install(
&self,
domain: &CFString,
subpath: &CFString,
error: *mut *mut CFError,
) -> bool {
extern "C-unwind" {
fn ColorSyncProfileInstall(
profile: &ColorSyncProfile,
domain: &CFString,
subpath: &CFString,
error: *mut *mut CFError,
) -> bool;
}
unsafe { ColorSyncProfileInstall(self, domain, subpath, error) }
}
#[doc(alias = "ColorSyncProfileUninstall")]
#[inline]
pub unsafe fn uninstall(&self, error: *mut *mut CFError) -> bool {
extern "C-unwind" {
fn ColorSyncProfileUninstall(
profile: &ColorSyncProfile,
error: *mut *mut CFError,
) -> bool;
}
unsafe { ColorSyncProfileUninstall(self, error) }
}
}
#[deprecated = "renamed to `ColorSyncProfile::new`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCreate(
data: &CFData,
error: *mut *mut CFError,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreate(
data: &CFData,
error: *mut *mut CFError,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreate(data, error) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncProfile::with_url`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCreateWithURL(
url: &CFURL,
error: *mut *mut CFError,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateWithURL(
url: &CFURL,
error: *mut *mut CFError,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateWithURL(url, error) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncProfile::with_name`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCreateWithName(
name: &CFString,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateWithName(name: &CFString) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateWithName(name) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncProfile::with_display_id`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCreateWithDisplayID(
display_id: u32,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateWithDisplayID(
display_id: u32,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateWithDisplayID(display_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncProfile::new_device_profile`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCreateDeviceProfile(
device_class: &CFString,
device_id: &CFUUID,
profile_id: &CFType,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateDeviceProfile(
device_class: &CFString,
device_id: &CFUUID,
profile_id: &CFType,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateDeviceProfile(device_class, device_id, profile_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncMutableProfile::new`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCreateMutable(
) -> Option<CFRetained<ColorSyncMutableProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateMutable() -> Option<NonNull<ColorSyncMutableProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateMutable() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncMutableProfile::new_copy`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCreateMutableCopy(
prof: &ColorSyncProfile,
) -> Option<CFRetained<ColorSyncMutableProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateMutableCopy(
prof: &ColorSyncProfile,
) -> Option<NonNull<ColorSyncMutableProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateMutableCopy(prof) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncProfile::new_link`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCreateLink(
profile_info: &CFArray,
options: Option<&CFDictionary>,
) -> Option<CFRetained<ColorSyncProfile>> {
extern "C-unwind" {
fn ColorSyncProfileCreateLink(
profile_info: &CFArray,
options: Option<&CFDictionary>,
) -> Option<NonNull<ColorSyncProfile>>;
}
let ret = unsafe { ColorSyncProfileCreateLink(profile_info, options) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::verify`"]
pub fn ColorSyncProfileVerify(
prof: &ColorSyncProfile,
errors: *mut *mut CFError,
warnings: *mut *mut CFError,
) -> bool;
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::is_wide_gamut`"]
pub fn ColorSyncProfileIsWideGamut(param1: &ColorSyncProfile) -> bool;
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::is_matrix_based`"]
pub fn ColorSyncProfileIsMatrixBased(param1: &ColorSyncProfile) -> bool;
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::is_pq_based`"]
pub fn ColorSyncProfileIsPQBased(param1: &ColorSyncProfile) -> bool;
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::is_hlg_based`"]
pub fn ColorSyncProfileIsHLGBased(param1: &ColorSyncProfile) -> bool;
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::estimate_gamma_with_display_id`"]
pub fn ColorSyncProfileEstimateGammaWithDisplayID(
display_id: i32,
error: *mut *mut CFError,
) -> c_float;
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::estimate_gamma`"]
pub fn ColorSyncProfileEstimateGamma(
prof: &ColorSyncProfile,
error: *mut *mut CFError,
) -> c_float;
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::display_transfer_formula_from_vcgt`"]
pub fn ColorSyncProfileGetDisplayTransferFormulaFromVCGT(
profile: &ColorSyncProfile,
red_min: NonNull<c_float>,
red_max: NonNull<c_float>,
red_gamma: NonNull<c_float>,
green_min: NonNull<c_float>,
green_max: NonNull<c_float>,
green_gamma: NonNull<c_float>,
blue_min: NonNull<c_float>,
blue_max: NonNull<c_float>,
blue_gamma: NonNull<c_float>,
) -> bool;
}
#[deprecated = "renamed to `ColorSyncProfile::display_transfer_tables_from_vcgt`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCreateDisplayTransferTablesFromVCGT(
profile: &ColorSyncProfile,
n_samples_per_channel: NonNull<usize>,
) -> Option<CFRetained<CFData>> {
extern "C-unwind" {
fn ColorSyncProfileCreateDisplayTransferTablesFromVCGT(
profile: &ColorSyncProfile,
n_samples_per_channel: NonNull<usize>,
) -> Option<NonNull<CFData>>;
}
let ret = unsafe {
ColorSyncProfileCreateDisplayTransferTablesFromVCGT(profile, n_samples_per_channel)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::md_5`"]
pub fn ColorSyncProfileGetMD5(prof: &ColorSyncProfile) -> ColorSyncMD5;
}
#[deprecated = "renamed to `ColorSyncProfile::data`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCopyData(
prof: &ColorSyncProfile,
error: *mut *mut CFError,
) -> CFRetained<CFData> {
extern "C-unwind" {
fn ColorSyncProfileCopyData(
prof: &ColorSyncProfile,
error: *mut *mut CFError,
) -> Option<NonNull<CFData>>;
}
let ret = unsafe { ColorSyncProfileCopyData(prof, error) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[deprecated = "renamed to `ColorSyncProfile::url`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileGetURL(
prof: &ColorSyncProfile,
error: *mut *mut CFError,
) -> CFRetained<CFURL> {
extern "C-unwind" {
fn ColorSyncProfileGetURL(
prof: &ColorSyncProfile,
error: *mut *mut CFError,
) -> Option<NonNull<CFURL>>;
}
let ret = unsafe { ColorSyncProfileGetURL(prof, error) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::retain(ret) }
}
#[deprecated = "renamed to `ColorSyncProfile::header`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCopyHeader(
prof: &ColorSyncProfile,
) -> CFRetained<CFData> {
extern "C-unwind" {
fn ColorSyncProfileCopyHeader(prof: &ColorSyncProfile) -> Option<NonNull<CFData>>;
}
let ret = unsafe { ColorSyncProfileCopyHeader(prof) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncMutableProfile::set_header`"]
pub fn ColorSyncProfileSetHeader(prof: &ColorSyncMutableProfile, header: &CFData);
}
#[deprecated = "renamed to `ColorSyncProfile::description_string`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCopyDescriptionString(
prof: &ColorSyncProfile,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn ColorSyncProfileCopyDescriptionString(
prof: &ColorSyncProfile,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { ColorSyncProfileCopyDescriptionString(prof) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncProfile::tag_signatures`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCopyTagSignatures(
prof: &ColorSyncProfile,
) -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn ColorSyncProfileCopyTagSignatures(prof: &ColorSyncProfile) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { ColorSyncProfileCopyTagSignatures(prof) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::contains_tag`"]
pub fn ColorSyncProfileContainsTag(prof: &ColorSyncProfile, signature: &CFString) -> bool;
}
#[deprecated = "renamed to `ColorSyncProfile::tag`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncProfileCopyTag(
prof: &ColorSyncProfile,
signature: &CFString,
) -> Option<CFRetained<CFData>> {
extern "C-unwind" {
fn ColorSyncProfileCopyTag(
prof: &ColorSyncProfile,
signature: &CFString,
) -> Option<NonNull<CFData>>;
}
let ret = unsafe { ColorSyncProfileCopyTag(prof, signature) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncMutableProfile::set_tag`"]
pub fn ColorSyncProfileSetTag(
prof: &ColorSyncMutableProfile,
signature: &CFString,
data: &CFData,
);
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncMutableProfile::remove_tag`"]
pub fn ColorSyncProfileRemoveTag(prof: &ColorSyncMutableProfile, signature: &CFString);
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::install`"]
pub fn ColorSyncProfileInstall(
profile: &ColorSyncProfile,
domain: &CFString,
subpath: &CFString,
error: *mut *mut CFError,
) -> bool;
}
extern "C-unwind" {
#[deprecated = "renamed to `ColorSyncProfile::uninstall`"]
pub fn ColorSyncProfileUninstall(profile: &ColorSyncProfile, error: *mut *mut CFError) -> bool;
}