Mailing Lists: Apple Mailing Lists

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

Re: Compositing issues with output from Quartz Patch



You can try the following code to get the name of the ICC profile, just in case that's the problem (taken from some Apple sample):

- (NSString *)CMProfileDescription
{
	CMProfileRef prof = [self colorSyncProfile];
	if (!prof) return nil;
	
    Str255			name;
    ScriptCode		code;
	CFStringRef		str = nil;
    CMError			err;


// for v4 profiles, try to get the best localized name from the 'desc'/'mluc' tag
err = CMCopyProfileLocalizedString(prof, cmProfileDescriptionTag, 0,0, &str);
// if that didn't work...
if (err != noErr)
{
// for Apple's localized v2 profiles, try to get the best localized name from the 'dscm'/'mluc' tag
err = CMCopyProfileLocalizedString(prof, cmProfileDescriptionMLTag, 0,0, &str);
// if that didn't work...
if (err != noErr)
{
// for normal v2 profiles, get the name from the 'desc'/'desc' tag
err = CMGetScriptProfileDescription( prof, name, &code);
// convert it to a CFString
if (err == noErr)
{
str = CFStringCreateWithPascalString(0, name, code);
}
}
}
return [(NSString *)str autorelease];
}




To get the colorspace of a window I've been using the following code:

@implementation NSWindow ( NSWindowExtensions )

- (CGDirectDisplayID)windowDisplayID
{
return (CGDirectDisplayID)[[[[self screen] deviceDescription] objectForKey:@"NSScreenNumber"] longValue];
}


- (NSColorSpace *)windowColorSpace
{
CMProfileRef profile = NULL;
NSColorSpace *colorspace = nil;

if (CMGetProfileByAVID((CMDisplayIDType)[self windowDisplayID], &profile) == noErr)
{
colorspace = [[NSColorSpace alloc] initWithColorSyncProfile:profile];
CMCloseProfile(profile);
}


	return [colorspace autorelease];
}

@end

HTH
mark


On 14.03.2008, at 09:00, Neil Clayton wrote:
Hello Everbodeeee,

I've a simple patch, with a single image input, an affine transform (that flips the image) to a clear and billboard (width 2).
Effectively, because the source image is upside down (coming from OpenGL) this patch just flips it. The idea is that I pass in a 128x128 image around the mouse cursor, and then replace what I took with the content of the patch - therefore being able to animate (and generally mess with) the content under the mouse at any time.


On Leopard it renders just fine.

However on Tiger it's as if the gamma has been bumped up hugely. It's not quite white, but close. You can still make out the fact that the image contains the right stuff, it's just the colors are way off.

When compositing, I'm setting up my color spaces using :

+ (CGColorSpaceRef) currentColorSpace {
	CMProfileRef current = nil;
	CGColorSpaceRef cSpace = nil;
	CMError error = CMGetSystemProfile(&current);
	if(error == 0) {
		cSpace = CGColorSpaceCreateWithPlatformColorSpace(current);
	} else {
		[self log:@"Can't get system profile color space, %lf", error];
	}
	
	if(cSpace == 0) {
		cSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
	}
	return cSpace;
}

The idea being that I want to use the color space setup by the user.
All of my bitmap context creation uses the same color space (well, they all end up calling this method to get one - they don't share the same ref).


I've got a whole lot more I could write about creation of pixel buffers (and their color spaces), etc - but I don't want to cloud this first question with too much stuff.


Is there anything I should look for here - that's Tiger specific?

I'm at a bit of a loss! Primarily because it works so well on Leopard.

--
Regards,
Neil Clayton,  http://shinywhitebox.com







_______________________________________________
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

_______________________________________________ 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
References: 
 >Compositing issues with output from Quartz Patch (From: Neil Clayton <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.