Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with running texture-base CIImage through custom CIFilter




I've narrowed down a problem I'm having to the following:

	- CIImage built from a rectangle texture
	- Translate via -imageByApplyingTransform:
	- Run through a CIFilter that does nothing (looks up input, returns)
	- Transform again via CIAffineTransform.
	- render output to GL

When I render, my texture comes up in all manner of crazy permutations in my real app (which actually tries to do something in its filter :).

In the test app, they are a little tamer, but still hokey, even with a filter that is doing nothing.

If I skip my null filter, then all draws reasonably. If I use a non-texture based image, all is fine (say, from a CGLayer). The null filter in my test case looks like the following (full app source is at <http://people.omnigroup.com/bungi/CIImageFromTexture-20060529.zip>)

  Any hints on what I'm doing wrong would be very helpful.

-tim



@interface NullFilter : CIFilter
{
    CIImage *_inputImage;
}
@end

@implementation NullFilter

- (CIImage *)outputImage;
{
    static NSString *KernelSource =
    @"kernel vec4 null(sampler img)\n"
    @"{\n"
    @"  vec4 p = sample(img, samplerCoord(img));\n"
    @"  return p;\n"
    @"}\n";

    static CIKernel *k = nil;
    if (!k) {
	NSArray *kernels = [CIKernel kernelsWithString:KernelSource];
	NSLog(@"kernels = %@", kernels);
	
	k = [[kernels lastObject] retain];
    }

CISampler *src = [CISampler samplerWithImage:_inputImage];
return [self apply:k, src, kCIApplyOptionDefinition, [src definition], nil];
}


@end

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.