objc2_image_io/generated/
CGImageSource.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10#[cfg(feature = "objc2-core-graphics")]
11use objc2_core_graphics::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/imageio/cgimagesource?language=objc)
16#[repr(C)]
17pub struct CGImageSource {
18    inner: [u8; 0],
19    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
20}
21
22cf_type!(
23    unsafe impl CGImageSource {}
24);
25#[cfg(feature = "objc2")]
26cf_objc2_type!(
27    unsafe impl RefEncode<"CGImageSource"> for CGImageSource {}
28);
29
30/// [Apple's documentation](https://developer.apple.com/documentation/imageio/cgimagesourcestatus?language=objc)
31// NS_ENUM
32#[repr(transparent)]
33#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
34pub struct CGImageSourceStatus(pub i32);
35impl CGImageSourceStatus {
36    #[doc(alias = "kCGImageStatusUnexpectedEOF")]
37    pub const StatusUnexpectedEOF: Self = Self(-5);
38    #[doc(alias = "kCGImageStatusInvalidData")]
39    pub const StatusInvalidData: Self = Self(-4);
40    #[doc(alias = "kCGImageStatusUnknownType")]
41    pub const StatusUnknownType: Self = Self(-3);
42    #[doc(alias = "kCGImageStatusReadingHeader")]
43    pub const StatusReadingHeader: Self = Self(-2);
44    #[doc(alias = "kCGImageStatusIncomplete")]
45    pub const StatusIncomplete: Self = Self(-1);
46    #[doc(alias = "kCGImageStatusComplete")]
47    pub const StatusComplete: Self = Self(0);
48}
49
50#[cfg(feature = "objc2")]
51unsafe impl Encode for CGImageSourceStatus {
52    const ENCODING: Encoding = i32::ENCODING;
53}
54
55#[cfg(feature = "objc2")]
56unsafe impl RefEncode for CGImageSourceStatus {
57    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
58}
59
60extern "C" {
61    /// Keys for the options dictionary when creating a CGImageSourceRef. *
62    ///
63    /// See also [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcetypeidentifierhint?language=objc)
64    pub static kCGImageSourceTypeIdentifierHint: &'static CFString;
65}
66
67extern "C" {
68    /// Keys for the options dictionary of "CGImageSourceCopyPropertiesAtIndex"
69    /// * and "CGImageSourceCreateImageAtIndex". *
70    ///
71    /// See also [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourceshouldcache?language=objc)
72    pub static kCGImageSourceShouldCache: &'static CFString;
73}
74
75extern "C" {
76    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourceshouldcacheimmediately?language=objc)
77    pub static kCGImageSourceShouldCacheImmediately: &'static CFString;
78}
79
80extern "C" {
81    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourceshouldallowfloat?language=objc)
82    pub static kCGImageSourceShouldAllowFloat: &'static CFString;
83}
84
85extern "C" {
86    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcecreatethumbnailfromimageifabsent?language=objc)
87    pub static kCGImageSourceCreateThumbnailFromImageIfAbsent: &'static CFString;
88}
89
90extern "C" {
91    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcecreatethumbnailfromimagealways?language=objc)
92    pub static kCGImageSourceCreateThumbnailFromImageAlways: &'static CFString;
93}
94
95extern "C" {
96    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcethumbnailmaxpixelsize?language=objc)
97    pub static kCGImageSourceThumbnailMaxPixelSize: &'static CFString;
98}
99
100extern "C" {
101    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcecreatethumbnailwithtransform?language=objc)
102    pub static kCGImageSourceCreateThumbnailWithTransform: &'static CFString;
103}
104
105extern "C" {
106    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcesubsamplefactor?language=objc)
107    pub static kCGImageSourceSubsampleFactor: &'static CFString;
108}
109
110unsafe impl ConcreteType for CGImageSource {
111    #[doc(alias = "CGImageSourceGetTypeID")]
112    #[inline]
113    fn type_id() -> CFTypeID {
114        extern "C-unwind" {
115            fn CGImageSourceGetTypeID() -> CFTypeID;
116        }
117        unsafe { CGImageSourceGetTypeID() }
118    }
119}
120
121impl CGImageSource {
122    #[doc(alias = "CGImageSourceCopyTypeIdentifiers")]
123    #[inline]
124    pub unsafe fn type_identifiers() -> CFRetained<CFArray> {
125        extern "C-unwind" {
126            fn CGImageSourceCopyTypeIdentifiers() -> Option<NonNull<CFArray>>;
127        }
128        let ret = unsafe { CGImageSourceCopyTypeIdentifiers() };
129        let ret =
130            ret.expect("function was marked as returning non-null, but actually returned NULL");
131        unsafe { CFRetained::from_raw(ret) }
132    }
133
134    #[doc(alias = "CGImageSourceCreateWithDataProvider")]
135    #[cfg(feature = "objc2-core-graphics")]
136    #[inline]
137    pub unsafe fn with_data_provider(
138        provider: &CGDataProvider,
139        options: Option<&CFDictionary>,
140    ) -> Option<CFRetained<CGImageSource>> {
141        extern "C-unwind" {
142            fn CGImageSourceCreateWithDataProvider(
143                provider: &CGDataProvider,
144                options: Option<&CFDictionary>,
145            ) -> Option<NonNull<CGImageSource>>;
146        }
147        let ret = unsafe { CGImageSourceCreateWithDataProvider(provider, options) };
148        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
149    }
150
151    #[doc(alias = "CGImageSourceCreateWithData")]
152    #[inline]
153    pub unsafe fn with_data(
154        data: &CFData,
155        options: Option<&CFDictionary>,
156    ) -> Option<CFRetained<CGImageSource>> {
157        extern "C-unwind" {
158            fn CGImageSourceCreateWithData(
159                data: &CFData,
160                options: Option<&CFDictionary>,
161            ) -> Option<NonNull<CGImageSource>>;
162        }
163        let ret = unsafe { CGImageSourceCreateWithData(data, options) };
164        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
165    }
166
167    #[doc(alias = "CGImageSourceCreateWithURL")]
168    #[inline]
169    pub unsafe fn with_url(
170        url: &CFURL,
171        options: Option<&CFDictionary>,
172    ) -> Option<CFRetained<CGImageSource>> {
173        extern "C-unwind" {
174            fn CGImageSourceCreateWithURL(
175                url: &CFURL,
176                options: Option<&CFDictionary>,
177            ) -> Option<NonNull<CGImageSource>>;
178        }
179        let ret = unsafe { CGImageSourceCreateWithURL(url, options) };
180        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
181    }
182
183    #[doc(alias = "CGImageSourceGetType")]
184    #[inline]
185    pub unsafe fn r#type(self: &CGImageSource) -> Option<CFRetained<CFString>> {
186        extern "C-unwind" {
187            fn CGImageSourceGetType(isrc: &CGImageSource) -> Option<NonNull<CFString>>;
188        }
189        let ret = unsafe { CGImageSourceGetType(self) };
190        ret.map(|ret| unsafe { CFRetained::retain(ret) })
191    }
192
193    #[doc(alias = "CGImageSourceGetCount")]
194    #[inline]
195    pub unsafe fn count(self: &CGImageSource) -> usize {
196        extern "C-unwind" {
197            fn CGImageSourceGetCount(isrc: &CGImageSource) -> usize;
198        }
199        unsafe { CGImageSourceGetCount(self) }
200    }
201
202    #[doc(alias = "CGImageSourceCopyProperties")]
203    #[inline]
204    pub unsafe fn properties(
205        self: &CGImageSource,
206        options: Option<&CFDictionary>,
207    ) -> Option<CFRetained<CFDictionary>> {
208        extern "C-unwind" {
209            fn CGImageSourceCopyProperties(
210                isrc: &CGImageSource,
211                options: Option<&CFDictionary>,
212            ) -> Option<NonNull<CFDictionary>>;
213        }
214        let ret = unsafe { CGImageSourceCopyProperties(self, options) };
215        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
216    }
217
218    #[doc(alias = "CGImageSourceCopyPropertiesAtIndex")]
219    #[inline]
220    pub unsafe fn properties_at_index(
221        self: &CGImageSource,
222        index: usize,
223        options: Option<&CFDictionary>,
224    ) -> Option<CFRetained<CFDictionary>> {
225        extern "C-unwind" {
226            fn CGImageSourceCopyPropertiesAtIndex(
227                isrc: &CGImageSource,
228                index: usize,
229                options: Option<&CFDictionary>,
230            ) -> Option<NonNull<CFDictionary>>;
231        }
232        let ret = unsafe { CGImageSourceCopyPropertiesAtIndex(self, index, options) };
233        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
234    }
235
236    #[doc(alias = "CGImageSourceCopyMetadataAtIndex")]
237    #[cfg(feature = "CGImageMetadata")]
238    #[inline]
239    pub unsafe fn metadata_at_index(
240        self: &CGImageSource,
241        index: usize,
242        options: Option<&CFDictionary>,
243    ) -> Option<CFRetained<CGImageMetadata>> {
244        extern "C-unwind" {
245            fn CGImageSourceCopyMetadataAtIndex(
246                isrc: &CGImageSource,
247                index: usize,
248                options: Option<&CFDictionary>,
249            ) -> Option<NonNull<CGImageMetadata>>;
250        }
251        let ret = unsafe { CGImageSourceCopyMetadataAtIndex(self, index, options) };
252        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
253    }
254
255    #[doc(alias = "CGImageSourceCreateImageAtIndex")]
256    #[cfg(feature = "objc2-core-graphics")]
257    #[inline]
258    pub unsafe fn image_at_index(
259        self: &CGImageSource,
260        index: usize,
261        options: Option<&CFDictionary>,
262    ) -> Option<CFRetained<CGImage>> {
263        extern "C-unwind" {
264            fn CGImageSourceCreateImageAtIndex(
265                isrc: &CGImageSource,
266                index: usize,
267                options: Option<&CFDictionary>,
268            ) -> Option<NonNull<CGImage>>;
269        }
270        let ret = unsafe { CGImageSourceCreateImageAtIndex(self, index, options) };
271        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
272    }
273
274    #[doc(alias = "CGImageSourceRemoveCacheAtIndex")]
275    #[inline]
276    pub unsafe fn remove_cache_at_index(self: &CGImageSource, index: usize) {
277        extern "C-unwind" {
278            fn CGImageSourceRemoveCacheAtIndex(isrc: &CGImageSource, index: usize);
279        }
280        unsafe { CGImageSourceRemoveCacheAtIndex(self, index) }
281    }
282
283    #[doc(alias = "CGImageSourceCreateThumbnailAtIndex")]
284    #[cfg(feature = "objc2-core-graphics")]
285    #[inline]
286    pub unsafe fn thumbnail_at_index(
287        self: &CGImageSource,
288        index: usize,
289        options: Option<&CFDictionary>,
290    ) -> Option<CFRetained<CGImage>> {
291        extern "C-unwind" {
292            fn CGImageSourceCreateThumbnailAtIndex(
293                isrc: &CGImageSource,
294                index: usize,
295                options: Option<&CFDictionary>,
296            ) -> Option<NonNull<CGImage>>;
297        }
298        let ret = unsafe { CGImageSourceCreateThumbnailAtIndex(self, index, options) };
299        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
300    }
301
302    #[doc(alias = "CGImageSourceCreateIncremental")]
303    #[inline]
304    pub unsafe fn new_incremental(options: Option<&CFDictionary>) -> CFRetained<CGImageSource> {
305        extern "C-unwind" {
306            fn CGImageSourceCreateIncremental(
307                options: Option<&CFDictionary>,
308            ) -> Option<NonNull<CGImageSource>>;
309        }
310        let ret = unsafe { CGImageSourceCreateIncremental(options) };
311        let ret =
312            ret.expect("function was marked as returning non-null, but actually returned NULL");
313        unsafe { CFRetained::from_raw(ret) }
314    }
315
316    #[doc(alias = "CGImageSourceUpdateData")]
317    #[inline]
318    pub unsafe fn update_data(self: &CGImageSource, data: &CFData, r#final: bool) {
319        extern "C-unwind" {
320            fn CGImageSourceUpdateData(isrc: &CGImageSource, data: &CFData, r#final: bool);
321        }
322        unsafe { CGImageSourceUpdateData(self, data, r#final) }
323    }
324
325    #[doc(alias = "CGImageSourceUpdateDataProvider")]
326    #[cfg(feature = "objc2-core-graphics")]
327    #[inline]
328    pub unsafe fn update_data_provider(
329        self: &CGImageSource,
330        provider: &CGDataProvider,
331        r#final: bool,
332    ) {
333        extern "C-unwind" {
334            fn CGImageSourceUpdateDataProvider(
335                isrc: &CGImageSource,
336                provider: &CGDataProvider,
337                r#final: bool,
338            );
339        }
340        unsafe { CGImageSourceUpdateDataProvider(self, provider, r#final) }
341    }
342
343    #[doc(alias = "CGImageSourceGetStatus")]
344    #[inline]
345    pub unsafe fn status(self: &CGImageSource) -> CGImageSourceStatus {
346        extern "C-unwind" {
347            fn CGImageSourceGetStatus(isrc: &CGImageSource) -> CGImageSourceStatus;
348        }
349        unsafe { CGImageSourceGetStatus(self) }
350    }
351
352    #[doc(alias = "CGImageSourceGetStatusAtIndex")]
353    #[inline]
354    pub unsafe fn status_at_index(self: &CGImageSource, index: usize) -> CGImageSourceStatus {
355        extern "C-unwind" {
356            fn CGImageSourceGetStatusAtIndex(
357                isrc: &CGImageSource,
358                index: usize,
359            ) -> CGImageSourceStatus;
360        }
361        unsafe { CGImageSourceGetStatusAtIndex(self, index) }
362    }
363
364    #[doc(alias = "CGImageSourceGetPrimaryImageIndex")]
365    #[inline]
366    pub unsafe fn primary_image_index(self: &CGImageSource) -> usize {
367        extern "C-unwind" {
368            fn CGImageSourceGetPrimaryImageIndex(isrc: &CGImageSource) -> usize;
369        }
370        unsafe { CGImageSourceGetPrimaryImageIndex(self) }
371    }
372
373    #[doc(alias = "CGImageSourceCopyAuxiliaryDataInfoAtIndex")]
374    #[inline]
375    pub unsafe fn auxiliary_data_info_at_index(
376        self: &CGImageSource,
377        index: usize,
378        auxiliary_image_data_type: &CFString,
379    ) -> Option<CFRetained<CFDictionary>> {
380        extern "C-unwind" {
381            fn CGImageSourceCopyAuxiliaryDataInfoAtIndex(
382                isrc: &CGImageSource,
383                index: usize,
384                auxiliary_image_data_type: &CFString,
385            ) -> Option<NonNull<CFDictionary>>;
386        }
387        let ret = unsafe {
388            CGImageSourceCopyAuxiliaryDataInfoAtIndex(self, index, auxiliary_image_data_type)
389        };
390        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
391    }
392}
393
394extern "C" {
395    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcedecoderequest?language=objc)
396    pub static kCGImageSourceDecodeRequest: &'static CFString;
397}
398
399extern "C" {
400    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcedecodetohdr?language=objc)
401    pub static kCGImageSourceDecodeToHDR: &'static CFString;
402}
403
404extern "C" {
405    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcedecodetosdr?language=objc)
406    pub static kCGImageSourceDecodeToSDR: &'static CFString;
407}
408
409extern "C" {
410    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcegenerateimagespecificlumascaling?language=objc)
411    pub static kCGImageSourceGenerateImageSpecificLumaScaling: &'static CFString;
412}
413
414extern "C" {
415    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimagesourcedecoderequestoptions?language=objc)
416    pub static kCGImageSourceDecodeRequestOptions: &'static CFString;
417}
418
419impl CGImageSource {
420    #[doc(alias = "CGImageSourceSetAllowableTypes")]
421    #[inline]
422    pub unsafe fn set_allowable_types(allowable_types: &CFArray) -> OSStatus {
423        extern "C-unwind" {
424            fn CGImageSourceSetAllowableTypes(allowable_types: &CFArray) -> OSStatus;
425        }
426        unsafe { CGImageSourceSetAllowableTypes(allowable_types) }
427    }
428}
429
430#[deprecated = "renamed to `CGImageSource::type_identifiers`"]
431#[inline]
432pub unsafe extern "C-unwind" fn CGImageSourceCopyTypeIdentifiers() -> CFRetained<CFArray> {
433    extern "C-unwind" {
434        fn CGImageSourceCopyTypeIdentifiers() -> Option<NonNull<CFArray>>;
435    }
436    let ret = unsafe { CGImageSourceCopyTypeIdentifiers() };
437    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
438    unsafe { CFRetained::from_raw(ret) }
439}
440
441#[cfg(feature = "objc2-core-graphics")]
442#[deprecated = "renamed to `CGImageSource::with_data_provider`"]
443#[inline]
444pub unsafe extern "C-unwind" fn CGImageSourceCreateWithDataProvider(
445    provider: &CGDataProvider,
446    options: Option<&CFDictionary>,
447) -> Option<CFRetained<CGImageSource>> {
448    extern "C-unwind" {
449        fn CGImageSourceCreateWithDataProvider(
450            provider: &CGDataProvider,
451            options: Option<&CFDictionary>,
452        ) -> Option<NonNull<CGImageSource>>;
453    }
454    let ret = unsafe { CGImageSourceCreateWithDataProvider(provider, options) };
455    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
456}
457
458#[deprecated = "renamed to `CGImageSource::with_data`"]
459#[inline]
460pub unsafe extern "C-unwind" fn CGImageSourceCreateWithData(
461    data: &CFData,
462    options: Option<&CFDictionary>,
463) -> Option<CFRetained<CGImageSource>> {
464    extern "C-unwind" {
465        fn CGImageSourceCreateWithData(
466            data: &CFData,
467            options: Option<&CFDictionary>,
468        ) -> Option<NonNull<CGImageSource>>;
469    }
470    let ret = unsafe { CGImageSourceCreateWithData(data, options) };
471    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
472}
473
474#[deprecated = "renamed to `CGImageSource::with_url`"]
475#[inline]
476pub unsafe extern "C-unwind" fn CGImageSourceCreateWithURL(
477    url: &CFURL,
478    options: Option<&CFDictionary>,
479) -> Option<CFRetained<CGImageSource>> {
480    extern "C-unwind" {
481        fn CGImageSourceCreateWithURL(
482            url: &CFURL,
483            options: Option<&CFDictionary>,
484        ) -> Option<NonNull<CGImageSource>>;
485    }
486    let ret = unsafe { CGImageSourceCreateWithURL(url, options) };
487    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
488}
489
490#[deprecated = "renamed to `CGImageSource::type`"]
491#[inline]
492pub unsafe extern "C-unwind" fn CGImageSourceGetType(
493    isrc: &CGImageSource,
494) -> Option<CFRetained<CFString>> {
495    extern "C-unwind" {
496        fn CGImageSourceGetType(isrc: &CGImageSource) -> Option<NonNull<CFString>>;
497    }
498    let ret = unsafe { CGImageSourceGetType(isrc) };
499    ret.map(|ret| unsafe { CFRetained::retain(ret) })
500}
501
502extern "C-unwind" {
503    #[deprecated = "renamed to `CGImageSource::count`"]
504    pub fn CGImageSourceGetCount(isrc: &CGImageSource) -> usize;
505}
506
507#[deprecated = "renamed to `CGImageSource::properties`"]
508#[inline]
509pub unsafe extern "C-unwind" fn CGImageSourceCopyProperties(
510    isrc: &CGImageSource,
511    options: Option<&CFDictionary>,
512) -> Option<CFRetained<CFDictionary>> {
513    extern "C-unwind" {
514        fn CGImageSourceCopyProperties(
515            isrc: &CGImageSource,
516            options: Option<&CFDictionary>,
517        ) -> Option<NonNull<CFDictionary>>;
518    }
519    let ret = unsafe { CGImageSourceCopyProperties(isrc, options) };
520    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
521}
522
523#[deprecated = "renamed to `CGImageSource::properties_at_index`"]
524#[inline]
525pub unsafe extern "C-unwind" fn CGImageSourceCopyPropertiesAtIndex(
526    isrc: &CGImageSource,
527    index: usize,
528    options: Option<&CFDictionary>,
529) -> Option<CFRetained<CFDictionary>> {
530    extern "C-unwind" {
531        fn CGImageSourceCopyPropertiesAtIndex(
532            isrc: &CGImageSource,
533            index: usize,
534            options: Option<&CFDictionary>,
535        ) -> Option<NonNull<CFDictionary>>;
536    }
537    let ret = unsafe { CGImageSourceCopyPropertiesAtIndex(isrc, index, options) };
538    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
539}
540
541#[cfg(feature = "CGImageMetadata")]
542#[deprecated = "renamed to `CGImageSource::metadata_at_index`"]
543#[inline]
544pub unsafe extern "C-unwind" fn CGImageSourceCopyMetadataAtIndex(
545    isrc: &CGImageSource,
546    index: usize,
547    options: Option<&CFDictionary>,
548) -> Option<CFRetained<CGImageMetadata>> {
549    extern "C-unwind" {
550        fn CGImageSourceCopyMetadataAtIndex(
551            isrc: &CGImageSource,
552            index: usize,
553            options: Option<&CFDictionary>,
554        ) -> Option<NonNull<CGImageMetadata>>;
555    }
556    let ret = unsafe { CGImageSourceCopyMetadataAtIndex(isrc, index, options) };
557    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
558}
559
560#[cfg(feature = "objc2-core-graphics")]
561#[deprecated = "renamed to `CGImageSource::image_at_index`"]
562#[inline]
563pub unsafe extern "C-unwind" fn CGImageSourceCreateImageAtIndex(
564    isrc: &CGImageSource,
565    index: usize,
566    options: Option<&CFDictionary>,
567) -> Option<CFRetained<CGImage>> {
568    extern "C-unwind" {
569        fn CGImageSourceCreateImageAtIndex(
570            isrc: &CGImageSource,
571            index: usize,
572            options: Option<&CFDictionary>,
573        ) -> Option<NonNull<CGImage>>;
574    }
575    let ret = unsafe { CGImageSourceCreateImageAtIndex(isrc, index, options) };
576    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
577}
578
579extern "C-unwind" {
580    #[deprecated = "renamed to `CGImageSource::remove_cache_at_index`"]
581    pub fn CGImageSourceRemoveCacheAtIndex(isrc: &CGImageSource, index: usize);
582}
583
584#[cfg(feature = "objc2-core-graphics")]
585#[deprecated = "renamed to `CGImageSource::thumbnail_at_index`"]
586#[inline]
587pub unsafe extern "C-unwind" fn CGImageSourceCreateThumbnailAtIndex(
588    isrc: &CGImageSource,
589    index: usize,
590    options: Option<&CFDictionary>,
591) -> Option<CFRetained<CGImage>> {
592    extern "C-unwind" {
593        fn CGImageSourceCreateThumbnailAtIndex(
594            isrc: &CGImageSource,
595            index: usize,
596            options: Option<&CFDictionary>,
597        ) -> Option<NonNull<CGImage>>;
598    }
599    let ret = unsafe { CGImageSourceCreateThumbnailAtIndex(isrc, index, options) };
600    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
601}
602
603#[deprecated = "renamed to `CGImageSource::new_incremental`"]
604#[inline]
605pub unsafe extern "C-unwind" fn CGImageSourceCreateIncremental(
606    options: Option<&CFDictionary>,
607) -> CFRetained<CGImageSource> {
608    extern "C-unwind" {
609        fn CGImageSourceCreateIncremental(
610            options: Option<&CFDictionary>,
611        ) -> Option<NonNull<CGImageSource>>;
612    }
613    let ret = unsafe { CGImageSourceCreateIncremental(options) };
614    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
615    unsafe { CFRetained::from_raw(ret) }
616}
617
618extern "C-unwind" {
619    #[deprecated = "renamed to `CGImageSource::update_data`"]
620    pub fn CGImageSourceUpdateData(isrc: &CGImageSource, data: &CFData, r#final: bool);
621}
622
623extern "C-unwind" {
624    #[cfg(feature = "objc2-core-graphics")]
625    #[deprecated = "renamed to `CGImageSource::update_data_provider`"]
626    pub fn CGImageSourceUpdateDataProvider(
627        isrc: &CGImageSource,
628        provider: &CGDataProvider,
629        r#final: bool,
630    );
631}
632
633extern "C-unwind" {
634    #[deprecated = "renamed to `CGImageSource::status`"]
635    pub fn CGImageSourceGetStatus(isrc: &CGImageSource) -> CGImageSourceStatus;
636}
637
638extern "C-unwind" {
639    #[deprecated = "renamed to `CGImageSource::status_at_index`"]
640    pub fn CGImageSourceGetStatusAtIndex(isrc: &CGImageSource, index: usize)
641        -> CGImageSourceStatus;
642}
643
644extern "C-unwind" {
645    #[deprecated = "renamed to `CGImageSource::primary_image_index`"]
646    pub fn CGImageSourceGetPrimaryImageIndex(isrc: &CGImageSource) -> usize;
647}
648
649#[deprecated = "renamed to `CGImageSource::auxiliary_data_info_at_index`"]
650#[inline]
651pub unsafe extern "C-unwind" fn CGImageSourceCopyAuxiliaryDataInfoAtIndex(
652    isrc: &CGImageSource,
653    index: usize,
654    auxiliary_image_data_type: &CFString,
655) -> Option<CFRetained<CFDictionary>> {
656    extern "C-unwind" {
657        fn CGImageSourceCopyAuxiliaryDataInfoAtIndex(
658            isrc: &CGImageSource,
659            index: usize,
660            auxiliary_image_data_type: &CFString,
661        ) -> Option<NonNull<CFDictionary>>;
662    }
663    let ret = unsafe {
664        CGImageSourceCopyAuxiliaryDataInfoAtIndex(isrc, index, auxiliary_image_data_type)
665    };
666    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
667}
668
669extern "C-unwind" {
670    #[deprecated = "renamed to `CGImageSource::set_allowable_types`"]
671    pub fn CGImageSourceSetAllowableTypes(allowable_types: &CFArray) -> OSStatus;
672}