objc2_av_foundation/generated/
AVCameraCalibrationData.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// AVCameraCalibrationData is a model object describing a camera's calibration information.
14    ///
15    ///
16    /// When rendering effects to images produced by cameras, or performing computer vision tasks such as correcting images for geometric distortions, it is necessary to characterize the camera's calibration information, such as its pixel focal length, principal point, lens distortion characteristics, etc. AVCameraCalibrationData provides this information.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcameracalibrationdata?language=objc)
19    #[unsafe(super(NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    pub struct AVCameraCalibrationData;
22);
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for AVCameraCalibrationData {}
26);
27
28impl AVCameraCalibrationData {
29    extern_methods!(
30        #[unsafe(method(init))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34        #[unsafe(method(new))]
35        #[unsafe(method_family = new)]
36        pub unsafe fn new() -> Retained<Self>;
37
38        #[cfg(feature = "objc2-core-foundation")]
39        /// The reference frame dimensions used in calculating a camera's principal point.
40        ///
41        ///
42        /// A camera's intrinsic matrix expresses values in pixels with respect to a frame of this width and height.
43        #[unsafe(method(intrinsicMatrixReferenceDimensions))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn intrinsicMatrixReferenceDimensions(&self) -> CGSize;
46
47        /// The size of one pixel at intrinsicMatrixReferenceDimensions in millimeters.
48        #[unsafe(method(pixelSize))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn pixelSize(&self) -> c_float;
51
52        /// An NSData of floats describing the camera lens' radial distortions.
53        ///
54        ///
55        /// Images captured by a camera are geometrically warped by radial distortions in the lens. In order to project from the 2D image plane back into the 3D world, the images must be distortion corrected, or made rectilinear. Lens distortion is modeled using a one-dimensional lookup table of 32-bit float values evenly distributed along a radius from the center of the distortion to the farthest corner, with each value representing an elongation or compression of the radius (0.0 for any given point indicates no elongation). This model assumes radially symmetric lens distortion. When dealing with AVDepthData, the disparity / depth map representations are geometrically distorted to align with images produced by the camera. For more information, see the reference implementation below.
56        ///
57        /// If the camera lacks the calibration data needed to accurately characterize lens distortions, this property's value is nil.
58        #[unsafe(method(lensDistortionLookupTable))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn lensDistortionLookupTable(&self) -> Option<Retained<NSData>>;
61
62        /// An NSData of floats describing the inverse lookup table required to reapply the camera lens' radial distortions to a rectified image.
63        ///
64        ///
65        /// See lensDistortionLookupTable. If you've rectified an image by removing the distortions characterized by the lensDistortionLookupTable, and now wish to go back to geometrically distorted, you may use the inverseLensDistortionLookupTable. For more information, see the reference implementation below.
66        ///
67        /// If the camera lacks the calibration data needed to accurately characterize lens distortions, this property's value is nil.
68        #[unsafe(method(inverseLensDistortionLookupTable))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn inverseLensDistortionLookupTable(&self) -> Option<Retained<NSData>>;
71
72        #[cfg(feature = "objc2-core-foundation")]
73        /// A CGPoint describing the offset of the lens’ distortion center from the top left in intrinsicMatrixReferenceDimensions.
74        ///
75        ///
76        /// Due to geometric distortions in the image, the center of the distortion may not be equal to the optical center (principal point) of the lens. When making an image rectilinear, the distortion center should be used rather than the optical center of the image. For more information, see the reference implementation below.
77        ///
78        /// If the camera lacks the calibration data needed to accurately characterize lens distortions, this property's value is set to CGPointZero and should not be used.
79        #[unsafe(method(lensDistortionCenter))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn lensDistortionCenter(&self) -> CGPoint;
82    );
83}