├── .gitignore
├── Core Image Fun House.zip
├── FunHouse
├── Base.lproj
│ ├── EffectStack.xib
│ ├── FilterPalette.xib
│ ├── FunHouseWindow.xib
│ ├── MainMenu.xib
│ └── Preferences.xib
├── CoreImageView.h
├── CoreImageView.m
├── EffectStack.h
├── EffectStack.m
├── EffectStackController.h
├── EffectStackController.m
├── EffectStackController.swift
├── FilterView.h
├── FilterView.m
├── Fun House-Bridging-Header.h
├── FunHouse.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── FunHouseAppDelegate.h
├── FunHouseAppDelegate.m
├── FunHouseApplication.h
├── FunHouseApplication.m
├── FunHouseDocument.h
├── FunHouseDocument.m
├── FunHouseWindowController.h
├── FunHouseWindowController.m
├── FunHouse_Prefix.pch
├── Images
│ ├── Bryce.jpg
│ ├── Copenhagen.jpg
│ ├── Flowers.jpg
│ └── Wolf.jpg
├── Info.plist
├── NSApplicationIcon.icns
├── Notes
├── ParameterView.h
├── ParameterView.m
├── Preferences.xib
├── ReadMe.txt
├── SampleCIView.h
├── SampleCIView.m
├── colormap.tiff
├── document.icns
├── en.lproj
│ ├── Credits.rtf
│ └── InfoPlist.strings
├── lightball.tiff
├── main.m
├── mask.tiff
├── minusbutton.tiff
├── playbutton.tiff
├── plusbutton.tiff
├── restrictedshine.tiff
└── smoothtexture.tiff
├── LICENSE
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xccheckout
23 | *.xcscmblueprint
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 | *.ipa
28 | *.dSYM.zip
29 | *.dSYM
30 |
31 | # CocoaPods
32 | #
33 | # We recommend against adding the Pods directory to your .gitignore. However
34 | # you should judge for yourself, the pros and cons are mentioned at:
35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
36 | #
37 | # Pods/
38 |
39 | # Carthage
40 | #
41 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
42 | # Carthage/Checkouts
43 |
44 | Carthage/Build
45 |
46 | # fastlane
47 | #
48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
49 | # screenshots whenever they are needed.
50 | # For more information about the recommended setup visit:
51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
52 |
53 | fastlane/report.xml
54 | fastlane/Preview.html
55 | fastlane/screenshots/**/*.png
56 | fastlane/test_output
57 |
58 | # Code Injection
59 | #
60 | # After new code Injection tools there's a generated folder /iOSInjectionProject
61 | # https://github.com/johnno1962/injectionforxcode
62 |
63 | iOSInjectionProject/
64 |
--------------------------------------------------------------------------------
/Core Image Fun House.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/Core Image Fun House.zip
--------------------------------------------------------------------------------
/FunHouse/Base.lproj/EffectStack.xib:
--------------------------------------------------------------------------------
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 |
38 |
49 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/FunHouse/Base.lproj/FilterPalette.xib:
--------------------------------------------------------------------------------
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 |
85 |
96 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
--------------------------------------------------------------------------------
/FunHouse/Base.lproj/FunHouseWindow.xib:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/FunHouse/Base.lproj/MainMenu.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
209 |
210 |
211 |
212 |
213 |
--------------------------------------------------------------------------------
/FunHouse/CoreImageView.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: CoreImageView.h
3 | Abstract: n/a
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 | #import
50 | #import "SampleCIView.h"
51 |
52 | @class FunHouseWindowController;
53 |
54 | // these are the possible item types that get moved
55 | // within a mouseDown mouseDragged mouseUp loop
56 | enum
57 | {
58 | pmNone = 0,
59 | pmPoint, // moving a filter point (example: the inputCenter parameter to CIBumpDistortion)
60 | pmTopLeft, // moving the top left point of a filter rectangle (example: the inputRectangle parameter to CICrop)
61 | pmBottomLeft, // moving the bottom left point of a filter rectangle (example: the inputRectangle parameter to CICrop)
62 | pmTopRight, // moving the top right point of a filter rectangle (example: the inputRectangle parameter to CICrop)
63 | pmBottomRight, // moving the bottom right point of a filter rectangle (example: the inputRectangle parameter to CICrop)
64 | pmImageOffset, // moving an image layer's offset
65 | pmTextOffset, // moving a text layer's origin
66 | pmTransformOffset, // moving the offset of a filter's affine transform parameter
67 | pmSpotLight, // moving a CISpotLight position parameter
68 | pm3DPoint, // moving the XY components of a filter 3D position parameter
69 | };
70 |
71 | @interface CoreImageView : SampleCIView
72 | {
73 | BOOL initialized;
74 | NSBundle *bundle;
75 | FunHouseWindowController *controller;
76 | // these fields are for mouse movement - they're set up in mouseDown, and used in mouseDragged and mouseUp
77 | NSInteger parmIndex;
78 | NSString *parmKey;
79 | NSInteger parmMode;
80 | NSString *savedActionName;
81 | BOOL movingNow;
82 | // this onee is used to indicate that the filter, image, and text layer origin handles are to be displayed
83 | BOOL displayingPoints;
84 | // the tracking rectangle is set up so mouseEntered and mouseExited events will be generated
85 | NSTrackingRectTag lastTrack;
86 | // view transform
87 | CGFloat viewTransformScale;
88 | CGFloat viewTransformOffsetX;
89 | CGFloat viewTransformOffsetY;
90 | }
91 |
92 | - (void)awakeFromNib;
93 |
94 | - (void)setFunHouseWindowController:(FunHouseWindowController *)c;
95 |
96 | // view transform setters and getters
97 | - (void)setViewTransformScale:(CGFloat)scale;
98 | - (void)setViewTransformOffsetX:(CGFloat)x andY:(CGFloat)y;
99 | - (BOOL)isScaled;
100 |
101 | // setters for filter parameters (undo glue code)
102 | - (void)setFilter:(CIFilter *)f value:(id)val forKey:(NSString *)key; // undoable operation
103 | - (void)setDict:(NSMutableDictionary *)f value:(id)val forKey:(NSString *)key; // undoable operation
104 | - (void)setActionNameForFilter:(CIFilter *)f key:(NSString *)key;
105 | - (void)setActionNameForTextLayerKey:(NSString *)key;
106 |
107 | @end
108 |
--------------------------------------------------------------------------------
/FunHouse/EffectStack.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: EffectStack.h
3 | Abstract: n/a
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 | #import
50 |
51 | @class CoreImageView;
52 |
53 | @interface EffectStack : NSView
54 | {
55 | CIImage *baseImage; // a pointer to the base image in the array (generally layers[0].image
56 | NSMutableArray *layers; // effect stack filter, image, text layers in an array
57 | }
58 |
59 | // designated init routine
60 | - (id)init;
61 | // effect stack layer operationsd
62 | - (void)insertFilterLayer:(CIFilter *)filter atIndex:(NSInteger)index;
63 | - (void)insertImageLayer:(CIImage *)image withFilename:(NSString *)filename atIndex:(NSInteger)index;
64 | - (void)insertTextLayer:(NSString *)string withImage:(CIImage *)image atIndex:(NSInteger)index;
65 | - (void)removeLayerAtIndex:(NSInteger)index;
66 | - (void)removeAllLayers;
67 | // getters
68 | - (NSInteger)layerCount;
69 | - (BOOL)layerEnabled:(NSInteger)index;
70 | - (NSString *)typeAtIndex:(NSInteger)index;
71 | - (CIFilter *)filterAtIndex:(NSInteger)index;
72 | - (CIImage *)imageAtIndex:(NSInteger)index;
73 | - (NSPoint)offsetAtIndex:(NSInteger)index;
74 | - (NSString *)filenameAtIndex:(NSInteger)index;
75 | - (NSString *)imageFilePathAtIndex:(NSInteger)index;
76 | - (NSData *)imageFileDataAtIndex:(NSInteger)index;
77 | - (NSString *)stringAtIndex:(NSInteger)index;
78 | - (NSMutableDictionary *)mutableDictionaryAtIndex:(NSInteger)index;
79 | - (CIImage *)baseImage;
80 | - (NSString *)filterLayer:(NSInteger)index imageFilePathValueForKey:(NSString *)key;
81 | - (NSData *)filterLayer:(NSInteger)index imageFileDataValueForKey:(NSString *)key;
82 | // setters
83 | - (void)setLayer:(NSInteger)index enabled:(BOOL)enabled;
84 | - (void)setBaseImage:(CIImage *)image withFilename:(NSString *)filename andImageFilePath:(NSString *)path;
85 | - (void)setFilterLayer:(NSInteger)index imageFilePathValue:(NSString *)path forKey:(NSString *)key;
86 | - (void)setImageLayer:(NSInteger)index offset:(NSPoint)offset;
87 | - (void)setImageLayer:(NSInteger)index image:(CIImage *)image andFilename:(NSString *)filename;
88 | - (void)setImageLayer:(NSInteger)index imageFilePath:(NSString *)path;
89 | - (void)setTextLayer:(NSInteger)index offset:(NSPoint)offset;
90 | - (void)setTextLayer:(NSInteger)index string:(NSString *)string andImage:(CIImage *)image;
91 | // for core image result graph from stack
92 | - (CIImage *)coreImageResultForRect:(NSRect)bounds;
93 | // convenience methods for preventing exceptions during evaluation and for reddening a box (alarm)
94 | - (BOOL)filterHasMissingImage:(CIFilter *)f;
95 | - (BOOL)hasMissingImage;
96 | // for preset encoding
97 | - (void)encodeValue:(id)obj forKey:(NSString *)key intoDictionary:(NSMutableDictionary *)v;
98 | - (id)decodedValueForKey:(NSString *)key ofClass:(NSString *)classname fromDictionary:(NSDictionary *)v;
99 | @end
100 |
--------------------------------------------------------------------------------
/FunHouse/EffectStack.m:
--------------------------------------------------------------------------------
1 | /*
2 | File: EffectStack.m
3 | Abstract: n/a
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import "EffectStack.h"
49 | #import "CoreImageView.h"
50 |
51 | @implementation EffectStack
52 |
53 | - (id)init
54 | {
55 | self = [super init];
56 | if (self)
57 | {
58 | layers = [[NSMutableArray alloc] init];
59 | }
60 | return self;
61 | }
62 |
63 | - (void)dealloc
64 | {
65 | [baseImage release];
66 | [layers release];
67 | [super dealloc];
68 | }
69 |
70 | // insert a filter layer into the layers array
71 | - (void)insertFilterLayer:(CIFilter *)filter atIndex:(NSInteger)index
72 | {
73 | NSMutableDictionary *d;
74 |
75 | d = [NSMutableDictionary dictionaryWithCapacity:2];
76 | [d setValue:@"filter" forKey:@"type"];
77 | [d setValue:filter forKey:@"filter"];
78 | [d setValue:[NSNumber numberWithBool:YES] forKey:@"enabled"];
79 | [layers insertObject:d atIndex:index];
80 | }
81 |
82 | // insert an image layer into the layers array
83 | - (void)insertImageLayer:(CIImage *)image withFilename:(NSString *)filename atIndex:(NSInteger)index
84 | {
85 | NSMutableDictionary *d;
86 |
87 | d = [NSMutableDictionary dictionaryWithCapacity:2];
88 | [d setValue:@"image" forKey:@"type"];
89 | [d setValue:image forKey:@"image"];
90 | [d setValue:[NSNumber numberWithDouble:0.0] forKey:@"offsetX"];
91 | [d setValue:[NSNumber numberWithDouble:0.0] forKey:@"offsetY"];
92 | [d setValue:[NSNumber numberWithBool:YES] forKey:@"enabled"];
93 | [d setValue:filename forKey:@"filename"];
94 | [layers insertObject:d atIndex:index];
95 | }
96 |
97 | // insert a text layer into the layers array
98 | - (void)insertTextLayer:(NSString *)string withImage:(CIImage *)image atIndex:(NSInteger)index
99 | {
100 | NSMutableDictionary *d;
101 |
102 | d = [NSMutableDictionary dictionaryWithCapacity:2];
103 | [d setValue:@"text" forKey:@"type"];
104 | [d setValue:image forKey:@"image"];
105 | [d setValue:string forKey:@"string"];
106 | [d setValue:[NSNumber numberWithDouble:1.0] forKey:@"scale"];
107 | [d setValue:[NSNumber numberWithDouble:0.0] forKey:@"offsetX"];
108 | [d setValue:[NSNumber numberWithDouble:0.0] forKey:@"offsetY"];
109 | [d setValue:[NSNumber numberWithBool:YES] forKey:@"enabled"];
110 | [layers insertObject:d atIndex:index];
111 | }
112 |
113 | // remove an element from the layers array
114 | - (void)removeLayerAtIndex:(NSInteger)index
115 | {
116 | [layers removeObjectAtIndex:index];
117 | }
118 |
119 | // remove all elements from the layers array
120 | - (void)removeAllLayers
121 | {
122 | [layers removeAllObjects];
123 | }
124 |
125 | // return the number of elements in the layers array
126 | - (NSInteger)layerCount
127 | {
128 | return [layers count];
129 | }
130 |
131 | // getter: layers[index].enabled
132 | - (BOOL)layerEnabled:(NSInteger)index
133 | {
134 | NSMutableDictionary *d;
135 |
136 | if (index < 0 || index >= [self layerCount])
137 | {
138 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
139 | return NO;
140 | }
141 | d = [layers objectAtIndex:index];
142 | return [[d valueForKey:@"enabled"] boolValue];
143 | }
144 |
145 | // getter: layers[index].type
146 | - (NSString *)typeAtIndex:(NSInteger)index
147 | {
148 | NSMutableDictionary *d;
149 |
150 | if (index < 0 || index >= [self layerCount])
151 | {
152 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
153 | return nil;
154 | }
155 | d = [layers objectAtIndex:index];
156 | return [d valueForKey:@"type"];
157 | }
158 |
159 | // getter: layers[index].filter
160 | - (CIFilter *)filterAtIndex:(NSInteger)index
161 | {
162 | NSMutableDictionary *d;
163 |
164 | if (index < 0 || index >= [self layerCount])
165 | {
166 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
167 | return nil;
168 | }
169 | d = [layers objectAtIndex:index];
170 | if (![[d valueForKey:@"type"] isEqualToString:@"filter"])
171 | return nil;
172 | return [d valueForKey:@"filter"];
173 | }
174 |
175 | // getter: layers[index].image
176 | - (CIImage *)imageAtIndex:(NSInteger)index
177 | {
178 | NSMutableDictionary *d;
179 |
180 | if (index < 0 || index >= [self layerCount])
181 | {
182 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
183 | return nil;
184 | }
185 | d = [layers objectAtIndex:index];
186 | if (![[d valueForKey:@"type"] isEqualToString:@"image"] && ![[d valueForKey:@"type"] isEqualToString:@"text"])
187 | return nil;
188 | return [d valueForKey:@"image"];
189 | }
190 |
191 | // getter: layers[index].offset
192 | - (NSPoint)offsetAtIndex:(NSInteger)index
193 | {
194 | NSMutableDictionary *d;
195 |
196 | if (index < 0 || index >= [self layerCount])
197 | {
198 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
199 | return NSMakePoint(0.0, 0.0);
200 | }
201 | d = [layers objectAtIndex:index];
202 | if (![[d valueForKey:@"type"] isEqualToString:@"image"] && ![[d valueForKey:@"type"] isEqualToString:@"text"])
203 | return NSMakePoint(0.0, 0.0);
204 | return NSMakePoint([[d valueForKey:@"offsetX"] doubleValue], [[d valueForKey:@"offsetY"] doubleValue]);
205 | }
206 |
207 | // getter: layers[index].filename
208 | - (NSString *)filenameAtIndex:(NSInteger)index
209 | {
210 | NSMutableDictionary *d;
211 |
212 | if (index < 0 || index >= [self layerCount])
213 | {
214 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
215 | return nil;
216 | }
217 | d = [layers objectAtIndex:index];
218 | if (![[d valueForKey:@"type"] isEqualToString:@"image"])
219 | return nil;
220 | return [d valueForKey:@"filename"];
221 | }
222 |
223 | // getter: layers[index].imageFilePath
224 | - (NSString *)imageFilePathAtIndex:(NSInteger)index
225 | {
226 | NSMutableDictionary *d;
227 |
228 | if (index < 0 || index >= [self layerCount])
229 | {
230 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
231 | return nil;
232 | }
233 | d = [layers objectAtIndex:index];
234 | if (![[d valueForKey:@"type"] isEqualToString:@"image"])
235 | return nil;
236 | return [d valueForKey:@"imageFilePath"];
237 | }
238 |
239 | // getter: layers[index].imageFileData
240 | - (NSData *)imageFileDataAtIndex:(NSInteger)index
241 | {
242 | NSMutableDictionary *d;
243 |
244 | if (index < 0 || index >= [self layerCount])
245 | {
246 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
247 | return nil;
248 | }
249 | d = [layers objectAtIndex:index];
250 | if (![[d valueForKey:@"type"] isEqualToString:@"image"])
251 | return nil;
252 | return [d valueForKey:@"imageFileData"];
253 | }
254 |
255 | // getter: layers[index].string
256 | - (NSString *)stringAtIndex:(NSInteger)index
257 | {
258 | NSMutableDictionary *d;
259 |
260 | if (index < 0 || index >= [self layerCount])
261 | {
262 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
263 | return nil;
264 | }
265 | d = [layers objectAtIndex:index];
266 | if (![[d valueForKey:@"type"] isEqualToString:@"text"])
267 | return nil;
268 | return [d valueForKey:@"string"];
269 | }
270 |
271 | // getter: layers[index] - used for text case where there are way too many to access otherwise
272 | - (NSMutableDictionary *)mutableDictionaryAtIndex:(NSInteger)index
273 | {
274 | if (index < 0 || index >= [self layerCount])
275 | {
276 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
277 | return nil;
278 | }
279 | return [layers objectAtIndex:index];
280 | }
281 |
282 | // getter: layers[0].image
283 | - (CIImage *)baseImage
284 | {
285 | if ([[self typeAtIndex:0] isEqualToString:@"image"])
286 | return [self imageAtIndex:0];
287 | return nil;
288 | }
289 |
290 | // getter: [layers[0].imageFilePaths valueForKey:key].path
291 | - (NSString *)filterLayer:(NSInteger)index imageFilePathValueForKey:(NSString *)key
292 | {
293 | NSMutableDictionary *d;
294 |
295 | if (index < 0 || index >= [self layerCount])
296 | {
297 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
298 | return nil;
299 | }
300 | d = [layers objectAtIndex:index];
301 | if (![[d valueForKey:@"type"] isEqualToString:@"filter"])
302 | return nil;
303 | d = [d valueForKey:@"imageFilePaths"];
304 | if (d == nil)
305 | return nil;
306 | return [[d valueForKey:key] valueForKey:@"path"];
307 | }
308 |
309 | // getter: [layers[0].imageFilePaths valueForKey:key].data
310 | - (NSData *)filterLayer:(NSInteger)index imageFileDataValueForKey:(NSString *)key
311 | {
312 | NSMutableDictionary *d;
313 |
314 | if (index < 0 || index >= [self layerCount])
315 | {
316 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
317 | return nil;
318 | }
319 | d = [layers objectAtIndex:index];
320 | if (![[d valueForKey:@"type"] isEqualToString:@"filter"])
321 | return nil;
322 | d = [d valueForKey:@"imageFilePaths"];
323 | if (d == nil)
324 | return nil;
325 | return [[d valueForKey:key] valueForKey:@"data"];
326 | }
327 |
328 | // setter: [layers[index].imageFilePaths setValue:path forKey:key]
329 | - (void)setFilterLayer:(NSInteger)index imageFilePathValue:(NSString *)path forKey:(NSString *)key
330 | {
331 | NSMutableDictionary *d, *d2, *d3;
332 |
333 | if (index < 0 || index >= [self layerCount])
334 | {
335 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
336 | return;
337 | }
338 | d = [layers objectAtIndex:index];
339 | if ([[d valueForKey:@"type"] isEqualToString:@"filter"])
340 | {
341 | d2 = [d valueForKey:@"imageFilePaths"];
342 | if (d2 == nil)
343 | {
344 | d2 = [NSMutableDictionary dictionary];
345 | [d setValue:d2 forKey:@"imageFilePaths"];
346 | }
347 | d3 = [NSMutableDictionary dictionary];
348 | [d3 setValue:path forKey:@"path"];
349 | // keep image file data around too!
350 | [d3 setValue:[NSData dataWithContentsOfMappedFile:path] forKey:@"data"];
351 | [d2 setValue:d3 forKey:key];
352 | }
353 | }
354 |
355 | // setter: layers[index].enabled
356 | - (void)setLayer:(NSInteger)index enabled:(BOOL)enabled
357 | {
358 | NSMutableDictionary *d;
359 |
360 | if (index < 0 || index >= [self layerCount])
361 | {
362 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
363 | return;
364 | }
365 | d = [layers objectAtIndex:index];
366 | [d setValue:[NSNumber numberWithBool:enabled] forKey:@"enabled"];
367 | }
368 |
369 | // setter: layers[index].offset
370 | - (void)setImageLayer:(NSInteger)index offset:(NSPoint)offset
371 | {
372 | NSMutableDictionary *d;
373 |
374 | if (index < 0 || index >= [self layerCount])
375 | {
376 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
377 | return;
378 | }
379 | d = [layers objectAtIndex:index];
380 | if ([[d valueForKey:@"type"] isEqualToString:@"image"])
381 | {
382 | [d setValue:[NSNumber numberWithDouble:offset.x] forKey:@"offsetX"];
383 | [d setValue:[NSNumber numberWithDouble:offset.y] forKey:@"offsetY"];
384 | }
385 | }
386 |
387 | // setter: layers[index].imageFilePath
388 | - (void)setImageLayer:(NSInteger)index imageFilePath:(NSString *)path
389 | {
390 | NSMutableDictionary *d;
391 |
392 | if (index < 0 || index >= [self layerCount])
393 | {
394 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
395 | return;
396 | }
397 | d = [layers objectAtIndex:index];
398 | if ([[d valueForKey:@"type"] isEqualToString:@"image"])
399 | {
400 | [d setValue:path forKey:@"imageFilePath"];
401 | // keep image file data around too!
402 | [d setValue:[NSData dataWithContentsOfMappedFile:path] forKey:@"imageFileData"];
403 | }
404 | }
405 |
406 | // setter: layers[index].offset
407 | - (void)setTextLayer:(NSInteger)index offset:(NSPoint)offset
408 | {
409 | NSMutableDictionary *d;
410 |
411 | if (index < 0 || index >= [self layerCount])
412 | {
413 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
414 | return;
415 | }
416 | d = [layers objectAtIndex:index];
417 | if ([[d valueForKey:@"type"] isEqualToString:@"text"])
418 | {
419 | [d setValue:[NSNumber numberWithDouble:offset.x] forKey:@"offsetX"];
420 | [d setValue:[NSNumber numberWithDouble:offset.y] forKey:@"offsetY"];
421 | }
422 | }
423 |
424 | // setter: layers[index].image/filename
425 | - (void)setImageLayer:(NSInteger)index image:(CIImage *)image andFilename:(NSString *)filename
426 | {
427 | NSMutableDictionary *d;
428 |
429 | if (index < 0 || index >= [self layerCount])
430 | {
431 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
432 | return;
433 | }
434 | d = [layers objectAtIndex:index];
435 | if ([[d valueForKey:@"type"] isEqualToString:@"image"])
436 | {
437 | [d setValue:image forKey:@"image"];
438 | [d setValue:filename forKey:@"filename"];
439 | }
440 | }
441 |
442 | // setter: layers[index].string/image
443 | - (void)setTextLayer:(NSInteger)index string:(NSString *)string andImage:(CIImage *)image
444 | {
445 | NSMutableDictionary *d;
446 |
447 | if (index < 0 || index >= [self layerCount])
448 | {
449 | printf("index %d is out of range (%d layers in model)\n", (int)index, (int)[self layerCount]);
450 | return;
451 | }
452 | d = [layers objectAtIndex:index];
453 | if ([[d valueForKey:@"type"] isEqualToString:@"text"])
454 | {
455 | [d setValue:image forKey:@"image"];
456 | [d setValue:string forKey:@"string"];
457 | }
458 | }
459 |
460 | // setter: layers[0].image/filename and image/path
461 | - (void)setBaseImage:(CIImage *)image withFilename:(NSString *)filename andImageFilePath:(NSString *)path
462 | {
463 | NSMutableDictionary *d;
464 |
465 | if ([self layerCount] > 0 && [[self typeAtIndex:0] isEqualToString:@"image"])
466 | {
467 | d = [layers objectAtIndex:0];
468 | [d setValue:image forKey:@"image"];
469 | [d setValue:filename forKey:@"filename"];
470 | [d setValue:path forKey:@"imageFilePath"];
471 | }
472 | else if ([self layerCount] == 0)
473 | {
474 | [self insertImageLayer:image withFilename:filename atIndex:0];
475 | d = [layers objectAtIndex:0];
476 | [d setValue:path forKey:@"imageFilePath"];
477 | // keep image file data around too!
478 | [d setValue:[NSData dataWithContentsOfMappedFile:path] forKey:@"imageFileData"];
479 | }
480 | else
481 | printf("attempted setBaseImage with non-empty effect stack\n");
482 | }
483 |
484 | // return the core image graph for the effect stack (constrained to the rectangle)
485 | - (CIImage *)coreImageResultForRect:(NSRect)bounds
486 | {
487 | BOOL usesExtent, usesImage, hasBackground;
488 | NSInteger i, count;
489 | CIFilter *f;
490 | CIImage *result;
491 | NSDictionary *attr;
492 | NSArray *inputKeys;
493 | NSString *key, *classstring, *type;
494 | NSEnumerator *enumerator;
495 | NSMutableArray *resultstack;
496 |
497 | resultstack = [NSMutableArray arrayWithCapacity:10];
498 | // get result of filter running over image
499 | count = [self layerCount];
500 | result = nil;
501 | for (i = 0; i < count; i++)
502 | {
503 | if (![self layerEnabled:i])
504 | continue;
505 | type = [self typeAtIndex:i];
506 | if ([type isEqualToString:@"filter"])
507 | {
508 | // filter layer
509 | f = [self filterAtIndex:i];
510 | if (f == nil)
511 | continue;
512 | usesExtent = NO;
513 | usesImage = NO;
514 | hasBackground = NO;
515 | attr = [f attributes];
516 | inputKeys = [f inputKeys];
517 | // scan the input parameters for various cases we need to handle
518 | enumerator = [inputKeys objectEnumerator];
519 | while ((key = [enumerator nextObject]) != nil)
520 | {
521 | id parameter = [attr objectForKey:key];
522 | if ([parameter isKindOfClass:[NSDictionary class]])
523 | {
524 | classstring = [(NSDictionary *)parameter objectForKey: kCIAttributeClass];
525 | if ([classstring isEqualToString:@"CIVector"] && [key isEqualToString:@"inputExtent"])
526 | usesExtent = YES;
527 | if ([key isEqualToString:@"inputImage"])
528 | usesImage = YES;
529 | if ([key isEqualToString:@"inputBackgroundImage"])
530 | hasBackground = YES;
531 | }
532 | }
533 | // stack generators here
534 | if (!usesImage && result != nil)
535 | // check for automatic SOver of layered results
536 | [resultstack addObject:result]; // keep result around for SOver at end
537 | // supply chained image parameters here
538 | if (usesImage)
539 | {
540 | if (result != nil)
541 | {
542 | if (hasBackground)
543 | [f setValue:result forKey:@"inputBackgroundImage"]; // chain layers (blend modes by background)
544 | else
545 | [f setValue:result forKey:@"inputImage"]; // chain layers
546 | }
547 | }
548 | // supply the obvious extent for any extent parameters
549 | if (usesExtent)
550 | [f setValue: [CIVector vectorWithX: 0 Y: 0 Z: NSWidth(bounds) W: NSHeight(bounds)]
551 | forKey: @"inputExtent"];
552 | // get the filter result
553 | result = [f valueForKey: @"outputImage"];
554 | }
555 | else if ([type isEqualToString:@"image"] || [type isEqualToString:@"text"])
556 | {
557 | // image or text layer
558 | if (result != nil)
559 | // check for automatic SOver of layered results
560 | [resultstack addObject:result]; // keep result around for SOver at end
561 | // get the image and offset
562 | CIImage *im = [self imageAtIndex:i];
563 | NSPoint offset = [self offsetAtIndex:i];
564 | // apply an affine transform to the iamge to account for the offset
565 | f = [CIFilter filterWithName:@"CIAffineTransform"];
566 | NSAffineTransform *t = [NSAffineTransform transform];
567 | [t translateXBy:offset.x yBy:offset.y];
568 | [f setValue:t forKey:@"inputTransform"];
569 | [f setValue:im forKey:@"inputImage"];
570 | // and get the result
571 | result = [f valueForKey:@"outputImage"];
572 | }
573 | }
574 | // at the end, if there are results stacked (base image, other image layers, text layers, generators), overlay them using SOver
575 | if ([resultstack count] > 0)
576 | {
577 | CIFilter *sover;
578 | CIImage *background = nil;
579 |
580 | count = [resultstack count];
581 | for (i = 0; i < count; i++)
582 | {
583 | if (i == 0)
584 | background = [resultstack objectAtIndex:i];
585 | else
586 | {
587 | sover = [CIFilter filterWithName:@"CISourceOverCompositing" keysAndValues:
588 | @"inputBackgroundImage", background, @"inputImage", [resultstack objectAtIndex:i], nil];
589 | background = [sover valueForKey:@"outputImage"];
590 | }
591 | }
592 | if (result == nil)
593 | result = background;
594 | else
595 | {
596 | // finally composite result over stacked items
597 | sover = [CIFilter filterWithName:@"CISourceOverCompositing" keysAndValues:
598 | @"inputBackgroundImage", background, @"inputImage", result, nil];
599 | result = [sover valueForKey:@"outputImage"];
600 | }
601 | }
602 | return result;
603 | }
604 |
605 | // decide if a filter in the effect stack has a missing image parameter
606 | // ignore the chained image parameter (either inputImage or inputBackgroundImage for blend modes/Porter-Duff modes)
607 | - (BOOL)filterHasMissingImage:(CIFilter *)f
608 | {
609 | BOOL hasBackground, missingImage;
610 | NSString *key, *classstring;
611 | NSDictionary *parameter, *attr;
612 | NSArray *inputKeys;
613 | NSEnumerator *enumerator;
614 |
615 | // first check the filter for an uninitialized image
616 | attr = [f attributes];
617 | inputKeys = [f inputKeys];
618 | hasBackground = NO;
619 | enumerator = [inputKeys objectEnumerator];
620 | // decide first if the filter has a background image - it is a blend mode or compositing method
621 | while ((key = [enumerator nextObject]) != nil)
622 | {
623 | parameter = [attr objectForKey:key];
624 | classstring = [parameter objectForKey: kCIAttributeClass];
625 | if ([classstring isEqualToString:@"CIImage"] && [key isEqualToString:@"inputBackgroundImage"])
626 | hasBackground = YES;
627 | }
628 | missingImage = NO;
629 | enumerator = [inputKeys objectEnumerator];
630 | while ((key = [enumerator nextObject]) != nil)
631 | {
632 | parameter = [attr objectForKey:key];
633 | classstring = [parameter objectForKey: kCIAttributeClass];
634 | if ([classstring isEqualToString:@"CIImage"])
635 | {
636 | if (hasBackground)
637 | {
638 | if (![key isEqualToString:@"inputBackgroundImage"] && [f valueForKey:key] == nil)
639 | {
640 | missingImage = YES;
641 | break;
642 | }
643 | }
644 | else
645 | {
646 | if (![key isEqualToString:@"inputImage"] && [f valueForKey:key] == nil)
647 | {
648 | missingImage = YES;
649 | break;
650 | }
651 | }
652 | }
653 | }
654 | return missingImage;
655 | }
656 |
657 | // determine if the entire effect stack has a missing image - if yes, then the effect stack can't be evaluated
658 | - (BOOL)hasMissingImage
659 | {
660 | NSInteger i, count;
661 | CIFilter *f;
662 |
663 | count = [self layerCount];
664 | for (i = 0; i < count; i++)
665 | {
666 | f = [self filterAtIndex:i];
667 | if (f != nil && [self filterHasMissingImage:f])
668 | return YES;
669 | }
670 | return NO;
671 | }
672 |
673 | // encode arbitrary parameter objects for filters into XML-compatible NSNumber's
674 | - (void)encodeValue:(id)obj forKey:(NSString *)key intoDictionary:(NSMutableDictionary *)v
675 | {
676 | NSAffineTransformStruct S;
677 |
678 | // decide what it is and store values in the values dictionary
679 | if ([obj isKindOfClass:[NSNumber class]])
680 | [v setValue:obj forKey:key];
681 | else if ([obj isKindOfClass:[CIVector class]])
682 | {
683 | [v setValue:[obj stringRepresentation] forKey:[key stringByAppendingString:@"_CIVectorValue"]];
684 | }
685 | else if ([obj isKindOfClass:[CIColor class]])
686 | {
687 | [v setValue:[obj stringRepresentation] forKey:[key stringByAppendingString:@"_CIColorValue"]];
688 | }
689 | else if ([obj isKindOfClass:[NSAffineTransform class]])
690 | {
691 | S = [obj transformStruct];
692 | [v setValue:[NSNumber numberWithDouble:S.m11] forKey:[key stringByAppendingString:@"_m11"]];
693 | [v setValue:[NSNumber numberWithDouble:S.m12] forKey:[key stringByAppendingString:@"_m12"]];
694 | [v setValue:[NSNumber numberWithDouble:S.m21] forKey:[key stringByAppendingString:@"_m21"]];
695 | [v setValue:[NSNumber numberWithDouble:S.m22] forKey:[key stringByAppendingString:@"_m22"]];
696 | [v setValue:[NSNumber numberWithDouble:S.tX] forKey:[key stringByAppendingString:@"_tX"]];
697 | [v setValue:[NSNumber numberWithDouble:S.tY] forKey:[key stringByAppendingString:@"_tY"]];
698 | }
699 | }
700 |
701 | // decode XML-compatible NSNumber's into arbitrary parameter objects for filters
702 | - (id)decodedValueForKey:(NSString *)key ofClass:(NSString *)classname fromDictionary:(NSDictionary *)v
703 | {
704 | if ([classname isEqualToString:@"NSNumber"])
705 | return [v valueForKey:key];
706 | else if ([classname isEqualToString:@"CIVector"])
707 | {
708 | NSString *objValue = (NSString*)[v valueForKey:[key stringByAppendingString:@"_CIVectorValue"]];
709 |
710 | if (objValue == nil)
711 | return nil;
712 | return [CIVector vectorWithString:objValue];
713 | }
714 | else if ([classname isEqualToString:@"CIColor"])
715 | {
716 | NSString *objValue = (NSString*)[v valueForKey:[key stringByAppendingString:@"_CIColorValue"]];
717 |
718 | if (objValue == nil)
719 | return nil;
720 | return [CIColor colorWithString:objValue];
721 | }
722 | else if ([classname isEqualToString:@"NSAffineTransform"])
723 | {
724 | NSAffineTransformStruct S;
725 | NSAffineTransform *t;
726 |
727 | if ([v valueForKey:[key stringByAppendingString:@"_m11"]] == nil)
728 | return nil;
729 | S.m11 = [[v valueForKey:[key stringByAppendingString:@"_m11"]] doubleValue];
730 | S.m12 = [[v valueForKey:[key stringByAppendingString:@"_m12"]] doubleValue];
731 | S.m21 = [[v valueForKey:[key stringByAppendingString:@"_m21"]] doubleValue];
732 | S.m22 = [[v valueForKey:[key stringByAppendingString:@"_m22"]] doubleValue];
733 | S.tX = [[v valueForKey:[key stringByAppendingString:@"_tX"]] doubleValue];
734 | S.tY = [[v valueForKey:[key stringByAppendingString:@"_tY"]] doubleValue];
735 | t = [[[NSAffineTransform alloc] init] autorelease];
736 | [t setTransformStruct:S];
737 | return t;
738 | }
739 | else if ([classname isEqualToString:@"CIImage"])
740 | {
741 | if ([v valueForKey:key] == nil)
742 | return nil;
743 | }
744 | return nil;
745 | }
746 |
747 | @end
748 |
749 |
--------------------------------------------------------------------------------
/FunHouse/EffectStackController.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: EffectStackController.h
3 | Abstract: This class controls the automatically resizeable effect stack inspector. It must also be able to resize and reconfigure itself when switching documents.
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 |
50 |
51 | @class CoreImageView;
52 | @class EffectStack;
53 | @class FilterView;
54 | @class CIFilter;
55 |
56 | #define FOOP 0
57 |
58 | #if FOOP
59 | @interface EffectStackController : NSWindowController
60 |
61 | + (instancetype)sharedEffectStackController;
62 |
63 | - (void)setAutomaticDefaults:(CIFilter *)f atIndex:(NSInteger)index;
64 | - (IBAction)topPlusButtonAction:(id)sender;
65 | - (IBAction)plusButtonAction:(id)sender;
66 | - (IBAction)minusButtonAction:(id)sender;
67 | - (IBAction)resetButtonAction:(id)sender;
68 | - (void)playButtonAction:sender;
69 | - (void)layoutInspector;
70 | - (FilterView *)newUIForFilter:(CIFilter *)f index:(NSInteger)index;
71 | - (FilterView *)newUIForImage:(CIImage *)im filename:(NSString *)filename index:(NSInteger)index;
72 | - (FilterView *)newUIForText:(NSString *)string index:(NSInteger)index;
73 | - (void)_loadFilterListIntoInspector;
74 |
75 | - (IBAction)filterOKButtonAction:(id)sender;
76 | - (IBAction)filterCancelButtonAction:(id)sender;
77 | - (IBAction)filterImageButtonAction:(id)sender;
78 | - (IBAction)filterTextButtonAction:(id)sender;
79 | - (IBAction)tableViewDoubleClick:(id)sender;
80 | - (void)setNeedsUpdate:(BOOL)b;
81 | - (void)updateLayout;
82 | - (BOOL)effectStackFilterHasMissingImage:(CIFilter *)f;
83 | - (void)closeDown;
84 | - (void)setLayer:(NSInteger)index image:(CIImage *)im andFilename:(NSString *)filename;
85 | - (void)setChanges;
86 | - (void)setCoreImageView:(CoreImageView *)v;
87 | - (void)removeFilterImageOrTextAtIndex:(NSNumber *)index;
88 | - (void)reconfigureWindow; // called when dragging into or choosing base image to reconfigure the document's window
89 |
90 | // for retaining full file names of images
91 | - (void)registerImageLayer:(NSInteger)index imageFilePath:(NSString *)path;
92 | - (void)registerFilterLayer:(CIFilter *)filter key:(NSString *)key imageFilePath:(NSString *)path;
93 | - (NSString *)imageFilePathForImageLayer:(NSInteger)index;
94 | - (NSString *)imageFilePathForFilterLayer:(CIFilter *)filter key:(NSString *)key;
95 |
96 | @end
97 |
98 | #endif
99 |
--------------------------------------------------------------------------------
/FunHouse/FilterView.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: FilterView.h
3 | Abstract: The filter view is really the box that contains all the UI widgets to edit a layer. Each of the widgets (slider with label and readout, color well with label, check box, image view with choose button, etc) gets encoded in its own parameter view.
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 | #import
50 |
51 | #import "EffectStackController.h"
52 |
53 |
54 | @class CoreImageView;
55 | @class EffectStackController;
56 |
57 | // type of widget last added
58 | typedef NS_ENUM(NSInteger, ControlType) {
59 | ctNone = 0,
60 | ctSlider,
61 | ctColorWell,
62 | ctCheckBox,
63 | ctImageWell,
64 | ctTransform,
65 | ctVector,
66 | ctTextView,
67 | ctOffset,
68 | };
69 |
70 | @interface EffectStackBox : NSBox // subclassed
71 | {
72 | CIFilter *filter;
73 | EffectStackController *master;
74 | }
75 |
76 | - (void)drawRect:(NSRect)r;
77 | - (void)setFilter:(CIFilter *)f;
78 | - (void)setMaster:(EffectStackController *)m;
79 | @end
80 |
81 | @interface FilterView : EffectStackBox
82 | {
83 | NSInteger tag; // tag: it's the layer index!
84 | NSInteger controlLeftPosition; // state used for packing widgets
85 | NSInteger controlTopPosition; // state used for packing widgets
86 | NSInteger colorWellOffset; // state used for packing widgets
87 | ControlType lastControlType; // last control type added (for packing widgets properly)
88 | NSTextField *filterNameField; // text field for showing filter name (image name, text)
89 | NSButton *plusbutton; // plus button: allows user to create a new layer after this one
90 | NSButton *minusbutton; // minus button: allows user to delete this layer
91 | NSButton *checkBox; // check box: for enabling/disabling the layer
92 | }
93 |
94 | // for computing size of box beforehand
95 | - (void)tryFilterHeader:(CIFilter *)filter;
96 | - (void)trySliderForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
97 | - (void)tryCheckBoxForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
98 | - (void)tryColorWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
99 | - (void)tryImageWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
100 | - (void)tryTransformForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
101 | - (void)tryVectorForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
102 | - (void)tryOffsetForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
103 |
104 | // for populating the box with controls
105 | - (void)addFilterHeader:(CIFilter *)filter tag:(NSInteger)index enabled:(BOOL)enabled;
106 | - (void)addSliderForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
107 | - (void)addCheckBoxForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
108 | - (void)addColorWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
109 | - (void)addImageWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
110 | - (void)addTransformForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
111 | - (void)addVectorForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
112 | - (void)addOffsetForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v;
113 |
114 | // image layers
115 | - (void)tryImageHeader:(CIImage *)im;
116 | - (void)addImageHeader:(CIImage *)im filename:(NSString *)filename tag:(NSInteger)index enabled:(BOOL)enabled;
117 | - (void)tryImageWellForImage:(CIImage *)im tag:(NSInteger)tag displayView:(CoreImageView *)v;
118 | - (void)addImageWellForImage:(CIImage *)im tag:(NSInteger)tag displayView:(CoreImageView *)v;
119 |
120 | // text layers
121 | - (void)tryTextHeader:(NSString *)string;
122 | - (void)addTextHeader:(NSString *)string tag:(NSInteger)index enabled:(BOOL)enabled;
123 | - (void)tryTextViewForString;
124 | - (void)addTextViewForString:(NSMutableDictionary *)d key:(NSString *)key displayView:(CoreImageView *)v;
125 | - (void)trySliderForText;
126 | - (void)addSliderForText:(NSMutableDictionary *)d key:(NSString *)key lo:(CGFloat)lo hi:(CGFloat)hi displayView:(CoreImageView *)v;
127 |
128 | // trim box after adding UI
129 | - (void)trimBox;
130 | - (void)setTag:(NSInteger)index;
131 |
132 | @end
133 |
134 |
135 |
--------------------------------------------------------------------------------
/FunHouse/FilterView.m:
--------------------------------------------------------------------------------
1 | /*
2 | File: FilterView.m
3 | Abstract: The filter view is really the box that contains all the UI widgets to edit a layer. Each of the widgets (slider with label and readout, color well with label, check box, image view with choose button, etc) gets encoded in its own parameter view.
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 | #import "ParameterView.h"
50 | #import "FilterView.h"
51 | #import "CoreImageView.h"
52 |
53 | //#import "EffectStackController.h"
54 | #import "Core_Image_Fun_House-Swift.h"
55 |
56 | #define kSliderVerticalAdvance (18)
57 | #define kVerticalGap (0)
58 |
59 | @implementation EffectStackBox
60 |
61 | // this is a subclass of NSBox required so we can draw the interior of the box as red when there's something
62 | // in the box (namely an image well) that still needs filling
63 |
64 | #define boxInset 3.0
65 | #define boxFillet 7.0
66 | // control point distance from rectangle corner
67 | #define cpdelta (boxFillet * 0.35)
68 |
69 | - (void)setFilter:(CIFilter *)f
70 | {
71 | filter = f;
72 | }
73 |
74 | - (void)setMaster:(EffectStackController *)m
75 | {
76 | master = m;
77 | }
78 |
79 | - (void)drawRect:(NSRect)r
80 | {
81 | NSBezierPath *path;
82 | NSPoint bl, br, tr, tl;
83 | NSRect R;
84 |
85 | [super drawRect:r];
86 | if ([master effectStackFilterHasMissingImage:filter])
87 | {
88 | // overlay the box now - colorized
89 | [[NSColor colorWithDeviceRed:1.0 green:0.0 blue:0.0 alpha:0.15] set];
90 | path = [NSBezierPath bezierPath];
91 | R = NSOffsetRect(NSInsetRect([self bounds], boxInset, boxInset), 0, 1);
92 | bl = R.origin;
93 | br = NSMakePoint(R.origin.x + R.size.width, R.origin.y);
94 | tr = NSMakePoint(R.origin.x + R.size.width, R.origin.y + R.size.height);
95 | tl = NSMakePoint(R.origin.x, R.origin.y + R.size.height);
96 | [path moveToPoint:NSMakePoint(bl.x + boxFillet, bl.y)];
97 | [path lineToPoint:NSMakePoint(br.x - boxFillet, br.y)];
98 | [path curveToPoint:NSMakePoint(br.x, br.y + boxFillet)
99 | controlPoint1:NSMakePoint(br.x - cpdelta, br.y)
100 | controlPoint2:NSMakePoint(br.x, br.y + cpdelta)];
101 | [path lineToPoint:NSMakePoint(tr.x, tr.y - boxFillet)];
102 | [path curveToPoint:NSMakePoint(tr.x - boxFillet, tr.y)
103 | controlPoint1:NSMakePoint(tr.x, tr.y - cpdelta)
104 | controlPoint2:NSMakePoint(tr.x - cpdelta, tr.y)];
105 | [path lineToPoint:NSMakePoint(tl.x + boxFillet, tl.y)];
106 | [path curveToPoint:NSMakePoint(tl.x, tl.y - boxFillet)
107 | controlPoint1:NSMakePoint(tl.x + cpdelta, tl.y)
108 | controlPoint2:NSMakePoint(tl.x, tl.y - cpdelta)];
109 | [path lineToPoint:NSMakePoint(bl.x, bl.y + boxFillet)];
110 | [path curveToPoint:NSMakePoint(bl.x + boxFillet, bl.y)
111 | controlPoint1:NSMakePoint(bl.x, bl.y + cpdelta)
112 | controlPoint2:NSMakePoint(bl.x + cpdelta, bl.y)];
113 | [path closePath];
114 | [path fill];
115 | }
116 | }
117 |
118 | @end
119 |
120 |
121 | @implementation FilterView
122 |
123 | - (void)setTag:(NSInteger)index
124 | {
125 | tag = index;
126 | }
127 |
128 | - (id)initWithFrame:(NSRect)frame
129 | {
130 | self = [super initWithFrame:frame];
131 | if (self != nil)
132 | {
133 | controlLeftPosition = 5;
134 | controlTopPosition = frame.size.height;
135 | lastControlType = ctNone;
136 | }
137 | return self;
138 | }
139 |
140 | // trim the box down to include only the allocated widgets
141 | - (void)trimBox
142 | {
143 | NSRect R;
144 |
145 | R = [self frame];
146 | controlTopPosition -= 3;
147 | R.size.height -= controlTopPosition;
148 | R.origin.y += controlTopPosition;
149 | [self setFrame:R];
150 | lastControlType = ctNone;
151 | }
152 |
153 | // allocate the space required for a filter layer header
154 | - (void)tryFilterHeader:(CIFilter *)filter
155 | {
156 | NSRect R;
157 |
158 | R = [self bounds];
159 | R.origin.y += R.size.height - 38;
160 | R.size.height = 22;
161 | R.origin.x += 63;
162 | R.size.width -= 62 + 63;
163 | controlTopPosition = R.origin.y - 8;
164 | }
165 |
166 | // add a filter layer header
167 | - (void)addFilterHeader:(CIFilter *)f tag:(NSInteger)index enabled:(BOOL)enabled
168 | {
169 | NSRect R, S, cbR;
170 | NSString *name;
171 | NSCell *c;
172 |
173 | R = [self bounds];
174 | R.origin.y += R.size.height - 38;
175 | R.size.height = 22;
176 | R.origin.x += 33;
177 | R.size.width -= 62 + 63;
178 | // add enable/disable check box
179 | cbR = R;
180 | cbR.origin.x = 0;
181 | cbR.size.width = 58;
182 | cbR.size.height = 22;
183 | // label
184 | filterNameField = [[NSTextField alloc] initWithFrame:R];
185 | name = [[f attributes] objectForKey:kCIAttributeFilterDisplayName];
186 | // set text label to 9 point
187 | c = [filterNameField cell];
188 | // determine if we need to ellipsize
189 | name = [ParameterView ellipsizeField:[c drawingRectForBounds:[filterNameField bounds]].size.width font:[c font] string:name];
190 | [filterNameField setStringValue:name];
191 | [filterNameField setEditable:NO];
192 | [filterNameField setBezeled:NO];
193 | [filterNameField setDrawsBackground:NO];
194 | [filterNameField setAutoresizingMask:NSViewMaxXMargin|NSViewMinYMargin];
195 | [self addSubview:filterNameField];
196 | checkBox = [[NSButton alloc] initWithFrame:cbR];
197 | [checkBox setTarget:master];
198 | [checkBox setAction:@selector(enableCheckBoxAction:)];
199 | [checkBox setButtonType:NSSwitchButton];
200 | [checkBox setState:(enabled ? NSOnState : NSOffState)];
201 | [checkBox setTitle:@""];
202 | [checkBox setTag:index];
203 | [self addSubview:checkBox];
204 | // add + button
205 | S = R;
206 | S.origin.x = R.origin.x + R.size.width + 33;
207 | S.origin.y += 3;
208 | S.size.height -= 4;
209 | S.size.width = 22;
210 | plusbutton = [[NSButton alloc] initWithFrame:S];
211 | [[plusbutton cell] setButtonType:NSMomentaryLightButton];
212 | [[plusbutton cell] setBezelStyle:NSShadowlessSquareBezelStyle];
213 | [[plusbutton cell] setGradientType:NSGradientConcaveWeak];
214 | [plusbutton setImagePosition:NSImageOnly];
215 | [plusbutton setImage:[NSImage imageNamed:@"plusbutton"]];
216 | [plusbutton setBordered:NO];
217 | [plusbutton setTarget:master];
218 | [plusbutton setAction:@selector(plusButtonAction:)];
219 | [plusbutton setTag:index];
220 | [self addSubview:plusbutton];
221 | // add - button
222 | S.origin.x += 21;
223 | minusbutton = [[NSButton alloc] initWithFrame:S];
224 | [[minusbutton cell] setButtonType:NSMomentaryLightButton];
225 | [[minusbutton cell] setBezelStyle:NSShadowlessSquareBezelStyle];
226 | [[minusbutton cell] setGradientType:NSGradientConcaveWeak];
227 | [minusbutton setImagePosition:NSImageOnly];
228 | [minusbutton setImage:[NSImage imageNamed:@"minusbutton"]];
229 | [minusbutton setBordered:NO];
230 | [minusbutton setTarget:master];
231 | [minusbutton setAction:@selector(minusButtonAction:)];
232 | [minusbutton setTag:index];
233 | [self addSubview:minusbutton];
234 | controlTopPosition = R.origin.y - 8;
235 | }
236 |
237 | // allocate the space required for an image layer header
238 | - (void)tryImageHeader:(CIImage *)im
239 | {
240 | NSRect R;
241 |
242 | R = [self bounds];
243 | R.origin.y += R.size.height - 38;
244 | R.size.height = 22;
245 | R.origin.x += 63;
246 | R.size.width -= 62 + 63;
247 | controlTopPosition = R.origin.y - 8;
248 | }
249 |
250 | // add an image layer header
251 | - (void)addImageHeader:(CIImage *)im filename:(NSString *)filename tag:(NSInteger)index enabled:(BOOL)enabled
252 | {
253 | NSRect R, S, cbR;
254 | NSString *name;
255 | NSCell *c;
256 |
257 | R = [self bounds];
258 | R.origin.y += R.size.height - 38;
259 | R.size.height = 22;
260 | R.origin.x += 33;
261 | R.size.width -= 62 + 63;
262 | // add enable/disable check box
263 | cbR = R;
264 | cbR.origin.x = 0;
265 | cbR.size.width = 58;
266 | cbR.size.height = 22;
267 | // label
268 | filterNameField = [[NSTextField alloc] initWithFrame:R];
269 | name = [filename copy];
270 | // set text label to 9 point
271 | c = [filterNameField cell];
272 | // determine if we need to ellipsize
273 | name = [ParameterView ellipsizeField:[c drawingRectForBounds:[filterNameField bounds]].size.width font:[c font] string:[name autorelease]];
274 | [filterNameField setStringValue:name];
275 | [filterNameField setEditable:NO];
276 | [filterNameField setBezeled:NO];
277 | [filterNameField setDrawsBackground:NO];
278 | [filterNameField setAutoresizingMask:NSViewMaxXMargin|NSViewMinYMargin];
279 | [self addSubview:filterNameField];
280 | checkBox = [[NSButton alloc] initWithFrame:cbR];
281 | [checkBox setTarget:master];
282 | [checkBox setAction:@selector(enableCheckBoxAction:)];
283 | [checkBox setButtonType:NSSwitchButton];
284 | [checkBox setState:(enabled ? NSOnState : NSOffState)];
285 | [checkBox setTitle:@""];
286 | [checkBox setTag:index];
287 | [self addSubview:checkBox];
288 | // add + button
289 | S = R;
290 | S.origin.x = R.origin.x + R.size.width + 33;
291 | S.origin.y += 3;
292 | S.size.height -= 4;
293 | S.size.width = 22;
294 | plusbutton = [[NSButton alloc] initWithFrame:S];
295 | [[plusbutton cell] setButtonType:NSMomentaryLightButton];
296 | [[plusbutton cell] setBezelStyle:NSShadowlessSquareBezelStyle];
297 | [[plusbutton cell] setGradientType:NSGradientConcaveWeak];
298 | [plusbutton setImagePosition:NSImageOnly];
299 | [plusbutton setImage:[NSImage imageNamed:@"plusbutton"]];
300 | [plusbutton setBordered:NO];
301 | [plusbutton setTarget:master];
302 | [plusbutton setAction:@selector(plusButtonAction:)];
303 | [plusbutton setTag:index];
304 | [self addSubview:plusbutton];
305 | // add - button
306 | S.origin.x += 21;
307 | minusbutton = [[NSButton alloc] initWithFrame:S];
308 | [[minusbutton cell] setButtonType:NSMomentaryLightButton];
309 | [[minusbutton cell] setBezelStyle:NSShadowlessSquareBezelStyle];
310 | [[minusbutton cell] setGradientType:NSGradientConcaveWeak];
311 | [minusbutton setImagePosition:NSImageOnly];
312 | [minusbutton setImage:[NSImage imageNamed:@"minusbutton"]];
313 | [minusbutton setBordered:NO];
314 | [minusbutton setTarget:master];
315 | [minusbutton setAction:@selector(minusButtonAction:)];
316 | [minusbutton setTag:index];
317 | [self addSubview:minusbutton];
318 | controlTopPosition = R.origin.y - 8;
319 | }
320 |
321 | // allocate the space required for a filter layer slider
322 | - (void)trySliderForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
323 | {
324 | controlTopPosition -= kSliderVerticalAdvance + kVerticalGap;
325 | lastControlType = ctSlider;
326 | }
327 |
328 | // add a filter layer slider
329 | - (void)addSliderForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
330 | {
331 | NSRect pRect, frame;
332 | ParameterView *pView;
333 |
334 | frame = [self bounds];
335 | pRect = NSMakeRect(0, controlTopPosition - kSliderVerticalAdvance, frame.size.width - 12, kSliderVerticalAdvance);
336 | pView = [[ParameterView alloc] initWithFrame:pRect];
337 | [pView addSliderForFilter:f key:k displayView:v master:master];
338 | [self addSubview:pView]; //"self" now retains pView
339 | [pView release];
340 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
341 | controlTopPosition -= kSliderVerticalAdvance + kVerticalGap;
342 | lastControlType = ctSlider;
343 | }
344 |
345 | // allocate the space required for a filter layer check box
346 | - (void)tryCheckBoxForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
347 | {
348 | controlTopPosition -= 17;
349 | lastControlType = ctCheckBox;
350 | }
351 |
352 | // add a filter layer check box
353 | - (void)addCheckBoxForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
354 | {
355 | NSRect pRect, frame;
356 | ParameterView *pView;
357 |
358 | frame = [self frame];
359 | pRect = NSMakeRect(controlLeftPosition, controlTopPosition - 16, frame.size.width - 10, 16);
360 | pView = [[ParameterView alloc] initWithFrame:pRect];
361 | [pView addCheckBoxForFilter:f key:k displayView:v master:master];
362 | [self addSubview:pView]; //"self" now retains pView
363 | [pView release];
364 | [pView setAutoresizingMask:NSViewMaxXMargin|NSViewMinYMargin];
365 | controlTopPosition -= 17;
366 | lastControlType = ctCheckBox;
367 | }
368 |
369 | // allocate the space required for a filter layer color well
370 | // note: we can pack two color wells next to each other, if they follow one another!
371 | - (void)tryColorWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
372 | {
373 | NSRect frame;
374 |
375 | frame = [self frame];
376 | if (lastControlType != ctColorWell)
377 | colorWellOffset = controlLeftPosition;
378 | else
379 | {
380 | controlTopPosition += 28;
381 | colorWellOffset += floor((frame.size.width - 20)/2);
382 | if (colorWellOffset > controlLeftPosition + floor((frame.size.width - 20)/2))
383 | {
384 | colorWellOffset = controlLeftPosition;
385 | controlTopPosition -= 28;
386 | }
387 | }
388 | controlTopPosition -= 28;
389 | lastControlType = ctColorWell;
390 | }
391 |
392 | // add a filter layer color well
393 | // note: we can pack two color wells next to each other, if they follow one another!
394 | - (void)addColorWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
395 | {
396 | NSRect pRect, frame;
397 | ParameterView *pView;
398 |
399 | frame = [self frame];
400 | if (lastControlType != ctColorWell)
401 | colorWellOffset = controlLeftPosition;
402 | else
403 | {
404 | controlTopPosition += 28;
405 | colorWellOffset += floor((frame.size.width - 20)/2);
406 | if (colorWellOffset > controlLeftPosition + floor((frame.size.width - 20)/2))
407 | {
408 | colorWellOffset = controlLeftPosition;
409 | controlTopPosition -= 28;
410 | }
411 | }
412 | pRect = NSMakeRect(colorWellOffset, controlTopPosition - 24, floor((frame.size.width - 20)/2), 24);
413 | pView = [[ParameterView alloc] initWithFrame:pRect];
414 | [pView addColorWellForFilter:f key:k displayView:v master:master];
415 | [self addSubview:pView]; //"self" now retains pView
416 | [pView release];
417 | if (colorWellOffset == controlLeftPosition)
418 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMaxXMargin|NSViewMinYMargin];
419 | else
420 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMinXMargin|NSViewMinYMargin];
421 | controlTopPosition -= 28;
422 | lastControlType = ctColorWell;
423 | }
424 |
425 | // allocate the space required for a filter layer image view
426 | - (void)tryImageWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
427 | {
428 | controlTopPosition -= 48;
429 | lastControlType = ctImageWell;
430 | }
431 |
432 | // add a filter layer image view
433 | - (void)addImageWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
434 | {
435 | NSRect pRect, frame;
436 | ParameterView *pView;
437 |
438 | frame = [self frame];
439 | pRect = NSMakeRect(controlLeftPosition, controlTopPosition - 44, frame.size.width - 10, 44);
440 | pView = [[ParameterView alloc] initWithFrame:pRect];
441 | [pView addImageWellForFilter:f key:k displayView:v master:master];
442 | [self addSubview:pView]; //"self" now retains pView
443 | [pView release];
444 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMaxXMargin|NSViewMinYMargin];
445 | controlTopPosition -= 48;
446 | lastControlType = ctImageWell;
447 | }
448 |
449 | // allocate the space required for a filter layer transform (4 sliders)
450 | - (void)tryTransformForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
451 | {
452 | controlTopPosition -= 68;
453 | lastControlType = ctTransform;
454 | }
455 |
456 | // add a filter layer transform (4 sliders)
457 | - (void)addTransformForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
458 | {
459 | NSRect pRect, frame;
460 | ParameterView *pView;
461 |
462 | frame = [self frame];
463 | pRect = NSMakeRect(controlLeftPosition, controlTopPosition - 67, frame.size.width - 10, 67);
464 | pView = [[ParameterView alloc] initWithFrame:pRect];
465 | [pView addTransformForFilter:f key:k displayView:v master:master];
466 | [self addSubview:pView]; //"self" now retains pView
467 | [pView release];
468 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
469 | controlTopPosition -= 68;
470 | lastControlType = ctTransform;
471 | }
472 |
473 | // allocate the space required for a filter layer naked CIVector (4 editable text fields)
474 | - (void)tryVectorForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
475 | {
476 | controlTopPosition -= 17;
477 | lastControlType = ctVector;
478 | }
479 |
480 | // add a filter layer naked CIVector (4 editable text fields)
481 | - (void)addVectorForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
482 | {
483 | NSRect pRect, frame;
484 | ParameterView *pView;
485 |
486 | frame = [self frame];
487 | pRect = NSMakeRect(controlLeftPosition, controlTopPosition - 16, frame.size.width - 10, 16);
488 | pView = [[ParameterView alloc] initWithFrame:pRect];
489 | [pView addVectorForFilter:f key:k displayView:v master:master];
490 | [self addSubview:pView]; //"self" now retains pView
491 | [pView release];
492 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
493 | controlTopPosition -= 17;
494 | lastControlType = ctVector;
495 | }
496 |
497 | // allocate the space required for a filter layer offset CIVector (2 editable text fields)
498 | - (void)tryOffsetForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
499 | {
500 | controlTopPosition -= 17;
501 | lastControlType = ctOffset;
502 | }
503 |
504 | // add a filter layer offset CIVector (2 editable text fields)
505 | - (void)addOffsetForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v
506 | {
507 | NSRect pRect, frame;
508 | ParameterView *pView;
509 |
510 | frame = [self frame];
511 | pRect = NSMakeRect(controlLeftPosition, controlTopPosition - 16, frame.size.width - 10, 16);
512 | pView = [[ParameterView alloc] initWithFrame:pRect];
513 | [pView addOffsetForFilter:f key:k displayView:v master:master];
514 | [self addSubview:pView]; //"self" now retains pView
515 | [pView release];
516 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
517 | controlTopPosition -= 17;
518 | lastControlType = ctOffset;
519 | }
520 |
521 | // allocate the space required for an image layer image view
522 | - (void)tryImageWellForImage:(CIImage *)im tag:(NSInteger)tag displayView:(CoreImageView *)v
523 | {
524 | controlTopPosition -= 48;
525 | lastControlType = ctImageWell;
526 | }
527 |
528 | // add an image layer image view
529 | - (void)addImageWellForImage:(CIImage *)im tag:(NSInteger)index displayView:(CoreImageView *)v
530 | {
531 | NSRect pRect, frame;
532 | ParameterView *pView;
533 |
534 | frame = [self frame];
535 | pRect = NSMakeRect(controlLeftPosition, controlTopPosition - 44, frame.size.width - 10, 44);
536 | pView = [[ParameterView alloc] initWithFrame:pRect];
537 | [pView addImageWellForImage:im tag:index displayView:v master:master];
538 | [self addSubview:pView]; //"self" now retains pView
539 | [pView release];
540 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMaxXMargin|NSViewMinYMargin];
541 | controlTopPosition -= 48;
542 | lastControlType = ctImageWell;
543 | }
544 |
545 | // allocate the space required for a text layer header
546 | - (void)tryTextHeader:(NSString *)string
547 | {
548 | NSRect R;
549 |
550 | R = [self bounds];
551 | R.origin.y += R.size.height - 38;
552 | R.size.height = 22;
553 | R.origin.x += 63;
554 | R.size.width -= 62 + 63;
555 | controlTopPosition = R.origin.y - 8;
556 | }
557 |
558 | // add a text layer header
559 | - (void)addTextHeader:(NSString *)string tag:(NSInteger)index enabled:(BOOL)enabled
560 | {
561 | NSRect R, S, cbR;
562 | NSString *name;
563 | NSCell *c;
564 |
565 | R = [self bounds];
566 | R.origin.y += R.size.height - 38;
567 | R.size.height = 22;
568 | R.origin.x += 33;
569 | R.size.width -= 62 + 63;
570 | // add enable/disable check box
571 | cbR = R;
572 | cbR.origin.x = 0;
573 | cbR.size.width = 58;
574 | cbR.size.height = 22;
575 | // label
576 | filterNameField = [[NSTextField alloc] initWithFrame:R];
577 | name = @"Text";
578 | // set text label to 9 point
579 | c = [filterNameField cell];
580 | // determine if we need to ellipsize
581 | name = [ParameterView ellipsizeField:[c drawingRectForBounds:[filterNameField bounds]].size.width font:[c font] string:name];
582 | [filterNameField setStringValue:name];
583 | [filterNameField setEditable:NO];
584 | [filterNameField setBezeled:NO];
585 | [filterNameField setDrawsBackground:NO];
586 | [filterNameField setAutoresizingMask:NSViewMaxXMargin|NSViewMinYMargin];
587 | [self addSubview:filterNameField];
588 | checkBox = [[NSButton alloc] initWithFrame:cbR];
589 | [checkBox setTarget:master];
590 | [checkBox setAction:@selector(enableCheckBoxAction:)];
591 | [checkBox setButtonType:NSSwitchButton];
592 | [checkBox setState:(enabled ? NSOnState : NSOffState)];
593 | [checkBox setTitle:@""];
594 | [checkBox setTag:index];
595 | [self addSubview:checkBox];
596 | // add + button
597 | S = R;
598 | S.origin.x = R.origin.x + R.size.width + 33;
599 | S.origin.y += 3;
600 | S.size.height -= 4;
601 | S.size.width = 22;
602 | plusbutton = [[NSButton alloc] initWithFrame:S];
603 | [[plusbutton cell] setButtonType:NSMomentaryLightButton];
604 | [[plusbutton cell] setBezelStyle:NSShadowlessSquareBezelStyle];
605 | [[plusbutton cell] setGradientType:NSGradientConcaveWeak];
606 | [plusbutton setImagePosition:NSImageOnly];
607 | [plusbutton setImage:[NSImage imageNamed:@"plusbutton"]];
608 | [plusbutton setBordered:NO];
609 | [plusbutton setTarget:master];
610 | [plusbutton setAction:@selector(plusButtonAction:)];
611 | [plusbutton setTag:index];
612 | [self addSubview:plusbutton];
613 | // add - button
614 | S.origin.x += 21;
615 | minusbutton = [[NSButton alloc] initWithFrame:S];
616 | [[minusbutton cell] setButtonType:NSMomentaryLightButton];
617 | [[minusbutton cell] setBezelStyle:NSShadowlessSquareBezelStyle];
618 | [[minusbutton cell] setGradientType:NSGradientConcaveWeak];
619 | [minusbutton setImagePosition:NSImageOnly];
620 | [minusbutton setImage:[NSImage imageNamed:@"minusbutton"]];
621 | [minusbutton setBordered:NO];
622 | [minusbutton setTarget:master];
623 | [minusbutton setAction:@selector(minusButtonAction:)];
624 | [minusbutton setTag:index];
625 | [self addSubview:minusbutton];
626 | controlTopPosition = R.origin.y - 8;
627 | }
628 |
629 | // allocate the space required for a text layer text view
630 | - (void)tryTextViewForString
631 | {
632 | controlTopPosition -= 88;
633 | lastControlType = ctTextView;
634 | }
635 |
636 | // add a text layer text view
637 | - (void)addTextViewForString:(NSMutableDictionary *)d key:(NSString *)key displayView:(CoreImageView *)v
638 | {
639 | NSRect pRect, frame;
640 | ParameterView *pView;
641 |
642 | frame = [self bounds];
643 | pRect = NSMakeRect(0, controlTopPosition - 88, frame.size.width, 88);
644 | pView = [[ParameterView alloc] initWithFrame:pRect];
645 | [pView addTextViewForString:d key:key displayView:v master:master];
646 | [self addSubview:pView]; //"self" now retains pView
647 | [pView release];
648 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
649 | controlTopPosition -= 88;
650 | lastControlType = ctTextView;
651 | }
652 |
653 | // allocate the space required for a text layer scale slider
654 | - (void)trySliderForText
655 | {
656 | controlTopPosition -= kSliderVerticalAdvance + kVerticalGap;
657 | lastControlType = ctSlider;
658 | }
659 |
660 | // add a text layer scale slider
661 | - (void)addSliderForText:(NSMutableDictionary *)d key:(NSString *)key lo:(CGFloat)lo hi:(CGFloat)hi displayView:(CoreImageView *)v
662 | {
663 | NSRect pRect, frame;
664 | ParameterView *pView;
665 |
666 | frame = [self bounds];
667 | pRect = NSMakeRect(0, controlTopPosition - kSliderVerticalAdvance, frame.size.width - 12, kSliderVerticalAdvance);
668 | pView = [[ParameterView alloc] initWithFrame:pRect];
669 | [pView addSliderForText:d key:key lo:lo hi:hi displayView:v master:master];
670 | [self addSubview:pView]; //"self" now retains pView
671 | [pView release];
672 | [pView setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin];
673 | controlTopPosition -= kSliderVerticalAdvance + kVerticalGap;
674 | lastControlType = ctSlider;
675 | }
676 |
677 | @end
678 |
--------------------------------------------------------------------------------
/FunHouse/Fun House-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
5 | @import AppKit;
6 |
7 | #import "FunHouseWindowController.h"
8 | #import "FunHouseDocument.h"
9 | #import "FunHouseApplication.h"
10 | #import "FilterView.h"
11 | #import "EffectStack.h"
12 | #import "CoreImageView.h"
13 | #import "ParameterView.h"
14 |
15 |
--------------------------------------------------------------------------------
/FunHouse/FunHouse.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 3C68AA4907C2979500ACC072 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C68AA4807C2979500ACC072 /* OpenGL.framework */; };
11 | 3CEC0084077243E5003DDDC6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CEC0083077243E5003DDDC6 /* QuartzCore.framework */; };
12 | 6803ADA90770AFC800AAFF76 /* document.icns in Resources */ = {isa = PBXBuildFile; fileRef = 6803ADA80770AFC800AAFF76 /* document.icns */; };
13 | 6807919C0767823B00873D85 /* EffectStack.m in Sources */ = {isa = PBXBuildFile; fileRef = 6807919B0767823B00873D85 /* EffectStack.m */; };
14 | 680798940767BBEC00873D85 /* FunHouseWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 680798930767BBEC00873D85 /* FunHouseWindowController.m */; };
15 | 680799030767C28E00873D85 /* FunHouseAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 680799020767C28E00873D85 /* FunHouseAppDelegate.m */; };
16 | 6812A5D4077B6B7900A10E6B /* FunHouseApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 6812A5D3077B6B7900A10E6B /* FunHouseApplication.m */; };
17 | 681F439207C27483004C53AB /* SampleCIView.m in Sources */ = {isa = PBXBuildFile; fileRef = 681F439107C27483004C53AB /* SampleCIView.m */; };
18 | 682F97E8077243900080871A /* NSApplicationIcon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 682F97E7077243900080871A /* NSApplicationIcon.icns */; };
19 | 68488CE007774D1A000C118A /* playbutton.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 68488CDF07774D1A000C118A /* playbutton.tiff */; };
20 | 688957030768C53C007F6B31 /* FilterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 688957020768C53C007F6B31 /* FilterView.m */; };
21 | 6889570A0768C550007F6B31 /* ParameterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 688957090768C550007F6B31 /* ParameterView.m */; };
22 | 68895825076905D2007F6B31 /* minusbutton.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 68895823076905D2007F6B31 /* minusbutton.tiff */; };
23 | 68895826076905D2007F6B31 /* plusbutton.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 68895824076905D2007F6B31 /* plusbutton.tiff */; };
24 | 68952755077767D600B3EAFE /* smoothtexture.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 68952754077767D600B3EAFE /* smoothtexture.tiff */; };
25 | 689527BF0777694D00B3EAFE /* lightball.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 689527BE0777694D00B3EAFE /* lightball.tiff */; };
26 | 68952C45077777EF00B3EAFE /* restrictedshine.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 68952C44077777EF00B3EAFE /* restrictedshine.tiff */; };
27 | 68952C6807777B7200B3EAFE /* colormap.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 68952C6707777B7200B3EAFE /* colormap.tiff */; };
28 | 68D08A3A0766773F005C971D /* CoreImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 68D08A390766773F005C971D /* CoreImageView.m */; };
29 | 68D2DD4E077B7FA30008F86A /* mask.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 68D2DD4D077B7FA30008F86A /* mask.tiff */; };
30 | 68FCAB160770E25F0004DA32 /* Images in Resources */ = {isa = PBXBuildFile; fileRef = 68FCAB140770E25F0004DA32 /* Images */; };
31 | 8D15AC310486D014006FF6A4 /* FunHouseDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* FunHouseDocument.m */; settings = {ATTRIBUTES = (); }; };
32 | 8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
33 | 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
34 | AF90B80A18FC96640066FC6D /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = AF90B7FC18FC96640066FC6D /* Credits.rtf */; };
35 | AF90B80B18FC96640066FC6D /* EffectStack.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF90B7FE18FC96640066FC6D /* EffectStack.xib */; };
36 | AF90B80C18FC96640066FC6D /* FilterPalette.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF90B80018FC96640066FC6D /* FilterPalette.xib */; };
37 | AF90B80D18FC96640066FC6D /* FunHouseWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF90B80218FC96640066FC6D /* FunHouseWindow.xib */; };
38 | AF90B80E18FC96640066FC6D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AF90B80418FC96640066FC6D /* InfoPlist.strings */; };
39 | AF90B80F18FC96640066FC6D /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF90B80618FC96640066FC6D /* MainMenu.xib */; };
40 | AF90B81018FC96640066FC6D /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = AF90B80818FC96640066FC6D /* Preferences.xib */; };
41 | DED8299A2378CEBF00BB203F /* EffectStackController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED8298A23787C3600BB203F /* EffectStackController.swift */; };
42 | DED8299B2378FC9600BB203F /* EffectStackController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6807985B0767B3BE00873D85 /* EffectStackController.m */; };
43 | /* End PBXBuildFile section */
44 |
45 | /* Begin PBXFileReference section */
46 | 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; };
47 | 2A37F4ACFDCFA73011CA2CEA /* FunHouseDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FunHouseDocument.m; sourceTree = ""; };
48 | 2A37F4AEFDCFA73011CA2CEA /* FunHouseDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunHouseDocument.h; sourceTree = ""; };
49 | 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
50 | 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; };
51 | 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; };
52 | 32DBCF750370BD2300C91783 /* FunHouse_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunHouse_Prefix.pch; sourceTree = ""; };
53 | 3C68AA4807C2979500ACC072 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; };
54 | 3CEC0083077243E5003DDDC6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = ""; };
55 | 468357DA2372FBD400F51D7E /* Notes */ = {isa = PBXFileReference; lastKnownFileType = text; path = Notes; sourceTree = ""; };
56 | 6803ADA80770AFC800AAFF76 /* document.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = document.icns; sourceTree = ""; };
57 | 6807919B0767823B00873D85 /* EffectStack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EffectStack.m; sourceTree = ""; };
58 | 680791A10767824800873D85 /* EffectStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EffectStack.h; sourceTree = ""; };
59 | 6807985B0767B3BE00873D85 /* EffectStackController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EffectStackController.m; sourceTree = ""; };
60 | 6807985F0767B3DA00873D85 /* EffectStackController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EffectStackController.h; sourceTree = ""; };
61 | 680798900767BBE500873D85 /* FunHouseWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunHouseWindowController.h; sourceTree = ""; };
62 | 680798930767BBEC00873D85 /* FunHouseWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FunHouseWindowController.m; sourceTree = ""; };
63 | 680799020767C28E00873D85 /* FunHouseAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FunHouseAppDelegate.m; sourceTree = ""; };
64 | 680799060767C29300873D85 /* FunHouseAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunHouseAppDelegate.h; sourceTree = ""; };
65 | 6812A5D3077B6B7900A10E6B /* FunHouseApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FunHouseApplication.m; sourceTree = ""; };
66 | 6812A5D9077B6BB000A10E6B /* FunHouseApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunHouseApplication.h; sourceTree = ""; };
67 | 681F439007C27483004C53AB /* SampleCIView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SampleCIView.h; sourceTree = ""; };
68 | 681F439107C27483004C53AB /* SampleCIView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SampleCIView.m; sourceTree = ""; };
69 | 682F97E7077243900080871A /* NSApplicationIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = NSApplicationIcon.icns; sourceTree = ""; };
70 | 68488CDF07774D1A000C118A /* playbutton.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = playbutton.tiff; sourceTree = ""; };
71 | 688957020768C53C007F6B31 /* FilterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FilterView.m; sourceTree = ""; };
72 | 688957060768C547007F6B31 /* FilterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilterView.h; sourceTree = ""; };
73 | 688957090768C550007F6B31 /* ParameterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ParameterView.m; sourceTree = ""; };
74 | 6889570D0768C555007F6B31 /* ParameterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParameterView.h; sourceTree = ""; };
75 | 68895823076905D2007F6B31 /* minusbutton.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = minusbutton.tiff; sourceTree = ""; };
76 | 68895824076905D2007F6B31 /* plusbutton.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = plusbutton.tiff; sourceTree = ""; };
77 | 68952754077767D600B3EAFE /* smoothtexture.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = smoothtexture.tiff; sourceTree = ""; };
78 | 689527BE0777694D00B3EAFE /* lightball.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = lightball.tiff; sourceTree = ""; };
79 | 68952C44077777EF00B3EAFE /* restrictedshine.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = restrictedshine.tiff; sourceTree = ""; };
80 | 68952C6707777B7200B3EAFE /* colormap.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = colormap.tiff; sourceTree = ""; };
81 | 68D08A390766773F005C971D /* CoreImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreImageView.m; sourceTree = ""; };
82 | 68D08A3D07667749005C971D /* CoreImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreImageView.h; sourceTree = ""; };
83 | 68D2DD4D077B7FA30008F86A /* mask.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = mask.tiff; sourceTree = ""; };
84 | 68FCAB140770E25F0004DA32 /* Images */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Images; sourceTree = ""; };
85 | 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; };
86 | 8D15AC370486D014006FF6A4 /* Core Image Fun House.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Core Image Fun House.app"; sourceTree = BUILT_PRODUCTS_DIR; };
87 | DED8298923787C3600BB203F /* Fun House-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Fun House-Bridging-Header.h"; sourceTree = ""; };
88 | DED8298A23787C3600BB203F /* EffectStackController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EffectStackController.swift; sourceTree = ""; };
89 | DED8298E2378801F00BB203F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; };
90 | DED829922378801F00BB203F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
91 | DED829952378802600BB203F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/EffectStack.xib; sourceTree = ""; };
92 | DED829962378802600BB203F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/FilterPalette.xib; sourceTree = ""; };
93 | DED829972378802600BB203F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/FunHouseWindow.xib; sourceTree = ""; };
94 | DED829982378802600BB203F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
95 | DED829992378802600BB203F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Preferences.xib; sourceTree = ""; };
96 | /* End PBXFileReference section */
97 |
98 | /* Begin PBXFrameworksBuildPhase section */
99 | 8D15AC330486D014006FF6A4 /* Frameworks */ = {
100 | isa = PBXFrameworksBuildPhase;
101 | buildActionMask = 2147483647;
102 | files = (
103 | 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */,
104 | 3CEC0084077243E5003DDDC6 /* QuartzCore.framework in Frameworks */,
105 | 3C68AA4907C2979500ACC072 /* OpenGL.framework in Frameworks */,
106 | );
107 | runOnlyForDeploymentPostprocessing = 0;
108 | };
109 | /* End PBXFrameworksBuildPhase section */
110 |
111 | /* Begin PBXGroup section */
112 | 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = {
113 | isa = PBXGroup;
114 | children = (
115 | 3C68AA4807C2979500ACC072 /* OpenGL.framework */,
116 | 3CEC0083077243E5003DDDC6 /* QuartzCore.framework */,
117 | 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */,
118 | );
119 | name = "Linked Frameworks";
120 | sourceTree = "";
121 | };
122 | 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */,
126 | 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */,
127 | );
128 | name = "Other Frameworks";
129 | sourceTree = "";
130 | };
131 | 19C28FB0FE9D524F11CA2CBB /* Products */ = {
132 | isa = PBXGroup;
133 | children = (
134 | 8D15AC370486D014006FF6A4 /* Core Image Fun House.app */,
135 | );
136 | name = Products;
137 | sourceTree = "";
138 | };
139 | 2A37F4AAFDCFA73011CA2CEA /* FunHouse */ = {
140 | isa = PBXGroup;
141 | children = (
142 | 468357DA2372FBD400F51D7E /* Notes */,
143 | 2A37F4ABFDCFA73011CA2CEA /* Classes */,
144 | 2A37F4AFFDCFA73011CA2CEA /* Other Sources */,
145 | 2A37F4B8FDCFA73011CA2CEA /* Resources */,
146 | 2A37F4C3FDCFA73011CA2CEA /* Frameworks */,
147 | 19C28FB0FE9D524F11CA2CBB /* Products */,
148 | );
149 | name = FunHouse;
150 | sourceTree = "";
151 | };
152 | 2A37F4ABFDCFA73011CA2CEA /* Classes */ = {
153 | isa = PBXGroup;
154 | children = (
155 | DED8298823787C2200BB203F /* Swift */,
156 | 681F439007C27483004C53AB /* SampleCIView.h */,
157 | 681F439107C27483004C53AB /* SampleCIView.m */,
158 | 6812A5D9077B6BB000A10E6B /* FunHouseApplication.h */,
159 | 6812A5D3077B6B7900A10E6B /* FunHouseApplication.m */,
160 | 6889570D0768C555007F6B31 /* ParameterView.h */,
161 | 688957090768C550007F6B31 /* ParameterView.m */,
162 | 688957060768C547007F6B31 /* FilterView.h */,
163 | 688957020768C53C007F6B31 /* FilterView.m */,
164 | 680799060767C29300873D85 /* FunHouseAppDelegate.h */,
165 | 680799020767C28E00873D85 /* FunHouseAppDelegate.m */,
166 | 680798900767BBE500873D85 /* FunHouseWindowController.h */,
167 | 680798930767BBEC00873D85 /* FunHouseWindowController.m */,
168 | 6807985F0767B3DA00873D85 /* EffectStackController.h */,
169 | 6807985B0767B3BE00873D85 /* EffectStackController.m */,
170 | 680791A10767824800873D85 /* EffectStack.h */,
171 | 6807919B0767823B00873D85 /* EffectStack.m */,
172 | 68D08A3D07667749005C971D /* CoreImageView.h */,
173 | 68D08A390766773F005C971D /* CoreImageView.m */,
174 | 2A37F4AEFDCFA73011CA2CEA /* FunHouseDocument.h */,
175 | 2A37F4ACFDCFA73011CA2CEA /* FunHouseDocument.m */,
176 | );
177 | name = Classes;
178 | sourceTree = "";
179 | };
180 | 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = {
181 | isa = PBXGroup;
182 | children = (
183 | 32DBCF750370BD2300C91783 /* FunHouse_Prefix.pch */,
184 | 2A37F4B0FDCFA73011CA2CEA /* main.m */,
185 | );
186 | name = "Other Sources";
187 | sourceTree = "";
188 | };
189 | 2A37F4B8FDCFA73011CA2CEA /* Resources */ = {
190 | isa = PBXGroup;
191 | children = (
192 | AF90B7FC18FC96640066FC6D /* Credits.rtf */,
193 | AF90B80418FC96640066FC6D /* InfoPlist.strings */,
194 | AF90B7FE18FC96640066FC6D /* EffectStack.xib */,
195 | AF90B80018FC96640066FC6D /* FilterPalette.xib */,
196 | AF90B80218FC96640066FC6D /* FunHouseWindow.xib */,
197 | AF90B80618FC96640066FC6D /* MainMenu.xib */,
198 | AF90B80818FC96640066FC6D /* Preferences.xib */,
199 | 68FCAB140770E25F0004DA32 /* Images */,
200 | 68895823076905D2007F6B31 /* minusbutton.tiff */,
201 | 68952754077767D600B3EAFE /* smoothtexture.tiff */,
202 | 689527BE0777694D00B3EAFE /* lightball.tiff */,
203 | 68952C44077777EF00B3EAFE /* restrictedshine.tiff */,
204 | 68952C6707777B7200B3EAFE /* colormap.tiff */,
205 | 68D2DD4D077B7FA30008F86A /* mask.tiff */,
206 | 6803ADA80770AFC800AAFF76 /* document.icns */,
207 | 682F97E7077243900080871A /* NSApplicationIcon.icns */,
208 | 68895824076905D2007F6B31 /* plusbutton.tiff */,
209 | 68488CDF07774D1A000C118A /* playbutton.tiff */,
210 | 8D15AC360486D014006FF6A4 /* Info.plist */,
211 | );
212 | name = Resources;
213 | sourceTree = "";
214 | };
215 | 2A37F4C3FDCFA73011CA2CEA /* Frameworks */ = {
216 | isa = PBXGroup;
217 | children = (
218 | 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */,
219 | 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */,
220 | );
221 | name = Frameworks;
222 | sourceTree = "";
223 | };
224 | DED8298823787C2200BB203F /* Swift */ = {
225 | isa = PBXGroup;
226 | children = (
227 | DED8298A23787C3600BB203F /* EffectStackController.swift */,
228 | DED8298923787C3600BB203F /* Fun House-Bridging-Header.h */,
229 | );
230 | name = Swift;
231 | sourceTree = "";
232 | };
233 | /* End PBXGroup section */
234 |
235 | /* Begin PBXNativeTarget section */
236 | 8D15AC270486D014006FF6A4 /* Fun House */ = {
237 | isa = PBXNativeTarget;
238 | buildConfigurationList = 01E2153009ED8E0C00E66AF8 /* Build configuration list for PBXNativeTarget "Fun House" */;
239 | buildPhases = (
240 | 8D15AC2B0486D014006FF6A4 /* Resources */,
241 | 8D15AC300486D014006FF6A4 /* Sources */,
242 | 8D15AC330486D014006FF6A4 /* Frameworks */,
243 | );
244 | buildRules = (
245 | );
246 | dependencies = (
247 | );
248 | name = "Fun House";
249 | productInstallPath = "$(HOME)/Applications";
250 | productName = FunHouse;
251 | productReference = 8D15AC370486D014006FF6A4 /* Core Image Fun House.app */;
252 | productType = "com.apple.product-type.application";
253 | };
254 | /* End PBXNativeTarget section */
255 |
256 | /* Begin PBXProject section */
257 | 2A37F4A9FDCFA73011CA2CEA /* Project object */ = {
258 | isa = PBXProject;
259 | attributes = {
260 | LastUpgradeCheck = 1120;
261 | TargetAttributes = {
262 | 8D15AC270486D014006FF6A4 = {
263 | LastSwiftMigration = 1120;
264 | };
265 | };
266 | };
267 | buildConfigurationList = 01E2153409ED8E0C00E66AF8 /* Build configuration list for PBXProject "FunHouse" */;
268 | compatibilityVersion = "Xcode 3.2";
269 | developmentRegion = en;
270 | hasScannedForEncodings = 1;
271 | knownRegions = (
272 | en,
273 | Base,
274 | );
275 | mainGroup = 2A37F4AAFDCFA73011CA2CEA /* FunHouse */;
276 | projectDirPath = "";
277 | projectRoot = "";
278 | targets = (
279 | 8D15AC270486D014006FF6A4 /* Fun House */,
280 | );
281 | };
282 | /* End PBXProject section */
283 |
284 | /* Begin PBXResourcesBuildPhase section */
285 | 8D15AC2B0486D014006FF6A4 /* Resources */ = {
286 | isa = PBXResourcesBuildPhase;
287 | buildActionMask = 2147483647;
288 | files = (
289 | 68895825076905D2007F6B31 /* minusbutton.tiff in Resources */,
290 | AF90B80E18FC96640066FC6D /* InfoPlist.strings in Resources */,
291 | 68895826076905D2007F6B31 /* plusbutton.tiff in Resources */,
292 | AF90B80F18FC96640066FC6D /* MainMenu.xib in Resources */,
293 | 6803ADA90770AFC800AAFF76 /* document.icns in Resources */,
294 | AF90B80B18FC96640066FC6D /* EffectStack.xib in Resources */,
295 | 68FCAB160770E25F0004DA32 /* Images in Resources */,
296 | 682F97E8077243900080871A /* NSApplicationIcon.icns in Resources */,
297 | 68488CE007774D1A000C118A /* playbutton.tiff in Resources */,
298 | 68952755077767D600B3EAFE /* smoothtexture.tiff in Resources */,
299 | AF90B80A18FC96640066FC6D /* Credits.rtf in Resources */,
300 | 689527BF0777694D00B3EAFE /* lightball.tiff in Resources */,
301 | 68952C45077777EF00B3EAFE /* restrictedshine.tiff in Resources */,
302 | 68952C6807777B7200B3EAFE /* colormap.tiff in Resources */,
303 | 68D2DD4E077B7FA30008F86A /* mask.tiff in Resources */,
304 | AF90B80C18FC96640066FC6D /* FilterPalette.xib in Resources */,
305 | AF90B81018FC96640066FC6D /* Preferences.xib in Resources */,
306 | AF90B80D18FC96640066FC6D /* FunHouseWindow.xib in Resources */,
307 | );
308 | runOnlyForDeploymentPostprocessing = 0;
309 | };
310 | /* End PBXResourcesBuildPhase section */
311 |
312 | /* Begin PBXSourcesBuildPhase section */
313 | 8D15AC300486D014006FF6A4 /* Sources */ = {
314 | isa = PBXSourcesBuildPhase;
315 | buildActionMask = 2147483647;
316 | files = (
317 | 8D15AC310486D014006FF6A4 /* FunHouseDocument.m in Sources */,
318 | DED8299B2378FC9600BB203F /* EffectStackController.m in Sources */,
319 | DED8299A2378CEBF00BB203F /* EffectStackController.swift in Sources */,
320 | 8D15AC320486D014006FF6A4 /* main.m in Sources */,
321 | 68D08A3A0766773F005C971D /* CoreImageView.m in Sources */,
322 | 6807919C0767823B00873D85 /* EffectStack.m in Sources */,
323 | 680798940767BBEC00873D85 /* FunHouseWindowController.m in Sources */,
324 | 680799030767C28E00873D85 /* FunHouseAppDelegate.m in Sources */,
325 | 688957030768C53C007F6B31 /* FilterView.m in Sources */,
326 | 6889570A0768C550007F6B31 /* ParameterView.m in Sources */,
327 | 6812A5D4077B6B7900A10E6B /* FunHouseApplication.m in Sources */,
328 | 681F439207C27483004C53AB /* SampleCIView.m in Sources */,
329 | );
330 | runOnlyForDeploymentPostprocessing = 0;
331 | };
332 | /* End PBXSourcesBuildPhase section */
333 |
334 | /* Begin PBXVariantGroup section */
335 | AF90B7FC18FC96640066FC6D /* Credits.rtf */ = {
336 | isa = PBXVariantGroup;
337 | children = (
338 | DED8298E2378801F00BB203F /* en */,
339 | );
340 | name = Credits.rtf;
341 | sourceTree = "";
342 | };
343 | AF90B7FE18FC96640066FC6D /* EffectStack.xib */ = {
344 | isa = PBXVariantGroup;
345 | children = (
346 | DED829952378802600BB203F /* Base */,
347 | );
348 | name = EffectStack.xib;
349 | sourceTree = "";
350 | };
351 | AF90B80018FC96640066FC6D /* FilterPalette.xib */ = {
352 | isa = PBXVariantGroup;
353 | children = (
354 | DED829962378802600BB203F /* Base */,
355 | );
356 | name = FilterPalette.xib;
357 | sourceTree = "";
358 | };
359 | AF90B80218FC96640066FC6D /* FunHouseWindow.xib */ = {
360 | isa = PBXVariantGroup;
361 | children = (
362 | DED829972378802600BB203F /* Base */,
363 | );
364 | name = FunHouseWindow.xib;
365 | sourceTree = "";
366 | };
367 | AF90B80418FC96640066FC6D /* InfoPlist.strings */ = {
368 | isa = PBXVariantGroup;
369 | children = (
370 | DED829922378801F00BB203F /* en */,
371 | );
372 | name = InfoPlist.strings;
373 | sourceTree = "";
374 | };
375 | AF90B80618FC96640066FC6D /* MainMenu.xib */ = {
376 | isa = PBXVariantGroup;
377 | children = (
378 | DED829982378802600BB203F /* Base */,
379 | );
380 | name = MainMenu.xib;
381 | sourceTree = "";
382 | };
383 | AF90B80818FC96640066FC6D /* Preferences.xib */ = {
384 | isa = PBXVariantGroup;
385 | children = (
386 | DED829992378802600BB203F /* Base */,
387 | );
388 | name = Preferences.xib;
389 | sourceTree = "";
390 | };
391 | /* End PBXVariantGroup section */
392 |
393 | /* Begin XCBuildConfiguration section */
394 | 01E2153109ED8E0C00E66AF8 /* Development */ = {
395 | isa = XCBuildConfiguration;
396 | buildSettings = {
397 | CLANG_ENABLE_MODULES = YES;
398 | CLANG_ENABLE_OBJC_WEAK = YES;
399 | CODE_SIGN_IDENTITY = "-";
400 | COMBINE_HIDPI_IMAGES = YES;
401 | COPY_PHASE_STRIP = NO;
402 | CURRENT_PROJECT_VERSION = 1;
403 | GCC_DYNAMIC_NO_PIC = NO;
404 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
405 | GCC_OPTIMIZATION_LEVEL = 0;
406 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
407 | GCC_PREFIX_HEADER = FunHouse_Prefix.pch;
408 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
409 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
410 | GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
411 | GCC_WARN_MISSING_PARENTHESES = YES;
412 | GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
413 | GCC_WARN_UNINITIALIZED_AUTOS = NO;
414 | GCC_WARN_UNUSED_LABEL = YES;
415 | GCC_WARN_UNUSED_VALUE = YES;
416 | GCC_WARN_UNUSED_VARIABLE = YES;
417 | INFOPLIST_FILE = Info.plist;
418 | INSTALL_PATH = "/Developer/Applications/Graphics Tools";
419 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
420 | MACOSX_DEPLOYMENT_TARGET = 10.15;
421 | MARKETING_VERSION = 3.0;
422 | PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.${PRODUCT_NAME:rfc1034identifier}";
423 | PRODUCT_NAME = "Core Image Fun House";
424 | SDKROOT = macosx;
425 | SWIFT_OBJC_BRIDGING_HEADER = "Fun House-Bridging-Header.h";
426 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
427 | SWIFT_VERSION = 5.0;
428 | WRAPPER_EXTENSION = app;
429 | };
430 | name = Development;
431 | };
432 | 01E2153209ED8E0C00E66AF8 /* Deployment */ = {
433 | isa = XCBuildConfiguration;
434 | buildSettings = {
435 | CLANG_ENABLE_MODULES = YES;
436 | CLANG_ENABLE_OBJC_WEAK = YES;
437 | CODE_SIGN_IDENTITY = "-";
438 | COMBINE_HIDPI_IMAGES = YES;
439 | COPY_PHASE_STRIP = YES;
440 | CURRENT_PROJECT_VERSION = 1;
441 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
442 | GCC_OPTIMIZATION_LEVEL = s;
443 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
444 | GCC_PREFIX_HEADER = FunHouse_Prefix.pch;
445 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
446 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
447 | GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
448 | GCC_WARN_MISSING_PARENTHESES = YES;
449 | GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
450 | GCC_WARN_UNINITIALIZED_AUTOS = NO;
451 | GCC_WARN_UNUSED_LABEL = YES;
452 | GCC_WARN_UNUSED_VALUE = YES;
453 | GCC_WARN_UNUSED_VARIABLE = YES;
454 | INFOPLIST_FILE = Info.plist;
455 | INSTALL_PATH = "/Developer/Applications/Graphics Tools";
456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
457 | MACOSX_DEPLOYMENT_TARGET = 10.15;
458 | MARKETING_VERSION = 3.0;
459 | PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.${PRODUCT_NAME:rfc1034identifier}";
460 | PRODUCT_NAME = "Core Image Fun House";
461 | SDKROOT = macosx;
462 | SWIFT_OBJC_BRIDGING_HEADER = "Fun House-Bridging-Header.h";
463 | SWIFT_VERSION = 5.0;
464 | WRAPPER_EXTENSION = app;
465 | };
466 | name = Deployment;
467 | };
468 | 01E2153509ED8E0C00E66AF8 /* Development */ = {
469 | isa = XCBuildConfiguration;
470 | buildSettings = {
471 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
472 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
473 | CLANG_WARN_BOOL_CONVERSION = YES;
474 | CLANG_WARN_COMMA = YES;
475 | CLANG_WARN_CONSTANT_CONVERSION = YES;
476 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
477 | CLANG_WARN_EMPTY_BODY = YES;
478 | CLANG_WARN_ENUM_CONVERSION = YES;
479 | CLANG_WARN_INFINITE_RECURSION = YES;
480 | CLANG_WARN_INT_CONVERSION = YES;
481 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
482 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
483 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
484 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
485 | CLANG_WARN_STRICT_PROTOTYPES = YES;
486 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
487 | CLANG_WARN_UNREACHABLE_CODE = YES;
488 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
489 | ENABLE_STRICT_OBJC_MSGSEND = YES;
490 | ENABLE_TESTABILITY = YES;
491 | GCC_NO_COMMON_BLOCKS = YES;
492 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
493 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
494 | GCC_WARN_UNDECLARED_SELECTOR = YES;
495 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
496 | GCC_WARN_UNUSED_FUNCTION = YES;
497 | GCC_WARN_UNUSED_VARIABLE = YES;
498 | MACOSX_DEPLOYMENT_TARGET = 10.12;
499 | ONLY_ACTIVE_ARCH = YES;
500 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
501 | };
502 | name = Development;
503 | };
504 | 01E2153609ED8E0C00E66AF8 /* Deployment */ = {
505 | isa = XCBuildConfiguration;
506 | buildSettings = {
507 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
508 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
509 | CLANG_WARN_BOOL_CONVERSION = YES;
510 | CLANG_WARN_COMMA = YES;
511 | CLANG_WARN_CONSTANT_CONVERSION = YES;
512 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
513 | CLANG_WARN_EMPTY_BODY = YES;
514 | CLANG_WARN_ENUM_CONVERSION = YES;
515 | CLANG_WARN_INFINITE_RECURSION = YES;
516 | CLANG_WARN_INT_CONVERSION = YES;
517 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
518 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
519 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
520 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
521 | CLANG_WARN_STRICT_PROTOTYPES = YES;
522 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
523 | CLANG_WARN_UNREACHABLE_CODE = YES;
524 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
525 | ENABLE_STRICT_OBJC_MSGSEND = YES;
526 | GCC_NO_COMMON_BLOCKS = YES;
527 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
528 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
529 | GCC_WARN_UNDECLARED_SELECTOR = YES;
530 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
531 | GCC_WARN_UNUSED_FUNCTION = YES;
532 | GCC_WARN_UNUSED_VARIABLE = YES;
533 | MACOSX_DEPLOYMENT_TARGET = 10.12;
534 | SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
535 | };
536 | name = Deployment;
537 | };
538 | /* End XCBuildConfiguration section */
539 |
540 | /* Begin XCConfigurationList section */
541 | 01E2153009ED8E0C00E66AF8 /* Build configuration list for PBXNativeTarget "Fun House" */ = {
542 | isa = XCConfigurationList;
543 | buildConfigurations = (
544 | 01E2153109ED8E0C00E66AF8 /* Development */,
545 | 01E2153209ED8E0C00E66AF8 /* Deployment */,
546 | );
547 | defaultConfigurationIsVisible = 0;
548 | defaultConfigurationName = Deployment;
549 | };
550 | 01E2153409ED8E0C00E66AF8 /* Build configuration list for PBXProject "FunHouse" */ = {
551 | isa = XCConfigurationList;
552 | buildConfigurations = (
553 | 01E2153509ED8E0C00E66AF8 /* Development */,
554 | 01E2153609ED8E0C00E66AF8 /* Deployment */,
555 | );
556 | defaultConfigurationIsVisible = 0;
557 | defaultConfigurationName = Deployment;
558 | };
559 | /* End XCConfigurationList section */
560 | };
561 | rootObject = 2A37F4A9FDCFA73011CA2CEA /* Project object */;
562 | }
563 |
--------------------------------------------------------------------------------
/FunHouse/FunHouse.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FunHouse/FunHouse.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/FunHouse/FunHouseAppDelegate.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: FunHouseAppDelegate.h
3 | Abstract: n/a
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 |
50 | @interface FunHouseAppDelegate : NSObject
51 | {
52 | @private NSWindowController *_preferencesWindowController;
53 |
54 | }
55 |
56 | - (IBAction)showEffectStackAction:(id)sender;
57 | - (IBAction)zoomToFullScreenAction:(id)sender;
58 | - (IBAction)undo:(id)sender;
59 | - (IBAction)redo:(id)sender;
60 |
61 | - (IBAction)showPreferences:(id)sender;
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/FunHouse/FunHouseAppDelegate.m:
--------------------------------------------------------------------------------
1 | /*
2 | File: FunHouseAppDelegate.m
3 | Abstract: n/a
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import "FunHouseAppDelegate.h"
49 |
50 | //#import "EffectStackController.h"
51 | #import "Core_Image_Fun_House-Swift.h"
52 |
53 | @implementation FunHouseAppDelegate
54 |
55 | + (void)setupDefaults
56 | {
57 | NSDictionary *userDefaultsValuesDict;
58 |
59 | userDefaultsValuesDict=[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"useSoftwareRenderer"];
60 |
61 | // set them in the standard user defaults
62 | [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict];
63 | }
64 |
65 | - (void)applicationWillFinishLaunching:(NSNotification *)notification
66 | {
67 | [FunHouseAppDelegate setupDefaults];
68 | }
69 |
70 | // application delegates implement this to accomplish tasks right after the application launches
71 | // in this case, I copy the example images from the application package to the ~/Library/Application Support/Core Image Fun House/Example Images folder
72 | // we also automatically open a file on launch if we're not already opening one (by drag or double-click)
73 | - (void)applicationDidFinishLaunching:(NSNotification *)notification
74 | {
75 | BOOL isDir;
76 | NSInteger i, count;
77 | NSError *err;
78 | NSOpenPanel *op;
79 | NSString *path, *path2, *source, *file, *sourcefile, *destfile;
80 | NSBundle *bundle;
81 | NSFileManager *manager;
82 | NSArray *files;
83 |
84 | // "Start Dictation..." and "Special Characters..." are not relevant to this application
85 | // remove these automatically-added entries from the Edit menu
86 | NSMenu* edit = [[[[NSApplication sharedApplication] mainMenu] itemWithTitle: @"Edit"] submenu];
87 | if ([[edit itemAtIndex: [edit numberOfItems] - 1] action] == NSSelectorFromString(@"orderFrontCharacterPalette:"))
88 | [edit removeItemAtIndex: [edit numberOfItems] - 1];
89 | if ([[edit itemAtIndex: [edit numberOfItems] - 1] action] == NSSelectorFromString(@"startDictation:"))
90 | [edit removeItemAtIndex: [edit numberOfItems] - 1];
91 | if ([[edit itemAtIndex: [edit numberOfItems] - 1] isSeparatorItem])
92 | [edit removeItemAtIndex: [edit numberOfItems] - 1];
93 |
94 | [self showEffectStackAction:self];
95 | // decide if images have yet been copied to ~/Library/Application Support/Core Image Fun House/Example Images
96 | path = @"~/Library/Application Support/Core Image Fun House";
97 | path = [path stringByExpandingTildeInPath];
98 | path2 = [path stringByAppendingString:@"/Example Images Folder"];
99 | manager = [NSFileManager defaultManager];
100 | if (![manager fileExistsAtPath:path isDirectory:&isDir])
101 | {
102 | // otherwise we need to create the ~/Library/Application Support/Core Image Fun House folder
103 | [manager createDirectoryAtPath:path withIntermediateDirectories:NO attributes:nil error:&err];
104 | [manager createDirectoryAtPath:path2 withIntermediateDirectories:NO attributes:nil error:&err];
105 | bundle = [NSBundle bundleForClass:[self class]];
106 | source = [[bundle resourcePath] stringByAppendingString:@"/Images"];
107 | // and copy the files
108 | files = [manager contentsOfDirectoryAtPath:source error:&err];
109 | count = [files count];
110 | for (i = 0; i < count; i++)
111 | {
112 | file = [files objectAtIndex:i];
113 | sourcefile = [[source stringByAppendingString:@"/"] stringByAppendingString:file];
114 | destfile = [[path2 stringByAppendingString:@"/"] stringByAppendingString:file];
115 | [manager copyItemAtPath:sourcefile toPath:destfile error:&err];
116 | }
117 | }
118 |
119 | #if 1
120 | // only automatically open a file if none has already been opened
121 | if ([[[NSDocumentController sharedDocumentController] documents] count] == 0)
122 | {
123 | // open a file at launch from the ~/Library/Application Support/Core Image Fun House/Example Images folder
124 | op = [NSOpenPanel openPanel];
125 | [op setAllowsMultipleSelection:NO];
126 | [op setDirectoryURL:[NSURL fileURLWithPath:path2 isDirectory:YES]];
127 | [op setAllowedFileTypes:[NSArray arrayWithObjects:@"jpeg", @"jpg", @"tiff", @"tif", @"png", @"crw", @"cr2", @"raf", @"mrw", @"nef", @"srf", @"exr", @"funhouse", nil]];
128 |
129 | if ([op runModal] == NSOKButton) {
130 | //[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:[[op URLs] objectAtIndex:0] display:YES error:&err];
131 | [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:[[op URLs] objectAtIndex:0] display:YES completionHandler:^(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error) {
132 | if (error) { NSLog(@"ERROR: %@", error); }
133 | }
134 | ];
135 | }
136 | }
137 | #endif
138 | }
139 |
140 | - (IBAction)showPreferences:(id)sender
141 | {
142 | if (_preferencesWindowController) {
143 | [_preferencesWindowController release];
144 | _preferencesWindowController = nil;
145 | }
146 | _preferencesWindowController = [[NSWindowController alloc] initWithWindowNibName:@"Preferences"];
147 |
148 | // Make the panel appear in a good default location.
149 | [[_preferencesWindowController window] center];
150 | [_preferencesWindowController showWindow:sender];
151 | }
152 |
153 | // handle the show effect stack menu item action
154 | - (IBAction)showEffectStackAction:(id)sender
155 | {
156 | [[EffectStackController sharedEffectStackController] showWindow:sender];
157 | }
158 |
159 | // don't open an untitled file at the start
160 | - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
161 | {
162 | return NO;
163 | }
164 |
165 | // this gets called when gthe application is just ready to quit
166 | - (void)applicationWillTerminate:(NSNotification *)aNotification
167 | {
168 | // close down the effect stack controller so that it's position will be saved in a closed state
169 | // note: if it's not closed down when the application terminates, then the window will precess
170 | // down the screen the next time the application is launched
171 | [[EffectStackController sharedEffectStackController] closeDown];
172 | }
173 |
174 | // handle the zoom to full screen menu item action
175 | - (IBAction)zoomToFullScreenAction:(id)sender
176 | {
177 | [[[NSDocumentController sharedDocumentController] currentDocument] zoomToFullScreenAction:sender];
178 | }
179 |
180 | // handle the undo menu item action
181 | - (IBAction)undo:(id)sender
182 | {
183 | [[[NSDocumentController sharedDocumentController] currentDocument] undo];
184 | }
185 |
186 | // handle the redo menu item action
187 | - (IBAction)redo:(id)sender
188 | {
189 | [[[NSDocumentController sharedDocumentController] currentDocument] redo];
190 | }
191 |
192 | // validate (enable/disable) undo and redo menu items
193 | - (BOOL)validateMenuItem:(NSMenuItem *)item
194 | {
195 | NSUndoManager *um = [[[NSDocumentController sharedDocumentController] currentDocument] undoManager];
196 | if ([[[item menu] title] isEqualToString:@"Edit"])
197 | {
198 | if ([[[item title] substringToIndex:4] isEqualToString:@"Undo"])
199 | {
200 | [item setTitle:[um undoMenuItemTitle]];
201 | return [um canUndo];
202 | }
203 | else if ([[[item title] substringToIndex:4] isEqualToString:@"Redo"])
204 | {
205 | [item setTitle:[um redoMenuItemTitle]];
206 | return [um canRedo];
207 | }
208 | }
209 | return YES;
210 | }
211 |
212 | @end
213 |
--------------------------------------------------------------------------------
/FunHouse/FunHouseApplication.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: FunHouseApplication.h
3 | Abstract: This is a subclass of NSApplication we subclass so we can get ahold of the escape key for full screen mode swap.
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 |
50 | @interface FunHouseApplication: NSApplication
51 | {
52 | IBOutlet NSMenuItem *zoomToFullScreenMenuItem;
53 | // a set of "standard" images used to fill in filter CIImage parameters
54 | // see the EffectStackController setAutomaticDefaults: method
55 | CIImage *texture; // a texture - used for CIGlassDistortion
56 | CIImage *shadingemap; // a material map used for shading - used for CIShadedMaterial
57 | CIImage *alphaemap; // a material map with alpha that's not all 1 - used for CIRippleTransition
58 | CIImage *ramp; // color ramp - a width "n" height 1 image - used for CIColorMap
59 | CIImage *mask; // mask (grayscale image) used for CIDisintegrateWithMaskTransition
60 | // original paths for the above images
61 | NSString *texturepath;
62 | NSString *shadingemappath;
63 | NSString *alphaemappath;
64 | NSString *ramppath;
65 | NSString *maskpath;
66 | }
67 |
68 | - (void)setFullScreenMenuTitle:(BOOL)inFullScreen;
69 |
70 | // accessors for default images for filters
71 | - (CIImage *)defaultTexture;
72 | - (NSString *)defaultTexturePath;
73 | - (CIImage *)defaultShadingEMap;
74 | - (NSString *)defaultShadingEMapPath;
75 | - (CIImage *)defaultAlphaEMap;
76 | - (NSString *)defaultAlphaEMapPath;
77 | - (CIImage *)defaultRamp;
78 | - (NSString *)defaultRampPath;
79 | - (CIImage *)defaultMask;
80 | - (NSString *)defaultMaskPath;
81 |
82 | @end
83 |
--------------------------------------------------------------------------------
/FunHouse/FunHouseApplication.m:
--------------------------------------------------------------------------------
1 | /*
2 | File: FunHouseApplication.m
3 | Abstract: This is a subclass of NSApplication we subclass so we can get ahold of the escape key for full screen mode swap.
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import "FunHouseApplication.h"
49 | #import "FunHouseAppDelegate.h"
50 |
51 |
52 | @implementation FunHouseApplication
53 |
54 | - (void)awakeFromNib
55 | {
56 | // fetch textures now
57 | // provide a set of "standard" images used to fill in filter CIImage parameters
58 | // see the EffectStackController setAutomaticDefaults: method
59 | // a texture - used for CIGlassDistortion
60 | texturepath = [[[NSBundle mainBundle] pathForResource:@"smoothtexture" ofType: @"tiff"] retain];
61 | // a material map used for shading - used for CIShadedMaterial
62 | shadingemappath = [[[NSBundle mainBundle] pathForResource:@"lightball" ofType: @"tiff"] retain];
63 | // a material map with alpha that's not all 1 - used for CIRippleTransition
64 | alphaemappath = [[[NSBundle mainBundle] pathForResource:@"restrictedshine" ofType: @"tiff"] retain];
65 | // color ramp - a width "n" height 1 image - used for CIColorMap
66 | ramppath = [[[NSBundle mainBundle] pathForResource:@"colormap" ofType: @"tiff"] retain];
67 | // mask (grayscale image) used for CIDisintegrateWithMaskTransition
68 | maskpath = [[[NSBundle mainBundle] pathForResource:@"mask" ofType: @"tiff"] retain];
69 | }
70 |
71 | - (void)dealloc
72 | {
73 | [texturepath release];
74 | [texture release];
75 | [shadingemappath release];
76 | [shadingemap release];
77 | [alphaemappath release];
78 | [alphaemap release];
79 | [ramppath release];
80 | [ramp release];
81 | [maskpath release];
82 | [mask release];
83 | [super dealloc];
84 | }
85 |
86 | // this procedure allows us to intercept the escape key (for full screen zoom)
87 | - (void)sendEvent:(NSEvent *)event
88 | {
89 | if ([event type] == NSKeyDown)
90 | {
91 | NSString *str;
92 |
93 | str = [event characters];
94 | if ([str characterAtIndex:0] == 0x1B) // escape
95 | {
96 | [(FunHouseAppDelegate*)[self delegate] zoomToFullScreenAction:self];
97 | return;
98 | }
99 | }
100 | [super sendEvent:event];
101 | }
102 |
103 | // method used to set the title of the "full screen" menu item
104 | // (depends on the current state)
105 | - (void)setFullScreenMenuTitle:(BOOL)inFullScreen
106 | {
107 | if (inFullScreen)
108 | [zoomToFullScreenMenuItem setTitle:@"Exit Full Screen"];
109 | else
110 | [zoomToFullScreenMenuItem setTitle:@"Zoom To Full Screen"];
111 | }
112 |
113 | // accessors for default images (and their paths) for filters
114 | // load the images only on demand to keep launch time down
115 | - (CIImage *)defaultTexture
116 | {
117 | if(texture == NULL)
118 | texture = [[CIImage imageWithContentsOfURL:[NSURL fileURLWithPath:texturepath]] retain];
119 | return texture;
120 | }
121 |
122 | - (NSString *)defaultTexturePath
123 | {
124 | return texturepath;
125 | }
126 |
127 | - (CIImage *)defaultShadingEMap
128 | {
129 | if(shadingemap == NULL)
130 | shadingemap = [[CIImage imageWithContentsOfURL:[NSURL fileURLWithPath:shadingemappath]] retain];
131 | return shadingemap;
132 | }
133 |
134 | - (NSString *)defaultShadingEMapPath
135 | {
136 | return shadingemappath;
137 | }
138 |
139 | - (CIImage *)defaultAlphaEMap
140 | {
141 | if(alphaemap == NULL)
142 | alphaemap = [[CIImage imageWithContentsOfURL:[NSURL fileURLWithPath:alphaemappath]] retain];
143 | return alphaemap;
144 | }
145 |
146 | - (NSString *)defaultAlphaEMapPath
147 | {
148 | return alphaemappath;
149 | }
150 |
151 | - (CIImage *)defaultRamp
152 | {
153 | if(ramp == NULL)
154 | ramp = [[CIImage imageWithContentsOfURL:[NSURL fileURLWithPath:ramppath]] retain];
155 | return ramp;
156 | }
157 |
158 | - (NSString *)defaultRampPath
159 | {
160 | return ramppath;
161 | }
162 |
163 | - (CIImage *)defaultMask
164 | {
165 | if(mask == NULL)
166 | mask = [[CIImage imageWithContentsOfURL:[NSURL fileURLWithPath:maskpath]] retain];
167 | return mask;
168 | }
169 |
170 | - (NSString *)defaultMaskPath
171 | {
172 | return maskpath;
173 | }
174 |
175 | @end
176 |
--------------------------------------------------------------------------------
/FunHouse/FunHouseDocument.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: FunHouseDocument.h
3 | Abstract: n/a
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 |
50 | @class EffectStack;
51 | @class FunHouseWindowController;
52 |
53 | @interface FunHouseDocument : NSDocument
54 | {
55 | EffectStack *effectStack; // the effect stack we own (the document's data)
56 | BOOL fullScreen; // YES if this document is in full screen, NO if it's just a typical window
57 | FunHouseWindowController *windowController; // standard (typical) window controller
58 | FunHouseWindowController *fullScreenController; // (full screen) window controller
59 | CGColorSpaceRef colorspace;
60 | BOOL hasWindowDimensions;
61 | CGFloat wdWidth;
62 | CGFloat wdHeight;
63 | }
64 |
65 | - (EffectStack *)effectStack;
66 | - (BOOL)openPreset:(NSFileWrapper *)fileWrapper error:(NSError **)outError;
67 | - (IBAction)zoomToFullScreenAction:(id)sender;
68 | - (void)undo;
69 | - (void)redo;
70 | - (void)reconfigureWindowToSize:(NSSize)size andPath:(NSString *)path;
71 | - (BOOL)hasWindowDimensions;
72 | - (CGFloat)windowWidth;
73 | - (CGFloat)windowHeight;
74 | @end
75 |
--------------------------------------------------------------------------------
/FunHouse/FunHouseWindowController.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: FunHouseWindowController.h
3 | Abstract: n/a
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 |
50 | @class CoreImageView;
51 | @class FunHouseDocument;
52 |
53 | @interface FunHouseWindowController : NSWindowController
54 | {
55 | @private
56 | IBOutlet CoreImageView *coreImageView; // pointer to the core image view buried in our owned window view structure
57 | FunHouseDocument *fhdoc; // back pointer to the owning document
58 | }
59 |
60 | - (id)initFullScreen;
61 | - (CoreImageView *)coreImageView;
62 | - (void)prepFullScreenWindow;
63 | - (void)configureToSize:(NSSize)size andFilename:(NSString *)filename;
64 |
65 | @end
66 |
--------------------------------------------------------------------------------
/FunHouse/FunHouseWindowController.m:
--------------------------------------------------------------------------------
1 | /*
2 | File: FunHouseWindowController.m
3 | Abstract: n/a
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import "FunHouseWindowController.h"
49 | #import "CoreImageView.h"
50 |
51 | //#import "EffectStackController.h"
52 | #import "Core_Image_Fun_House-Swift.h"
53 | #import "FunHouseDocument.h"
54 | #import "EffectStack.h"
55 | #import
56 | #import
57 |
58 | // this is a subclass of NSWindowController
59 |
60 | @implementation FunHouseWindowController
61 |
62 | // standard window init
63 | - (id)init
64 | {
65 | self = [super initWithWindowNibName:@"FunHouseWindow"];
66 | return self;
67 | }
68 |
69 | - (void)setUpCoreImageView
70 | {
71 | [coreImageView setNeedsDisplay:YES];
72 | }
73 |
74 | // this is an official init procedure for full screen windwo use
75 | - (id)initFullScreen
76 | {
77 | NSWindow *w;
78 | NSRect frame;
79 |
80 | // set up the system to hide the menu bar and dock
81 | [[NSApplication sharedApplication] setPresentationOptions:NSApplicationPresentationAutoHideMenuBar|NSApplicationPresentationAutoHideDock];
82 | // get the frame of the screen
83 | frame = [[NSScreen mainScreen] frame];
84 | // create a new borderless window the size of the entire screen
85 | w = [[NSWindow alloc] initWithContentRect:frame
86 | styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
87 | // put it up front
88 | [w makeKeyAndOrderFront:self];
89 | // and initialize with this window
90 | self = [super initWithWindow:w];
91 | return self;
92 | }
93 |
94 | - (void)prepFullScreenWindow
95 | {
96 | NSWindow *w;
97 |
98 | w = [self window];
99 | // create a new core image view (the size of the entire content view) for the full screen window
100 | coreImageView = [[[CoreImageView alloc] initWithFrame:[[w contentView] bounds]] autorelease];
101 | // tie us in as its controller
102 | [coreImageView setFunHouseWindowController:self];
103 | [self setUpCoreImageView];
104 | // add the core image view as a subview of the content view
105 | [[w contentView] addSubview:coreImageView];
106 | // force an initialization of the core image view
107 | [coreImageView awakeFromNib];
108 | // and make the view the first responder (for mouseEntered and mouseExited events...)
109 | [w makeFirstResponder:coreImageView];
110 | }
111 |
112 | - (void)dealloc
113 | {
114 | [[NSNotificationCenter defaultCenter] removeObserver:self];
115 | // Balance the -setFunHouseWindowController: that our -windowDidLoad does.
116 | [coreImageView setFunHouseWindowController:nil];
117 | [super dealloc];
118 | }
119 |
120 | // this gets called when a typical window is loaded from the FunHouseWindow.nib file
121 | - (void)windowDidLoad
122 | {
123 | CGFloat xwiden, ywiden, xscale, yscale, scale, width, height;
124 | CIImage *im;
125 | CGSize imagesize;
126 | NSSize screensize;
127 | NSRect R;
128 |
129 | [super windowDidLoad];
130 | // set up a backpointer from the core image view to us
131 | [coreImageView setFunHouseWindowController:self];
132 | [self setUpCoreImageView];
133 | // this is required for mouseEntered and mouseExited events
134 | [[self window] makeFirstResponder:coreImageView];
135 | if ([fhdoc hasWindowDimensions])
136 | {
137 | width = [fhdoc windowWidth];
138 | height = [fhdoc windowHeight];
139 | scale = 1.0;
140 | [[self window] setContentSize:NSMakeSize(width, height)];
141 | // set up view transform using scale
142 | [coreImageView setViewTransformScale:scale];
143 | [coreImageView setViewTransformOffsetX:0.0 andY:0.0];
144 | return;
145 | }
146 | // resize window to match file size
147 | im = [[fhdoc effectStack] baseImage];
148 | if (im != nil)
149 | {
150 | imagesize = [im extent].size;
151 | // if the image is too large to fit on screen in a document window, we must apply a view transform
152 | screensize = [[NSScreen mainScreen] frame].size;
153 | R = [NSWindow frameRectForContentRect:NSMakeRect(0, 0, 100, 100) styleMask:NSTitledWindowMask];
154 | xwiden = R.size.width - 100 - R.origin.x;
155 | ywiden = R.size.height - 100 - R.origin.y;
156 | screensize.width -= xwiden;
157 | screensize.height -= ywiden;
158 | if (imagesize.width > screensize.width || imagesize.height > screensize.height)
159 | {
160 | // compute scale needed
161 | xscale = screensize.width / imagesize.width;
162 | yscale = screensize.height / imagesize.height;
163 | scale = (yscale < xscale) ? yscale : xscale;
164 | imagesize.width *= scale;
165 | imagesize.height *= scale;
166 | imagesize.width = ceil(imagesize.width);
167 | imagesize.height = ceil(imagesize.height);
168 | }
169 | else
170 | scale = 1.0;
171 | [[self window] setContentSize:NSMakeSize(imagesize.width, imagesize.height)];
172 | // set up view transform using scale
173 | [coreImageView setViewTransformScale:scale];
174 | [coreImageView setViewTransformOffsetX:0.0 andY:0.0];
175 | }
176 | }
177 |
178 | // set up a document backpointer
179 | - (void)setDocument:(NSDocument *)document
180 | {
181 | [super setDocument:document];
182 | fhdoc = (FunHouseDocument *)document;
183 | [self setUpCoreImageView];
184 | }
185 |
186 | // we return a pointer to the core image view buried in our owned window view structure
187 | - (CoreImageView *)coreImageView
188 | {
189 | return coreImageView;
190 | }
191 |
192 | // required for implementing undo
193 | - (NSUndoManager *)windowWillReturnUndoManager
194 | {
195 | return [[self document] undoManager];
196 | }
197 |
198 | - (void)configureToSize:(NSSize)size andFilename:(NSString *)filename
199 | {
200 | NSRect frame, frame2;
201 |
202 | frame = [[self window] frameRectForContentRect:NSMakeRect(0.0, 0.0, size.width, size.height)];
203 | frame2 = [[self window] frame];
204 | frame.origin.x = frame2.origin.x;
205 | frame.origin.y = frame2.origin.y + frame2.size.height - frame.size.height;
206 | [[self window] setFrame:frame display:YES];
207 | }
208 | @end
209 |
--------------------------------------------------------------------------------
/FunHouse/FunHouse_Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'FunHouse' target in the 'FunHouse' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #endif
8 |
--------------------------------------------------------------------------------
/FunHouse/Images/Bryce.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/Images/Bryce.jpg
--------------------------------------------------------------------------------
/FunHouse/Images/Copenhagen.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/Images/Copenhagen.jpg
--------------------------------------------------------------------------------
/FunHouse/Images/Flowers.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/Images/Flowers.jpg
--------------------------------------------------------------------------------
/FunHouse/Images/Wolf.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/Images/Wolf.jpg
--------------------------------------------------------------------------------
/FunHouse/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleDocumentTypes
8 |
9 |
10 | CFBundleTypeExtensions
11 |
12 | funhouse
13 |
14 | CFBundleTypeIconFile
15 | document
16 | CFBundleTypeName
17 | Fun House Preset
18 | CFBundleTypeRole
19 | Editor
20 | LSTypeIsPackage
21 |
22 | NSDocumentClass
23 | FunHouseDocument
24 |
25 |
26 | CFBundleTypeName
27 | Image
28 | CFBundleTypeRole
29 | Viewer
30 | LSItemContentTypes
31 |
32 | public.image
33 |
34 | LSTypeIsPackage
35 |
36 | NSDocumentClass
37 | FunHouseDocument
38 |
39 |
40 | CFBundleExecutable
41 | Core Image Fun House
42 | CFBundleIconFile
43 | NSApplicationIcon
44 | CFBundleIdentifier
45 | $(PRODUCT_BUNDLE_IDENTIFIER)
46 | CFBundleInfoDictionaryVersion
47 | 6.0
48 | CFBundlePackageType
49 | APPL
50 | CFBundleShortVersionString
51 | $(MARKETING_VERSION)
52 | CFBundleSignature
53 | CIFH
54 | CFBundleVersion
55 | $(CURRENT_PROJECT_VERSION)
56 | NSMainNibFile
57 | MainMenu
58 | NSPrincipalClass
59 | FunHouseApplication
60 |
61 |
62 |
--------------------------------------------------------------------------------
/FunHouse/NSApplicationIcon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/NSApplicationIcon.icns
--------------------------------------------------------------------------------
/FunHouse/Notes:
--------------------------------------------------------------------------------
1 | XCODE 9
2 |
3 | VPA info: plugin is INTEL, AVD_id = 1080004, AVD_api.Create:0x109a6855a
4 | 2019-11-06 07:52:50.418452-0500 Core Image Fun House[13048:825468]
5 | 2019-11-06 07:52:50.424159-0500 Core Image Fun House[13048:825468] SCdraw to screen 1
6 | 2019-11-06 07:52:50.424562-0500 Core Image Fun House[13048:825468] SCdraw to context 1
7 | 2019-11-06 07:52:50.424592-0500 Core Image Fun House[13048:825468] SCIdraw Rect
8 | 2019-11-06 07:52:50.425859-0500 Core Image Fun House[13048:825468] SCIdraw to screen 1
9 | 2019-11-06 07:52:50.780003-0500 Core Image Fun House[13048:825624] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
10 | 2019-11-06 07:52:53.489782-0500 Core Image Fun House[13048:825468]
11 | 2019-11-06 07:52:53.489828-0500 Core Image Fun House[13048:825468] SCdraw to screen 1
12 | 2019-11-06 07:52:53.489879-0500 Core Image Fun House[13048:825468] SCdraw to context 1
13 | 2019-11-06 07:52:53.489896-0500 Core Image Fun House[13048:825468] SCIdraw Rect
14 | 2019-11-06 07:52:53.502086-0500 Core Image Fun House[13048:825468] SCIdraw to screen 1
15 | 2019-11-06 08:01:15.106599-0500 Core Image Fun House[13048:825468]
16 | 2019-11-06 08:01:15.106655-0500 Core Image Fun House[13048:825468] SCdraw to screen 1
17 | 2019-11-06 08:01:15.106726-0500 Core Image Fun House[13048:825468] SCdraw to context 1
18 | 2019-11-06 08:01:15.106750-0500 Core Image Fun House[13048:825468] SCIdraw Rect
19 | 2019-11-06 08:01:15.106860-0500 Core Image Fun House[13048:825468] SCIdraw to screen 1
20 |
21 | XCODE 10
22 |
23 | VPA info: plugin is INTEL, AVD_id = 1080004, AVD_api.Create:0x10874d55a
24 | 2019-11-06 08:03:45.745531-0500 Core Image Fun House[13124:834033]
25 | 2019-11-06 08:03:45.836955-0500 Core Image Fun House[13124:834033] SCdraw to screen 1
26 | 2019-11-06 08:03:45.837509-0500 Core Image Fun House[13124:834033] SCdraw to context 1
27 | 2019-11-06 08:03:45.837531-0500 Core Image Fun House[13124:834033] SCIdraw Rect
28 | 2019-11-06 08:03:45.838931-0500 Core Image Fun House[13124:834033] SCIdraw to screen 1
29 | objc[13124]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fffa30c03d8) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x10b3f6f50). One of the two will be used. Which one is undefined.
30 | 2019-11-06 08:03:49.280589-0500 Core Image Fun House[13124:834160] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
31 | 2019-11-06 08:03:49.484693-0500 Core Image Fun House[13124:834033]
32 | 2019-11-06 08:03:49.484734-0500 Core Image Fun House[13124:834033] SCdraw to screen 1
33 | 2019-11-06 08:03:49.484749-0500 Core Image Fun House[13124:834033] SCdraw to context 1
34 | 2019-11-06 08:03:49.484756-0500 Core Image Fun House[13124:834033] SCIdraw Rect
35 | 2019-11-06 08:03:49.498522-0500 Core Image Fun House[13124:834033] SCIdraw to screen 1
36 | 2019-11-06 08:03:52.185113-0500 Core Image Fun House[13124:834033]
37 | 2019-11-06 08:03:52.185154-0500 Core Image Fun House[13124:834033] SCdraw to screen 1
38 | 2019-11-06 08:03:52.185166-0500 Core Image Fun House[13124:834033] SCdraw to context 1
39 | 2019-11-06 08:03:52.185173-0500 Core Image Fun House[13124:834033] SCIdraw Rect
40 | 2019-11-06 08:03:52.185242-0500 Core Image Fun House[13124:834033] SCIdraw to screen 1
41 |
42 |
--------------------------------------------------------------------------------
/FunHouse/ParameterView.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: ParameterView.h
3 | Abstract: This class contains the low-level automatic generation for effect stack UI from CoreImage filters and keys.
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 | #import
50 |
51 | // various types of data represented in a slider
52 | typedef enum
53 | {
54 | stScalar = 0,
55 | stAngle,
56 | stTime,
57 | stDistance,
58 | } SliderType;
59 |
60 | @class CoreImageView;
61 | @class EffectStackController;
62 | @class FunHouseImageView;
63 |
64 | @interface ParameterView : NSView
65 | {
66 | CIFilter *filter; // filter this UI element belongs to
67 | NSMutableDictionary *dict; // dictionary for text layer this slider/text view belongs to
68 | NSString *key; // key this UI element sets in filter
69 | CoreImageView *displayView; // view that owns this filter and can call to update display
70 | EffectStackController *master; // pointer back to the effect stack controller
71 | NSSlider *slider; // slider pointer, if we are a slider
72 | SliderType dataType; // basic data type represented by the slider
73 | NSButton *checkBox; // check box pointer, if we are a check box
74 | NSColorWell *colorWell; // color well pointer, if we are a color well
75 | FunHouseImageView *imageView; // image view pointer, if we are an image view
76 | NSButton *pushButton; // push button pointer (used in image layer widgets)
77 | NSTextField *labelTextField; // label text field (for slider, color well, some image views)
78 | NSTextField *readoutTextField; // readout text field (for sliders)
79 | NSTextView *textView; // text view pointer (for text layer widgets)
80 | NSInteger beforeDecimal; // format info for slider readouts
81 | NSInteger afterDecimal; // format info for slider readouts
82 | CGFloat lastFloatValue; // for slider: last floating point value shown
83 | // for transform
84 | NSSlider *scaleSlider;
85 | NSSlider *angleSlider;
86 | NSSlider *stretchSlider;
87 | NSSlider *skewSlider;
88 | NSTextField *scaleLabelTextField;
89 | NSTextField *angleLabelTextField;
90 | NSTextField *stretchLabelTextField;
91 | NSTextField *skewLabelTextField;
92 | NSTextField *scaleReadoutTextField;
93 | NSTextField *angleReadoutTextField;
94 | NSTextField *stretchReadoutTextField;
95 | NSTextField *skewReadoutTextField;
96 | SliderType scaleDataType;
97 | SliderType angleDataType;
98 | SliderType stretchDataType;
99 | SliderType skewDataType;
100 | CGFloat lastScaleFloatValue;
101 | CGFloat lastAngleFloatValue;
102 | CGFloat lastStretchFloatValue;
103 | CGFloat lastSkewFloatValue;
104 | BOOL usingNSAffineTransform;
105 | // for naked CIVector widgets
106 | NSTextField *readout1TextField;
107 | NSTextField *readout2TextField;
108 | NSTextField *readout3TextField;
109 | NSTextField *readout4TextField;
110 | }
111 |
112 | // convenience methods we export
113 | + (CIImage *)CIImageWithNSImage:(NSImage *)image;
114 | + (NSString *)ellipsizeField:(CGFloat)width font:(NSFont *)font string:(NSString *)label;
115 |
116 | - (IBAction)sliderChanged:(id)sender;
117 | - (IBAction)readoutTextFieldChanged:(id)sender;
118 | - (IBAction)colorWellChanged:(id)sender;
119 |
120 | // for filter inspection
121 | - (void)addSliderForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v master:(EffectStackController *)m;
122 | - (void)addCheckBoxForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v master:(EffectStackController *)m;
123 | - (void)addColorWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v master:(EffectStackController *)m;
124 | - (void)addImageWellForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v master:(EffectStackController *)m;
125 | - (void)addTransformForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v master:(EffectStackController *)m;
126 | - (void)addVectorForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v master:(EffectStackController *)m;
127 | - (void)addOffsetForFilter:(CIFilter *)f key:(NSString *)k displayView:(CoreImageView *)v master:(EffectStackController *)m;
128 |
129 | // for image inspection
130 | - (void)addImageWellForImage:(CIImage *)im tag:(NSInteger)tag displayView:(CoreImageView *)v master:(EffectStackController *)m;
131 |
132 | // for text inspection
133 | - (void)addTextViewForString:(NSMutableDictionary *)d key:(NSString *)k displayView:(CoreImageView *)v master:(EffectStackController *)m;
134 | - (void)addSliderForText:(NSMutableDictionary *)d key:(NSString *)k lo:(CGFloat)lo hi:(CGFloat)hi displayView:(CoreImageView *)v master:(EffectStackController *)m;
135 |
136 | @end
137 |
138 | @interface FunHouseImageView : NSImageView
139 | {
140 | NSString *_filePath;
141 | }
142 |
143 | - (void)setFilePath:(NSString *)path;
144 | - (NSString *)filePath;
145 | @end
146 |
147 | NSString *unInterCap(NSString *s);
148 |
--------------------------------------------------------------------------------
/FunHouse/ReadMe.txt:
--------------------------------------------------------------------------------
1 | ### FunHouse ###
2 |
3 | ===========================================================================
4 | DESCRIPTION:
5 |
6 | This is an Image Unit host that builds automatic UI for all filters and that allows applying stacked effects to images.
7 |
8 | ===========================================================================
9 | BUILD REQUIREMENTS:
10 |
11 | Xcode 5.0 or later, Mac OS X v10.9 or later
12 |
13 | ===========================================================================
14 | RUNTIME REQUIREMENTS:
15 |
16 | Mac OS X v10.6 or later
17 |
18 | ===========================================================================
19 | CHANGES FROM PREVIOUS VERSIONS:
20 |
21 | Version 1.1
22 | - Updated for OS X 10.9. Replaced deprecated calls. Removed Static Analyzer warnings. Upgraded nib files to xibs.
23 |
24 | Version 1.0
25 | - First version.
26 |
27 | ===========================================================================
28 | Copyright (C) 2004~2014 Apple Inc. All rights reserved.
29 |
--------------------------------------------------------------------------------
/FunHouse/SampleCIView.h:
--------------------------------------------------------------------------------
1 | /*
2 | File: SampleCIView.h
3 | Abstract: Simple OpenGL based CoreImage view
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 | #import
50 |
51 | @interface SampleCIView: NSOpenGLView
52 | {
53 | NSMutableDictionary *_contextOptions;
54 | CIContext *_context;
55 | CIImage *_image;
56 | NSRect _lastBounds;
57 |
58 | CGLContextObj _cglContext;
59 | NSOpenGLPixelFormat *_pf;
60 | CGDirectDisplayID _did;
61 | }
62 |
63 | - (void)setContextOptions:(NSMutableDictionary *)dict;
64 |
65 | - (void)setImage:(CIImage *)image;
66 | - (void)setImage:(CIImage *)image dirtyRect:(CGRect)r;
67 |
68 | - (CIImage *)image;
69 |
70 | // Called when the view bounds have changed
71 | - (void)viewBoundsDidChange:(NSRect)bounds;
72 |
73 | @end
74 |
75 | @interface NSObject (SampleCIViewDraw)
76 |
77 | // If defined in the view subclass, called when rendering
78 | - (void)drawRect:(NSRect)bounds inCIContext:(CIContext *)ctx;
79 |
80 | @end
81 |
--------------------------------------------------------------------------------
/FunHouse/SampleCIView.m:
--------------------------------------------------------------------------------
1 | /*
2 | File: SampleCIView.m
3 | Abstract: Simple OpenGL based CoreImage view
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import "SampleCIView.h"
49 |
50 | #import
51 | #import
52 |
53 | @interface SampleCIView ()
54 |
55 | - (BOOL)displaysWhenScreenProfileChanges;
56 | - (void)viewWillMoveToWindow:(NSWindow*)newWindow;
57 | - (void)displayProfileChanged:(NSNotification*)notification;
58 |
59 | @end
60 |
61 |
62 | @implementation SampleCIView
63 |
64 | + (NSOpenGLPixelFormat *)defaultPixelFormat
65 | {
66 | static NSOpenGLPixelFormat *pf;
67 |
68 | if (pf == nil)
69 | {
70 | /* Making sure the context's pixel format doesn't have a recovery
71 | * renderer is important - otherwise CoreImage may not be able to
72 | * create deeper context's that share textures with this one. */
73 |
74 | static const NSOpenGLPixelFormatAttribute attr[] = {
75 | NSOpenGLPFAAccelerated,
76 | NSOpenGLPFANoRecovery,
77 | NSOpenGLPFAColorSize, 32,
78 | NSOpenGLPFAAllowOfflineRenderers, /* allow use of offline renderers */
79 | 0
80 | };
81 |
82 | pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:(void *)&attr];
83 | }
84 |
85 | return pf;
86 | }
87 |
88 | - (void)dealloc
89 | {
90 | [[NSNotificationCenter defaultCenter] removeObserver:self];
91 | [_image release];
92 | [_contextOptions release];
93 | [_context release];
94 |
95 | [super dealloc];
96 | }
97 |
98 | - (void)setContextOptions:(NSMutableDictionary *)dict
99 | {
100 | [_contextOptions release];
101 | _contextOptions = [dict retain];
102 |
103 | [_context release];
104 | _context = nil;
105 | }
106 |
107 | - (CIImage *)image
108 | {
109 | return [[_image retain] autorelease];
110 | }
111 |
112 | - (void)setImage:(CIImage *)image dirtyRect:(CGRect)r
113 | {
114 | if (_image != image)
115 | {
116 | [_image release];
117 | _image = [image retain];
118 |
119 | if (CGRectIsInfinite (r))
120 | [self setNeedsDisplay:YES];
121 | else
122 | [self setNeedsDisplayInRect:*(NSRect *)&r];
123 | }
124 | }
125 |
126 | - (void)setImage:(CIImage *)image
127 | {
128 | [self setImage:image dirtyRect:CGRectInfinite];
129 | }
130 |
131 | - (void)prepareOpenGL
132 | {
133 | [super prepareOpenGL];
134 |
135 | GLint parm = 1;
136 |
137 | /* Enable beam-synced updates. */
138 |
139 | [[self openGLContext] setValues:&parm forParameter:NSOpenGLCPSwapInterval];
140 |
141 | /* Make sure that everything we don't need is disabled. Some of these
142 | * are enabled by default and can slow down rendering. */
143 | NSLog(@"%s", glGetString(GL_VERSION));
144 |
145 | glDisable (GL_ALPHA_TEST);
146 | glDisable (GL_DEPTH_TEST);
147 | glDisable (GL_SCISSOR_TEST);
148 | glDisable (GL_BLEND);
149 | glDisable (GL_DITHER);
150 | glDisable (GL_CULL_FACE);
151 | glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
152 | glDepthMask (GL_FALSE);
153 | glStencilMask (0);
154 | glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
155 | glHint (GL_TRANSFORM_HINT_APPLE, GL_FASTEST);
156 | }
157 |
158 | - (void)viewBoundsDidChange:(NSRect)bounds
159 | {
160 | /* For subclasses. */
161 | }
162 |
163 | - (void)updateMatrices
164 | {
165 | NSRect r = [self bounds];
166 |
167 | if (!NSEqualRects (r, _lastBounds))
168 | {
169 | [[self openGLContext] update];
170 |
171 | /* Install an orthographic projection matrix (no perspective)
172 | * with the origin in the bottom left and one unit equal to one
173 | * device pixel. */
174 |
175 | glViewport (0, 0, r.size.width, r.size.height);
176 |
177 | glMatrixMode (GL_PROJECTION);
178 | glLoadIdentity ();
179 | glOrtho (0, r.size.width, 0, r.size.height, -1, 1);
180 |
181 | glMatrixMode (GL_MODELVIEW);
182 | glLoadIdentity ();
183 |
184 | _lastBounds = r;
185 |
186 | [self viewBoundsDidChange:r];
187 | }
188 | }
189 |
190 | - (BOOL)displaysWhenScreenProfileChanges
191 | {
192 | return YES;
193 | }
194 |
195 | - (void)viewWillMoveToWindow:(NSWindow*)newWindow
196 | {
197 | NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
198 | [center removeObserver:self name:NSWindowDidChangeScreenProfileNotification object:nil];
199 | [center addObserver:self selector:@selector(displayProfileChanged:) name:NSWindowDidChangeScreenProfileNotification object:newWindow];
200 | [center addObserver:self selector:@selector(displayProfileChanged:) name:NSWindowDidMoveNotification object:newWindow];
201 |
202 | // When using OpenGL, we should disable the window's "one-shot" feature
203 | [newWindow setOneShot:NO];
204 | }
205 |
206 | - (void)displayProfileChanged:(NSNotification*)notification
207 | {
208 | CGDirectDisplayID oldDid = _did;
209 | _did = (CGDirectDisplayID)[[[[[self window] screen] deviceDescription] objectForKey:@"NSScreenNumber"] pointerValue];
210 | if(_did == oldDid)
211 | return;
212 |
213 | _cglContext = [[self openGLContext] CGLContextObj];
214 |
215 | if(_pf == nil)
216 | {
217 | _pf = [self pixelFormat];
218 | if (_pf == nil)
219 | _pf = [[self class] defaultPixelFormat];
220 |
221 | }
222 | CGLLockContext(_cglContext);
223 | {
224 |
225 | // Create a new CIContext using the new output color space
226 | [_context release];
227 |
228 | if(_contextOptions)
229 | {
230 | [_contextOptions setObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"useSoftwareRenderer"] forKey:kCIContextUseSoftwareRenderer];
231 | } else {
232 | _contextOptions = [[NSMutableDictionary dictionaryWithObject:[[NSUserDefaults standardUserDefaults] objectForKey:@"useSoftwareRenderer"] forKey:kCIContextUseSoftwareRenderer] retain];
233 | }
234 | // For 10.6 onwards we use the new API but do not pass in a colorspace as.
235 | // Since the cgl context will be rendered to the display, it is valid to rely on CI to get the colorspace from the context.
236 | _context = [[CIContext contextWithCGLContext:_cglContext pixelFormat:[_pf CGLPixelFormatObj] colorSpace:nil options:_contextOptions] retain];
237 | }
238 | CGLUnlockContext(_cglContext);
239 |
240 | }
241 |
242 |
243 | - (void)drawRect:(NSRect)r
244 | {
245 | CGRect ir, rr;
246 | CGImageRef cgImage;
247 |
248 | [[self openGLContext] makeCurrentContext];
249 |
250 | /* Allocate a CoreImage rendering context using the view's OpenGL
251 | * context as its destination if none already exists. */
252 |
253 | if (_context == nil)
254 | [self displayProfileChanged:nil];
255 |
256 | ir = CGRectIntegral (*(CGRect *)&r);
257 |
258 | NSGraphicsContext *printingContext = [NSGraphicsContext currentContext]; // nil other than printing
259 | if (!printingContext)
260 | {
261 | [self updateMatrices];
262 |
263 | /* Clear the specified subrect of the OpenGL surface then
264 | * render the image into the view. Use the GL scissor test to
265 | * clip to * the subrect. Ask CoreImage to generate an extra
266 | * pixel in case * it has to interpolate (allow for hardware
267 | * inaccuracies) */
268 | //glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
269 | //glClear (GL_COLOR_BUFFER_BIT);
270 |
271 |
272 | rr = CGRectIntersection (CGRectInset (ir, -1.0f, -1.0f),
273 | *(CGRect *)&_lastBounds);
274 |
275 | glScissor (ir.origin.x, ir.origin.y, ir.size.width, ir.size.height);
276 | glEnable (GL_SCISSOR_TEST);
277 |
278 | glClear (GL_COLOR_BUFFER_BIT);
279 |
280 | if ([self respondsToSelector:@selector (drawRect:inCIContext:)]) // for subclasses to provide their own drawing method
281 | {
282 | NSLog(@"SI DRAWRECT");
283 | [self drawRect:*(NSRect *)&rr inCIContext:_context];
284 | }
285 | else if (_image != nil)
286 | {
287 | [_context drawImage:_image inRect:rr fromRect:rr];
288 | } else {
289 | assert(!"WTF");
290 | }
291 |
292 | glDisable (GL_SCISSOR_TEST);
293 |
294 | /* Flush the OpenGL command stream. If the view is double
295 | * buffered this should be replaced by [[self openGLContext]
296 | * flushBuffer]. */
297 |
298 | glFlush ();
299 | }
300 | else
301 | {
302 | /* Printing the view contents. Render using CG, not OpenGL. */
303 |
304 | if ([self respondsToSelector:@selector (drawRect:inCIContext:)])
305 | {
306 | [self drawRect:*(NSRect *)&ir inCIContext:_context];
307 | }
308 | else if (_image != nil)
309 | {
310 | cgImage = [_context createCGImage:_image fromRect:ir format:kCIFormatRGBA16 colorSpace:nil];
311 |
312 | if (cgImage != NULL)
313 | {
314 | CGContextDrawImage ([printingContext CGContext], ir, cgImage);
315 | CGImageRelease (cgImage);
316 | }
317 | }
318 | }
319 | }
320 |
321 | @end
322 |
--------------------------------------------------------------------------------
/FunHouse/colormap.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/colormap.tiff
--------------------------------------------------------------------------------
/FunHouse/document.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/document.icns
--------------------------------------------------------------------------------
/FunHouse/en.lproj/Credits.rtf:
--------------------------------------------------------------------------------
1 | {\rtf1\ansi\ansicpg1252\cocoartf949
2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
3 | {\colortbl;\red255\green255\blue255;}
4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
5 |
6 | \f0\fs24 \cf0 Have fun with your images.\
7 | \
8 | Test your Image Units.\
9 | \
10 | Featuring Mac OS X Core Image technology.\
11 | }
--------------------------------------------------------------------------------
/FunHouse/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/en.lproj/InfoPlist.strings
--------------------------------------------------------------------------------
/FunHouse/lightball.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/lightball.tiff
--------------------------------------------------------------------------------
/FunHouse/main.m:
--------------------------------------------------------------------------------
1 | /*
2 | File: main.m
3 | Abstract: n/a
4 | Version: 2.1
5 |
6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
7 | Inc. ("Apple") in consideration of your agreement to the following
8 | terms, and your use, installation, modification or redistribution of
9 | this Apple software constitutes acceptance of these terms. If you do
10 | not agree with these terms, please do not use, install, modify or
11 | redistribute this Apple software.
12 |
13 | In consideration of your agreement to abide by the following terms, and
14 | subject to these terms, Apple grants you a personal, non-exclusive
15 | license, under Apple's copyrights in this original Apple software (the
16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple
17 | Software, with or without modifications, in source and/or binary forms;
18 | provided that if you redistribute the Apple Software in its entirety and
19 | without modifications, you must retain this notice and the following
20 | text and disclaimers in all such redistributions of the Apple Software.
21 | Neither the name, trademarks, service marks or logos of Apple Inc. may
22 | be used to endorse or promote products derived from the Apple Software
23 | without specific prior written permission from Apple. Except as
24 | expressly stated in this notice, no other rights or licenses, express or
25 | implied, are granted by Apple herein, including but not limited to any
26 | patent rights that may be infringed by your derivative works or by other
27 | works in which the Apple Software may be incorporated.
28 |
29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE
30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
34 |
35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
42 | POSSIBILITY OF SUCH DAMAGE.
43 |
44 | Copyright (C) 2014 Apple Inc. All Rights Reserved.
45 |
46 | */
47 |
48 | #import
49 |
50 | int main(int argc, char *argv[])
51 | {
52 | return NSApplicationMain(argc, (const char **) argv);
53 | }
54 |
--------------------------------------------------------------------------------
/FunHouse/mask.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/mask.tiff
--------------------------------------------------------------------------------
/FunHouse/minusbutton.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/minusbutton.tiff
--------------------------------------------------------------------------------
/FunHouse/playbutton.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/playbutton.tiff
--------------------------------------------------------------------------------
/FunHouse/plusbutton.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/plusbutton.tiff
--------------------------------------------------------------------------------
/FunHouse/restrictedshine.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/restrictedshine.tiff
--------------------------------------------------------------------------------
/FunHouse/smoothtexture.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhoerl/CoreImageFunHouse/a430df4d13861323b39eff862e352f5f112b2f67/FunHouse/smoothtexture.tiff
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 David Hoerl
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CoreImageFunHouse
2 | Update of Apple's Core Image Fun House (FunHouse)
3 |
4 | Apple's "Core Image Fun House" hasn't been updated since 2014. Not only does it use the deprecated OpenGL (as of Catalina), but it doesn't even use ARC! The app still builds and runs using Xcode 9, but in Xcode 10 Apple made the NSOpenGLView use an OpenGL layer, and so it crashes or does nothing when built with Xcode 10 or newer.
5 |
6 | The goals of this project are to:
7 | - get the project to build and run on Xcode 11 / Catalina
8 | - convert the Objective C code to ARC
9 | - convert the instance variables to properties
10 | - migrate from using OpenGL to Metal
11 | - convert the source code into Swift
12 |
13 | As a first step, the original commit of the source will use the exact files that Apple supplied in the 2014 zip file:
14 | https://developer.apple.com/library/archive/samplecode/FunHouse/Introduction/Intro.html
15 |
16 | NOTE: I finally got it to (somewhat) work in Catalina - with a significant amount of effort
17 |
--------------------------------------------------------------------------------