forked from alejandrojapkin/CocoaLUT
/
LUT1D.h
96 lines (72 loc) · 3.07 KB
/
LUT1D.h
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
//
// LUT1D.h
// Pods
//
// Created by Greg Cotten and Wil Gieseler on 3/5/14.
//
//
#import <Foundation/Foundation.h>
#import "CocoaLUT.h"
#import "LUT.h"
#import <M13OrderedDictionary/M13OrderedDictionary.h>
@class LUTColor;
@class LUT3D;
/**
* A one-dimensional color lookup table that is represented by three channel curves.
*/
@interface LUT1D : LUT
/**
* Initializes and returns a 1D LUT with the specified channel curves.
*
* An exception will be raised unless all three curves contain the same number of points.
*
* @param redCurve An array of `NSNumber` instances representing the brightness of the red channel curve. Values should be between 0 and 1.
* @param greenCurve An array of `NSNumber` instances representing the brightness of the green channel curve. Values should be between 0 and 1.
* @param blueCurve An array of `NSNumber` instances representing the brightness of the blue channel curve. Values should be between 0 and 1.
*
* @return A newly initialized 1D LUT.
*/
+ (instancetype)LUT1DWithRedCurve:(NSArray *)redCurve
greenCurve:(NSArray *)greenCurve
blueCurve:(NSArray *)blueCurve
lowerBound:(double)lowerBound
upperBound:(double)upperBound;
+ (instancetype)LUT1DWith1DCurve:(NSArray *)curve1D
lowerBound:(double)lowerBound
upperBound:(double)upperBound;
- (BOOL)isReversibleWithStrictness:(BOOL)strict;
- (instancetype)LUT1DByReversingWithStrictness:(BOOL)strictness;
- (instancetype)LUT1DBySwizzling1DChannelsWithMethod:(LUT1DSwizzleChannelsMethod)method;
+ (M13OrderedDictionary *)LUT1DSwizzleChannelsMethods;
+ (M13OrderedDictionary *)LUT1DDefaultSizes;
/**
* Initializes a newly allocated 1D LUT with the specified channel curves.
*
* An exception will be raised unless all three curves contain the same number of points.
*
* @param redCurve An array of `NSNumber` instances representing the brightness of the red channel curve. Values should be between 0 and 1.
* @param greenCurve An array of `NSNumber` instances representing the brightness of the green channel curve. Values should be between 0 and 1.
* @param blueCurve An array of `NSNumber` instances representing the brightness of the blue channel curve. Values should be between 0 and 1.
*
* @return A newly initialized 1D LUT.
*/
- (instancetype)initWithRedCurve:(NSArray *)redCurve
greenCurve:(NSArray *)greenCurve
blueCurve:(NSArray *)blueCurve
lowerBound:(double)lowerBound
upperBound:(double)upperBound;
//convenience method for comparison purposes
- (NSMutableArray *)colorCurve;
- (NSArray *)rgbCurveArray;
- (double)valueAtR:(NSUInteger)r;
- (double)valueAtG:(NSUInteger)g;
- (double)valueAtB:(NSUInteger)b;
/**
* Generates a 3D LUT that represents an approximation of the transformation applied by the channel curves.
*
* @param size The edge length of the 3D LUT cube.
*
* @return A new `LUT`.
*/
- (LUT3D *)LUT3DOfSize:(NSUInteger)size;
@end