objc2_image_io/generated/
CGImageAnimation.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/imageio/cgimageanimationstatus?language=objc)
14// NS_ENUM
15#[repr(transparent)]
16#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
17pub struct CGImageAnimationStatus(pub OSStatus);
18impl CGImageAnimationStatus {
19    #[doc(alias = "kCGImageAnimationStatus_ParameterError")]
20    pub const ParameterError: Self = Self(-22140);
21    #[doc(alias = "kCGImageAnimationStatus_CorruptInputImage")]
22    pub const CorruptInputImage: Self = Self(-22141);
23    #[doc(alias = "kCGImageAnimationStatus_UnsupportedFormat")]
24    pub const UnsupportedFormat: Self = Self(-22142);
25    #[doc(alias = "kCGImageAnimationStatus_IncompleteInputImage")]
26    pub const IncompleteInputImage: Self = Self(-22143);
27    #[doc(alias = "kCGImageAnimationStatus_AllocationFailure")]
28    pub const AllocationFailure: Self = Self(-22144);
29}
30
31#[cfg(feature = "objc2")]
32unsafe impl Encode for CGImageAnimationStatus {
33    const ENCODING: Encoding = OSStatus::ENCODING;
34}
35
36#[cfg(feature = "objc2")]
37unsafe impl RefEncode for CGImageAnimationStatus {
38    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
39}
40
41extern "C" {
42    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimageanimationstartindex?language=objc)
43    pub static kCGImageAnimationStartIndex: &'static CFString;
44}
45
46extern "C" {
47    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimageanimationdelaytime?language=objc)
48    pub static kCGImageAnimationDelayTime: &'static CFString;
49}
50
51extern "C" {
52    /// [Apple's documentation](https://developer.apple.com/documentation/imageio/kcgimageanimationloopcount?language=objc)
53    pub static kCGImageAnimationLoopCount: &'static CFString;
54}
55
56/// [Apple's documentation](https://developer.apple.com/documentation/imageio/cgimagesourceanimationblock?language=objc)
57#[cfg(all(feature = "block2", feature = "objc2-core-graphics"))]
58pub type CGImageSourceAnimationBlock =
59    *mut block2::DynBlock<dyn Fn(usize, NonNull<CGImage>, NonNull<bool>)>;
60
61extern "C-unwind" {
62    /// Animate the sequence of images contained in the file at `url`. Currently supported image
63    /// formats are GIF and APNG. The `options` dictionary may be used to request additional playback
64    /// options; see the list of keys above for more information. The block is called on the main queue
65    /// at time intervals specified by the `delay time` of the image. The animation can be stopped by
66    /// setting the boolean parameter of the block to true.
67    ///
68    /// # Safety
69    ///
70    /// - `options` generics must be of the correct type.
71    /// - `block` must be a valid pointer.
72    #[cfg(all(feature = "block2", feature = "objc2-core-graphics"))]
73    pub fn CGAnimateImageAtURLWithBlock(
74        url: &CFURL,
75        options: Option<&CFDictionary>,
76        block: CGImageSourceAnimationBlock,
77    ) -> OSStatus;
78}
79
80extern "C-unwind" {
81    /// Animate the sequence of images contained in `data`. Currently supported image
82    /// formats are GIF and APNG. The `options` dictionary may be used to request additional playback
83    /// options; see the list of keys above for more information. The block is called on the main queue
84    /// at time intervals specified by the `delay time` of the image. The animation can be stopped by
85    /// setting the boolean parameter of the block to true.
86    ///
87    /// # Safety
88    ///
89    /// - `options` generics must be of the correct type.
90    /// - `block` must be a valid pointer.
91    #[cfg(all(feature = "block2", feature = "objc2-core-graphics"))]
92    pub fn CGAnimateImageDataWithBlock(
93        data: &CFData,
94        options: Option<&CFDictionary>,
95        block: CGImageSourceAnimationBlock,
96    ) -> OSStatus;
97}