objc2_av_foundation/generated/AVGeometry.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4#[cfg(feature = "objc2-core-foundation")]
5use objc2_core_foundation::*;
6#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern "C-unwind" {
13 /// Returns a scaled CGRect that maintains the aspect ratio specified by a CGSize within a bounding CGRect.
14 ///
15 /// This is useful when attempting to fit the presentationSize property of an AVPlayerItem within the bounds of another CALayer.
16 /// You would typically use the return value of this function as an AVPlayerLayer frame property value. For example:
17 /// myPlayerLayer.frame = AVMakeRectWithAspectRatioInsideRect(myPlayerItem.presentationSize, mySuperLayer.bounds);
18 ///
19 /// Parameter `aspectRatio`: The width
20 /// &
21 /// height ratio, or aspect, you wish to maintain.
22 ///
23 /// Parameter `boundingRect`: The bounding CGRect you wish to fit into.
24 #[cfg(feature = "objc2-core-foundation")]
25 pub fn AVMakeRectWithAspectRatioInsideRect(
26 aspect_ratio: CGSize,
27 bounding_rect: CGRect,
28 ) -> CGRect;
29}
30
31mod private_NSValueCMVideoDimensionsExtensions {
32 pub trait Sealed {}
33}
34
35/// Category on [`NSValue`].
36pub unsafe trait NSValueCMVideoDimensionsExtensions:
37 ClassType + Sized + private_NSValueCMVideoDimensionsExtensions::Sealed
38{
39 extern_methods!(
40 #[cfg(feature = "objc2-core-media")]
41 /// Creates a NSValue object encoding a CMVideoDimensions struct value.
42 ///
43 ///
44 /// Parameter `dimensions`: The CMVideoDimensions struct to encode.
45 ///
46 /// Returns: An NSValue object encoding the provided dimensions.
47 ///
48 ///
49 /// This extension simplifies converting CMVideoDimensions struct values into NSValue objects.
50 #[unsafe(method(valueWithCMVideoDimensions:))]
51 #[unsafe(method_family = none)]
52 unsafe fn valueWithCMVideoDimensions(
53 dimensions: CMVideoDimensions,
54 ) -> Option<Retained<NSValue>>;
55
56 #[cfg(feature = "objc2-core-media")]
57 /// Returns the CMVideoDimensions struct encoded by this object.
58 ///
59 ///
60 /// This property simplifies accessing the contents of AVCaptureDeviceFormat.supportedMaxPhotoDimensions which are CMVideoDimension struct values encoded in NSValue objects.
61 #[unsafe(method(CMVideoDimensionsValue))]
62 #[unsafe(method_family = none)]
63 unsafe fn CMVideoDimensionsValue(&self) -> CMVideoDimensions;
64 );
65}
66
67impl private_NSValueCMVideoDimensionsExtensions::Sealed for NSValue {}
68unsafe impl NSValueCMVideoDimensionsExtensions for NSValue {}