• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Binding to CoreImage?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding to CoreImage?


  • Subject: Re: Binding to CoreImage?
  • From: Colin Cornaby <email@hidden>
  • Date: Fri, 21 Oct 2005 22:41:21 -0700

Here is the code that creates the filter.


CIFilter *filterToAdd = [CIFilter filterWithName:[availableCIFilters objectAtIndex:[rowIndexes firstIndex]]];
//This calls an init function which triggers the previously posted code that creates the view
NSView * contentView = [[WMLCoreImageFilterView alloc] initWithFilter:filterToAdd];
lastFilterObject=filterToAdd;


Here is the drawing code:

-(IBAction)display:(id)sender
{
CIImage *result;
NSImage *image;
NSCIImageRep *ir;
NSLog([lastFilterObject description]);
result = [lastFilterObject valueForKey:@"outputImage"];
ir = [NSCIImageRep imageRepWithCIImage:result];
image = [[[NSImage alloc] initWithSize:
NSMakeSize([result extent].size.width, [result extent].size.height)]
autorelease];
[image addRepresentation:ir];
[sImageView setImage:image];
}


So it should be the same instance across the board.

No suspicious messages in the console. I'll take a good look tonight and make sure the instances match. So far eyeballing it everything looks fine.

-Colin

On Oct 21, 2005, at 6:11 PM, Troy Stephens wrote:

Your bind:... message send looks fine. Are you certain you're binding to the same CIFilter instance whose state you're logging? (Probably so, but worth asking.)

Do any suspicious messages appear in the console?

Troy

On Oct 21, 2005, at 4:27 PM, Colin Cornaby wrote:

The redrawn image is unaltered, and when I get a description the filter is still at their default value. I don't actually have observer code present yet, I just have a button set up to manually redraw. On the manual redraw, it prints out a description of the filter it's trying to draw. I throw the slider around and I always get for the description:

2005-10-21 15:59:23.268 Catalyst[7243] {CIHueAdjust {inputAngle = 0; inputImage = {CIImage [0 0 22 26]}; }}
2005-10-21 15:59:23.438 Catalyst[7243] {CIHueAdjust {inputAngle = 0; inputImage = {CIImage [0 0 22 26]}; }}
2005-10-21 15:59:23.640 Catalyst[7243] {CIHueAdjust {inputAngle = 0; inputImage = {CIImage [0 0 22 26]}; }}
2005-10-21 15:59:24.348 Catalyst[7243] {CIHueAdjust {inputAngle = 0; inputImage = {CIImage [0 0 22 26]}; }}
2005-10-21 15:59:24.528 Catalyst[7243] {CIHueAdjust {inputAngle = 0; inputImage = {CIImage [0 0 22 26]}; }}
2005-10-21 15:59:24.708 Catalyst[7243] {CIHueAdjust {inputAngle = 0; inputImage = {CIImage [0 0 22 26]}; }}


The key that I am trying to bind to is "inputAngle" but inputAngle is never changing. The binding code with the variables substituted in is something like:

[newSlider bind:@"value" toObject:(CIHueAdjust here) withKeyPath:@"inputAngle" options:bindingOptions];

-Colin

On Oct 21, 2005, at 3:18 PM, Troy Stephens wrote:


This looks like it should work as written. I have some very similar code in a project that works fine. In what sense is this broken? Is it a matter of your image display not refreshing when you move one of the sliders, or are you seeing the corresponding attribute unchanged when you read its value back from the filter?

One thing to be sure to do (which might be in code you elided below) is set the min and max values of the slider to be compatible with the attribute's recommended range (kCIAttributeSliderMin to kCIAttributeSliderMax).

Troy


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Binding to CoreImage? (From: Colin Cornaby <email@hidden>)
 >Re: Binding to CoreImage? (From: Troy Stephens <email@hidden>)
 >Re: Binding to CoreImage? (From: Colin Cornaby <email@hidden>)
 >Re: Binding to CoreImage? (From: Troy Stephens <email@hidden>)
 >Re: Binding to CoreImage? (From: Colin Cornaby <email@hidden>)
 >Re: Binding to CoreImage? (From: Troy Stephens <email@hidden>)

  • Prev by Date: How to recognize/identify the DVD media?
  • Next by Date: Re: NSTextField delegate how to?
  • Previous by thread: Re: Binding to CoreImage?
  • Next by thread: Re: Binding to CoreImage?
  • Index(es):
    • Date
    • Thread