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    #[cfg(all(feature = "block2", feature = "objc2-core-graphics"))]
68    pub fn CGAnimateImageAtURLWithBlock(
69        url: &CFURL,
70        options: Option<&CFDictionary>,
71        block: CGImageSourceAnimationBlock,
72    ) -> OSStatus;
73}
74
75extern "C-unwind" {
76    /// Animate the sequence of images contained in `data`. Currently supported image
77    /// formats are GIF and APNG. The `options` dictionary may be used to request additional playback
78    /// options; see the list of keys above for more information. The block is called on the main queue
79    /// at time intervals specified by the `delay time` of the image. The animation can be stopped by
80    /// setting the boolean parameter of the block to true.
81    #[cfg(all(feature = "block2", feature = "objc2-core-graphics"))]
82    pub fn CGAnimateImageDataWithBlock(
83        data: &CFData,
84        options: Option<&CFDictionary>,
85        block: CGImageSourceAnimationBlock,
86    ) -> OSStatus;
87}