summaryrefslogtreecommitdiffstats
path: root/macosx/HBPicture.h
blob: 219299344d0b6295c6cd06834125c184baec886a (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*  HBPicture.h $

 This file is part of the HandBrake source code.
 Homepage: <http://handbrake.fr/>.
 It may be used under the terms of the GNU General Public License. */

#import <Foundation/Foundation.h>
#import <HandBrakeKit/HBPresetCoding.h>

@class HBTitle;

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, HBPictureResolutionLimitMode) {
    HBPictureResolutionLimitModeNone,
    HBPictureResolutionLimitMode8K,
    HBPictureResolutionLimitMode4K,
    HBPictureResolutionLimitMode1440p,
    HBPictureResolutionLimitMode1080p,
    HBPictureResolutionLimitMode720p,
    HBPictureResolutionLimitMode576p,
    HBPictureResolutionLimitMode480p,
    HBPictureResolutionLimitModeCustom,
};

typedef NS_ENUM(NSUInteger, HBPictureAnarmophicMode) {
    HBPictureAnarmophicModeNone,
    HBPictureAnarmophicModeStrict,
    HBPictureAnarmophicModeLoose,
    HBPictureAnarmophicModeCustom,
    HBPictureAnarmophicModeAuto
};

typedef NS_ENUM(NSUInteger, HBPicturePaddingMode) {
    HBPicturePaddingModeNone,
    HBPicturePaddingModeFill,
    HBPicturePaddingModeFillHeight,
    HBPicturePaddingModeFillWidth,
    HBPicturePaddingModeCustom
};

typedef NS_ENUM(NSUInteger, HBPicturePaddingColorMode) {
    HBPicturePaddingColorModeBlack,
    HBPicturePaddingColorModeWhite,
    HBPicturePaddingColorModeCustom,
};

extern NSString * const HBPictureChangedNotification;

/**
 * HBPicture
 */
@interface HBPicture : NSObject <NSSecureCoding, NSCopying>

/**
 *  Rotation
 */
@property (nonatomic, readwrite) int rotate;
@property (nonatomic, readwrite) BOOL flip;

/**
 *  Size
 */
@property (nonatomic, readwrite) HBPictureResolutionLimitMode resolutionLimitMode;
@property (nonatomic, readwrite) int maxWidth;
@property (nonatomic, readwrite) int maxHeight;
@property (nonatomic, readwrite) BOOL allowUpscaling;
@property (nonatomic, readwrite) BOOL useMaximumSize;

@property (nonatomic, readwrite) int width;
@property (nonatomic, readwrite) int height;

@property (nonatomic, readwrite) BOOL keepDisplayAspect;
@property (nonatomic, readwrite) HBPictureAnarmophicMode anamorphicMode;

/**
 *  Custom anamorphic settings
 */
@property (nonatomic, readwrite) int displayWidth;
@property (nonatomic, readwrite) int parWidth;
@property (nonatomic, readwrite) int parHeight;

/**
 *  Crop settings
 */
@property (nonatomic, readwrite) BOOL autocrop;
@property (nonatomic, readwrite) int cropTop;
@property (nonatomic, readwrite) int cropBottom;
@property (nonatomic, readwrite) int cropLeft;
@property (nonatomic, readwrite) int cropRight;

/**
 *  Padding settings
 */
@property (nonatomic, readwrite) HBPicturePaddingMode paddingMode;
@property (nonatomic, readwrite) int paddingTop;
@property (nonatomic, readwrite) int paddingBottom;
@property (nonatomic, readwrite) int paddingLeft;
@property (nonatomic, readwrite) int paddingRight;
@property (nonatomic, readwrite) HBPicturePaddingColorMode paddingColorMode;
@property (nonatomic, readwrite) NSString *paddingColorCustom;

/**
 *  Source size
 */
@property (nonatomic, readonly) int sourceWidth;
@property (nonatomic, readonly) int sourceHeight;
@property (nonatomic, readonly) int sourceDisplayWidth;

@property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;

@end

NS_ASSUME_NONNULL_END