summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreviewView.h
blob: 29d0ae8672cc1a5d6eaf0f95d1ea76cf8fa4b189 (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
/* HBPreviewView.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 <Cocoa/Cocoa.h>

NS_ASSUME_NONNULL_BEGIN

/**
 *  A HBPreviewView is a sublcass of NSView that can be used to display an image
 *  plus a border.
 */
@interface HBPreviewView : NSView

/**
 *  The image displayed by the view.
 */
@property (nonatomic, readwrite, nullable) CGImageRef image;

/**
 *  The scale at which the image is shown.
 */
@property (nonatomic, readonly) CGFloat scale;

/**
 *  The actual frame of the displayed image.
 */
@property (nonatomic, readonly) CGRect pictureFrame;

/**
 *  Wheters the image will be scaled to fill the view
 *  or not.
 */
@property (nonatomic, readwrite) BOOL fitToView;

/**
 *  If enabled, the view will show a white border around the image.
 */
@property (nonatomic, readwrite) BOOL showBorder;

/**
 *  If enabled, the view will show a shadow around the image.
 */
@property (nonatomic, readwrite) BOOL showShadow;

/**
 * Given the size of the preview image to be shown, returns the best possible
 * size for the view.
 */
- (NSSize)optimalViewSizeForImageSize:(NSSize)imageSize minSize:(NSSize)minSize scaleFactor:(CGFloat)scaleFactor;

@end

NS_ASSUME_NONNULL_END