commit | author | age
|
3eceb5
|
1 |
// |
W |
2 |
// VKImageParameters.h |
|
3 |
// |
|
4 |
// Copyright (c) 2014 VK.com |
|
5 |
// |
|
6 |
// Permission is hereby granted, free of charge, to any person obtaining a copy of |
|
7 |
// this software and associated documentation files (the "Software"), to deal in |
|
8 |
// the Software without restriction, including without limitation the rights to |
|
9 |
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
|
10 |
// the Software, and to permit persons to whom the Software is furnished to do so, |
|
11 |
// subject to the following conditions: |
|
12 |
// |
|
13 |
// The above copyright notice and this permission notice shall be included in all |
|
14 |
// copies or substantial portions of the Software. |
|
15 |
// |
|
16 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
17 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
18 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
19 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
20 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
21 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
22 |
|
|
23 |
#import "VKObject.h" |
|
24 |
|
|
25 |
/** |
|
26 |
Describes image representation type |
|
27 |
*/ |
|
28 |
typedef enum VKImageType { |
|
29 |
/// Sets jpeg representation of image |
|
30 |
VKImageTypeJpg, |
|
31 |
/// Sets png representation of image |
|
32 |
VKImageTypePng |
|
33 |
} VKImageType; |
|
34 |
|
|
35 |
/** |
|
36 |
Parameters used for uploading image into VK servers |
|
37 |
*/ |
|
38 |
@interface VKImageParameters : VKObject |
|
39 |
|
|
40 |
/// Type of image compression. Can be <b>VKImageTypeJpg</b> or <b>VKImageTypePng</b>. |
|
41 |
@property(nonatomic, assign) VKImageType imageType; |
|
42 |
/// Quality used for jpg compression. From 0.0 to 1.0 |
|
43 |
@property(nonatomic, assign) CGFloat jpegQuality; |
|
44 |
|
|
45 |
/** |
|
46 |
Creates new parameters instance for png image. |
|
47 |
@return New instance of parameters |
|
48 |
*/ |
|
49 |
+ (instancetype)pngImage; |
|
50 |
|
|
51 |
/** |
|
52 |
Creates new parameters instance for jpeg image. |
|
53 |
@param quality Used only for <b>VKImageTypeJpg</b> representation. From 0.0 to 1.0 |
|
54 |
@return New instance with passed parameters |
|
55 |
*/ |
|
56 |
+ (instancetype)jpegImageWithQuality:(float)quality; |
|
57 |
|
|
58 |
/** |
|
59 |
Return file extension for selected type |
|
60 |
@return png for VKImageTypePng image type, jpg for VKImageTypeJpg image type |
|
61 |
*/ |
|
62 |
- (NSString *)fileExtension; |
|
63 |
|
|
64 |
/** |
|
65 |
Return mime type |
|
66 |
@return parameters mime type |
|
67 |
*/ |
|
68 |
- (NSString *)mimeType; |
|
69 |
@end |
|
70 |
|
|
71 |
|