-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathImageCropView.h
More file actions
118 lines (89 loc) · 3.01 KB
/
Copy pathImageCropView.h
File metadata and controls
118 lines (89 loc) · 3.01 KB
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
115
116
117
//
// Created by Ming Yang on 7/7/12.
//
#import <UIKit/UIKit.h>
#import "FXBlurView.h"
#pragma mark ControlPointView interface
@interface ControlPointView : UIView {
CGFloat red, green, blue, alpha;
}
@property (nonatomic, retain) UIColor* color;
@end
#pragma mark ShadeView interface
@interface ShadeView : UIView {
CGFloat cropBorderRed, cropBorderGreen, cropBorderBlue, cropBorderAlpha;
CGRect cropArea;
CGFloat shadeAlpha;
}
@property (nonatomic, retain) UIColor* cropBorderColor;
@property (nonatomic) CGRect cropArea;
@property (nonatomic) CGFloat shadeAlpha;
@property (nonatomic, strong) UIImageView *blurredImageView;
@end
CGRect SquareCGRectAtCenter(CGFloat centerX, CGFloat centerY, CGFloat size);
UIView* dragView;
typedef struct {
CGPoint dragStart;
CGPoint topLeftCenter;
CGPoint bottomLeftCenter;
CGPoint bottomRightCenter;
CGPoint topRightCenter;
CGPoint clearAreaCenter;
} DragPoint;
// Used when working with multiple dragPoints
typedef struct {
DragPoint mainPoint;
DragPoint optionalPoint;
NSUInteger lastCount;
} MultiDragPoint;
#pragma mark ImageCropView interface
@interface ImageCropView : UIView {
UIImageView* imageView;
CGRect imageFrameInView;
CGFloat imageScale;
CGFloat controlPointSize;
ControlPointView* topLeftPoint;
ControlPointView* bottomLeftPoint;
ControlPointView* bottomRightPoint;
ControlPointView* topRightPoint;
NSArray *PointsArray;
UIColor* controlColor;
UIView* cropAreaView;
DragPoint dragPoint;
MultiDragPoint multiDragPoint;
UIView* dragViewOne;
UIView* dragViewTwo;
}
- (id)initWithFrame:(CGRect)frame blurOn:(BOOL)blurOn pointSize:(CGFloat)pointSize;
- (void)setImage:(UIImage*)image;
@property (nonatomic) CGFloat controlPointSize;
@property (nonatomic, retain) UIImage* image;
@property (nonatomic) CGRect cropAreaInView;
@property (nonatomic) CGRect cropAreaInImage;
@property (nonatomic, readonly) CGFloat imageScale;
@property (nonatomic) CGFloat maskAlpha;
@property (nonatomic, retain) UIColor* controlColor;
@property (nonatomic, strong) ShadeView* shadeView;
@property (nonatomic) BOOL blurred;
@end
#pragma mark ImageCropViewController interface
@protocol ImageCropViewControllerDelegate <NSObject>
- (void)ImageCropViewController:(UIViewController* )controller didFinishCroppingImage:(UIImage *)croppedImage;
- (void)ImageCropViewControllerDidCancel:(UIViewController *)controller;
@end
@interface ImageCropViewController : UIViewController <UIActionSheetDelegate > {
ImageCropView * cropView;
UIActionSheet * actionSheet;
}
@property (nonatomic, weak) id<ImageCropViewControllerDelegate> delegate;
@property (nonatomic) BOOL blurredBackground;
@property (nonatomic) CGFloat pointSize;
@property (nonatomic, retain) UIImage* image;
@property (nonatomic, retain) ImageCropView* cropView;
- (id)initWithImage:(UIImage*)image;
- (IBAction)cancel:(id)sender;
- (IBAction)done:(id)sender;
@end
@interface UIImage (fixOrientation)
- (UIImage *)fixOrientation;
@end