Permalink
Browse files

Quick note to self.

  • Loading branch information...
1 parent 3dec7ec commit 87fe69c1cbd846676f8399b9787f91ed2ebb3b7f @ccgus committed Aug 25, 2013
Showing with 28 additions and 1 deletion.
  1. +1 −1 plugins/imagetools/JSTOpenCLProgram.m
  2. +27 −0 plugins/imagetools/JSTQuickCIFilter.m
@@ -224,7 +224,7 @@ - (id)initWithContext:(JSTOpenCLContext*)theContext width:(size_t)w height:(size
imageDescription.image_height = _height;
imageDescription.image_array_size = 1;
imageDescription.image_row_pitch = _bytesPerRow;
- imageDescription.image_slice_pitch = 0; //_height;
+ imageDescription.image_slice_pitch = _height;
imageDescription.num_mip_levels = 0;
imageDescription.num_samples = 0;
imageDescription.image_depth = 0;
@@ -8,6 +8,33 @@
#import "JSTQuickCIFilter.h"
+#pragma message "FIXME: Gus- you can get CI kernel errors like so: http://stackoverflow.com/questions/13754997/how-do-you-debug-syntax-errors-in-a-core-image-kernel"
+/*
+ If you use introspection on the CIKernel class, you will find a kernelsWithString:messageLog: method. There is no public interface to it, but don't let that stop you…
+
+ NSString *myCode = ...
+ NSMutableArray *messageLog = [NSMutableArray array];
+ NSArray *kernels = [[CIKernel class] performSelector:@selector(kernelsWithString:messageLog:) withObject:myCode withObject:messageLog];
+ if ( messageLog.count > 0) NSLog(@"Error: %@", messageLog.description);
+ The messageLog argument wants to be a mutable array. In the event of errors, it will have some dictionaries put into it. The contents of these are documented nowhere visible on the internet, but they look something like this (in a case where I added "gratuitous error" to a kernel's source)…
+
+ 2012-12-06 17:56:53.077 MyProgram[14334:303] Error: (
+ {
+ CIKernelMessageDescription = "kernel vec4 clipDetection (uniform in sampler, uniform in float)";
+ CIKernelMessageLineNumber = 8;
+ CIKernelMessageType = CIKernelMessageTypeFunctionName;
+ },
+ {
+ CIKernelMessageDescription = "unknown variable name: gratuitous";
+ CIKernelMessageLineNumber = 8;
+ CIKernelMessageType = CIKernelMessageTypeError;
+ }
+ )
+ As always, think twice or more about leaving this in shipping code. It is undocumented and Apple could do anything to it at any time. They might even, you know, document it.
+
+
+ */
+
@implementation JSTQuickCIFilter
+ (id)quickFilterWithKernel:(NSString*)kernel {

0 comments on commit 87fe69c

Please sign in to comment.