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