Skip to content

CoreGraphics macOS xcode16.1 b3

Alex Soto edited this page Oct 7, 2024 · 1 revision

#CoreGraphics.framework

diff -ruN /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h --- /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h	2024-09-02 23:18:42 +++ /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h	2024-09-30 02:27:08 @@ -32,10 +32,11 @@ CG_EXTERN CGColorConversionInfoRef __nullable CGColorConversionInfoCreate(cg_nullable CGColorSpaceRef src, cg_nullable CGColorSpaceRef dst) API_AVAILABLE(macos(10.12), ios(10.0)); -/* CGColorConversionInfoCreateWithOptions allows to request a specifc behavior consistent with  - * CGContextDrawImageApplyingToneMapping when applying kCGToneMappingITURecommended. - * These options include: kCGUse100nitsHLGOOTF, kCGUseBT1886ForCoreVideoGamma, kCGSkipBoostToHDR and kCGUseLegacyHDREcosystem. - * See CGContext.h for more details. +/* CGColorConversionInfoCreateWithOptions allows to request a specifc behavior of color conversion + * which is consistent with CGContextDrawImageApplyingToneMapping when applying kCGToneMappingITURecommended. + * These options include: kCGUse100nitsHLGOOTF, kCGUseBT1886ForCoreVideoGamma, kCGSkipBoostToHDR + * and kCGUseLegacyHDREcosystem. + * See CGContext.h and CGToneMapping.h for more details. */ CG_EXTERN CGColorConversionInfoRef __nullable CGColorConversionInfoCreateWithOptions(__nonnull CGColorSpaceRef src, __nonnull CGColorSpaceRef dst, CFDictionaryRef __nullable options) API_AVAILABLE(macos(10.14.6), ios(13)); @@ -53,6 +54,37 @@ CG_EXTERN CGColorConversionInfoRef __nullable CGColorConversionInfoCreateFromListWithArguments (CFDictionaryRef __nullable options, cg_nullable CGColorSpaceRef, CGColorConversionInfoTransformType, CGColorRenderingIntent, va_list) API_AVAILABLE(macos(10.13), ios(11.0)); + +/* CGColorConversionInfoCreateForToneMapping allows to request the specifc behavior of a color conversion + * which is consistent with CGContextDrawImageApplyingToneMapping. + * See CGContext.h and CGToneMapping.h for more details about CGToneMapping type and options. + * CGColorConversionInfoCreateWithOptions will return NULL when CGColorConversionInfoRef cannot be created or no cconversion is required. + * Headroom values are ignored when kCGToneMappingITURecommended, kCGToneMappingEXRGamma or kCGToneMappingNone methods are used. + * Otherwise headroom values must be equal or greater 1.0f to be considered valid. + * CGColorConversionInfoCreateForToneMapping requires that target headroom is smaller or equal source headroom to succeed, except when converting + * SDR to HDR. + * If CGColorConversionInfoRef cannot be created because of incorrect parameters and 'error' is a non-NULL pointer, a CFErrorRef will be returned + * with the description explaining the reason. + */ + +CG_EXTERN CGColorConversionInfoRef __nullable CGColorConversionInfoCreateForToneMapping(__nonnull CGColorSpaceRef from, float source_headroom, __nonnull CGColorSpaceRef to, float target_headroom, CGToneMapping method, CFDictionaryRef __nullable options, CFErrorRef* __nullable error) API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); + +typedef struct { + uint32_t version; // current version = 0 + CGBitmapInfo bitmapInfo; // see CGImage.h + size_t bitsPerComponent; // only 8, 10, 16 fixed, 16 bit float and 32 bit float are supported + size_t bitsPerPixel; + size_t bytesPerRow; +} CGColorBufferFormat; + +/* + * CGColorConversionInfoConvertData will use CGColorConversionInfoRef 'info' to convert 'src_data' described by 'width' (in pixels), + * 'height' (in pixels) and 'src_format' to 'dst_data' of the same pixel size ('width', 'height') and 'dst_format'. + * CFDictionaryRef 'options' is reserved for future use. + * CGColorConversionInfoConvertData will return 'true' on success and 'false' on failure. + */ + +CG_EXTERN bool CGColorConversionInfoConvertData(__nonnull CGColorConversionInfoRef info, size_t width, size_t height, void* __nonnull dst_data, CGColorBufferFormat dst_format, const void* __nonnull src_data, CGColorBufferFormat src_format, CFDictionaryRef __nullable options) API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* CFBooleanRef's which can be used as options to create CGColorConversionInfoRef */ CG_EXTERN const CFStringRef kCGColorConversionBlackPointCompensation API_AVAILABLE(macos(10.12), ios(10.0)); diff -ruN /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h --- /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h	2024-09-05 02:54:26 +++ /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h	2024-09-30 05:29:11 @@ -22,6 +22,7 @@ #include <CoreGraphics/CGPattern.h> #include <CoreGraphics/CGPDFDocument.h> #include <CoreGraphics/CGShading.h> +#include <CoreGraphics/CGToneMapping.h> CF_IMPLICIT_BRIDGING_ENABLED @@ -693,34 +694,10 @@ CGImageRef cg_nullable image) API_AVAILABLE(macos(10.5), ios(2.0)); -typedef CF_ENUM (uint32_t, CGToneMapping) { - kCGToneMappingDefault = 0, /* A system default method will be used */ - kCGToneMappingImageSpecificLumaScaling, /* Implements tone mapping of HDR content associated with the CGImage gain map */ - kCGToneMappingReferenceWhiteBased, /* Implements a tone curve that preserves SDR contrast and rolls off HDR highlights */ - kCGToneMappingITURecommended, /* Implements tone mapping based on ITU-R specifications for HDR-to-SDR and SDR-to-HDR conversions assuming mastering peak of 1000 nits */ - kCGToneMappingEXRGamma, /* Implements Open EXR tone mapping gamma suitable for tone mapping images in extended linear sRGB color space to SDR */ - kCGToneMappingNone /* Does not apply any tone mapping. Color converted values in extended color spaces will be clipped to SDR ([0.0-1.0]) range */ -} API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); +/* Draw `image' in the rectangular area specified by `rect' in the context + `c' applying the specified tone mapping method and options. See CGToneMapping.h for more info. Same as in CGContextDrawImage, the image is scaled, if necessary, to fit into `rect'. */ CG_EXTERN bool CGContextDrawImageApplyingToneMapping(CGContextRef __nonnull c, CGRect r, CGImageRef image, CGToneMapping method, CFDictionaryRef __nullable options) API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); - -/* kCGColorITURecommendedToneMapping allows for using HLG OOTF targeting 100 nits when converting HLG to SDR. */ -CG_EXTERN const CFStringRef kCGUse100nitsHLGOOTF API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* The expected value is a CFBooleanRef (kCFBooleanTrue) */ - -/* kCGColorITURecommendedToneMapping allows for choosing BT1886 recommended gamma in lieu of CoreVideo Gamma. */ -CG_EXTERN const CFStringRef kCGUseBT1886ForCoreVideoGamma API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* The expected value is a CFBooleanRef (kCFBooleanTrue) */ - -/* kCGColorITURecommendedToneMapping allows for skipping linear boost when converting non-HDR content (either SDR or extended range) to HDR. */ -CG_EXTERN const CFStringRef kCGSkipBoostToHDR API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* The expected value is a CFBooleanRef (kCFBooleanTrue) */ - -/* kCGColorITURecommendedToneMapping allows for choosing legacy HDR conversion functions implemented in previous versions of the OS */ -CG_EXTERN const CFStringRef kCGUseLegacyHDREcosystem API_AVAILABLE(macos(15.1), ios(18.1), tvos(18.1), watchos(11.1)); /* The expected value is a CFBooleanRef (kCFBooleanTrue) */ - -/* kCGToneMappingEXRGamma allows for specifying custom parameters to override system defaults. */ -CG_EXTERN const CFStringRef kCGEXRToneMappingGammaDefog API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* default value: 0.0f range [0.0f, 0.01f] */ -CG_EXTERN const CFStringRef kCGEXRToneMappingGammaExposure API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* default value: 0.0f range [-10.0f, 10.0f] */ -CG_EXTERN const CFStringRef kCGEXRToneMappingGammaKneeLow API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* default value: 0.0f range [-2.85f, 3.0f] */ -CG_EXTERN const CFStringRef kCGEXRToneMappingGammaKneeHigh API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* default value: 5.0f range [3.5f, 7.5f] */ /* Return the interpolation quality for image rendering of `context'. The interpolation quality is a gstate parameter which controls the level of diff -ruN /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h --- /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h	2024-09-02 23:18:41 +++ /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h	2024-09-30 03:45:07 @@ -30,4 +30,5 @@ CGColorDataFormat src_format, CFDictionaryRef options); + #endif /* CGCONVERTCOLORDATAWITHFORMAT_H */ diff -ruN /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h --- /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h	1969-12-31 19:00:00 +++ /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h	2024-09-30 02:27:08 @@ -0,0 +1,57 @@ +/* CoreGraphics - CGToneMapping.h + Copyright (c) 2000-2012 Apple Inc. + All rights reserved. */ + +#ifndef CGTONEMAPPING_H_ +#define CGTONEMAPPING_H_ + +#include <CoreFoundation/CFBase.h> +#include <CoreFoundation/CFAvailability.h> +#include <stdint.h> + + +#include <CoreGraphics/CGBase.h> + +CF_IMPLICIT_BRIDGING_ENABLED + +CF_ASSUME_NONNULL_BEGIN + +typedef CF_ENUM (uint32_t, CGToneMapping) { + kCGToneMappingDefault = 0, /* A system default method will be used */ + kCGToneMappingImageSpecificLumaScaling, /* Implements tone mapping of HDR content associated with the CGImage gain map */ + kCGToneMappingReferenceWhiteBased, /* Implements a tone curve that preserves SDR contrast and rolls off HDR highlights */ + kCGToneMappingITURecommended, /* Implements tone mapping based on ITU-R specifications for HDR-to-SDR and SDR-to-HDR conversions assuming mastering peak of 1000 nits */ + kCGToneMappingEXRGamma, /* Implements Open EXR tone mapping gamma suitable for tone mapping images in extended linear sRGB color space to SDR */ + kCGToneMappingNone /* Does not apply any tone mapping. Color converted values in extended color spaces will be clipped to SDR ([0.0-1.0]) range */ +} API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); + +/* kCGUse100nitsHLGOOTF allows for using HLG OOTF targeting 100 nits when converting HLG to SDR when applying kCGColorITURecommended tone mapping method */ +CG_EXTERN const CFStringRef kCGUse100nitsHLGOOTF API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* The expected value is a CFBooleanRef (kCFBooleanTrue) */ + +/* kCGUseBT1886ForCoreVideoGamma allows for choosing BT1886 recommended gamma in lieu of CoreVideo Gamma. */ +CG_EXTERN const CFStringRef kCGUseBT1886ForCoreVideoGamma API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* The expected value is a CFBooleanRef (kCFBooleanTrue) */ + +/* kCGSkipBoostToHDR allows for skipping linear boost when converting non-HDR content (either SDR or extended range) to HDR when applying kCGColorITURecommended tone mapping method */ +CG_EXTERN const CFStringRef kCGSkipBoostToHDR API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* The expected value is a CFBooleanRef (kCFBooleanTrue) */ + +/* kCGUseLegacyHDREcosystem allows for choosing legacy HDR conversion functions implemented in previous versions of the OS when applying kCGColorITURecommended tone mapping method */ +CG_EXTERN const CFStringRef kCGUseLegacyHDREcosystem API_AVAILABLE(macos(15.1), ios(18.1), tvos(18.1), watchos(11.1)); /* The expected value is a CFBooleanRef (kCFBooleanTrue) */ + +/* kCGEXRToneMappingGammaDefog allows for specifying custom defog value to override system defaults when applying kCGToneMappingEXRGamma tone mapping method */ +CG_EXTERN const CFStringRef kCGEXRToneMappingGammaDefog API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* default value: 0.0f range [0.0f, 0.01f] */ + +/* kCGEXRToneMappingGammaExposure allows for specifying custom exposure value to override system defaults when applying kCGToneMappingEXRGamma tone mapping method */ +CG_EXTERN const CFStringRef kCGEXRToneMappingGammaExposure API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* default value: 0.0f range [-10.0f, 10.0f] */ + +/* kCGEXRToneMappingGammaKneeLow allows for specifying custom "knee low" value to override system defaults when applying kCGToneMappingEXRGamma tone mapping method */ +CG_EXTERN const CFStringRef kCGEXRToneMappingGammaKneeLow API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* default value: 0.0f range [-2.85f, 3.0f] */ + +/* kCGEXRToneMappingGammaKneeHigh allows for specifying custom "knee high" value to override system defaults when applying kCGToneMappingEXRGamma tone mapping method */ +CG_EXTERN const CFStringRef kCGEXRToneMappingGammaKneeHigh API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); /* default value: 5.0f range [3.5f, 7.5f] */ + + +CF_ASSUME_NONNULL_END + +CF_IMPLICIT_BRIDGING_DISABLED + +#endif /* CGTONEMAPPING_H_ */ diff -ruN /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes --- /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes	2024-09-02 22:31:14 +++ /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes	2024-09-30 05:07:45 @@ -137,8 +137,12 @@ SwiftName: CGColorConversionInfo.init(src:dst:) - Name: CGColorConversionInfoCreateWithOptions SwiftName: CGColorConversionInfo.init(optionsSrc:dst:options:) +- Name: CGColorConversionInfoCreateForToneMapping + SwiftName: CGColorConversionInfo.init(src:srcHeadroom:dst:dstHeadroom:toneMapping:options:) - Name: CGColorConversionInfoGetTypeID SwiftName: getter:CGColorConversionInfo.typeID() +- Name: CGColorConversionInfoConvertData + SwiftName: CGColorConversionInfo.convert(self:width:height:to:format:from:format:options:) # CGColorSpace # diff -ruN /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h --- /Applications/Xcode_16.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h	2024-09-02 23:18:41 +++ /Applications/Xcode_16.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h	2024-09-30 03:45:07 @@ -37,6 +37,7 @@ #include <CoreGraphics/CGPath.h> #include <CoreGraphics/CGPattern.h> #include <CoreGraphics/CGShading.h> +#include <CoreGraphics/CGToneMapping.h> #include <CoreGraphics/CGDirectDisplay.h> #include <CoreGraphics/CGDirectPalette.h> 
Clone this wiki locally