Re: Converting colorspace of a CGColor

2015-04-05 Thread Richard Charles

 On Apr 4, 2015, at 7:08 PM, Kyle Sluder k...@ksluder.com wrote:
 
 The ColorSync API has been deprecated on OS X since 10.6, and has never 
 existed on iOS.

Sorry if these questions are dumb but I am dumfounded.

In looking at the ColorSync Manager Reference about half of the API has been 
depreciated but only half.

https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/ColorSync_Manager/index.html

Why isn’t the whole API depreciated?

Also if the ColorSync API has been deprecated what does the ColorSync Utility 
application that ships with OS X Yosemite use?

--Richard Charles


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Converting colorspace of a CGColor

2015-04-04 Thread edward m taffel


Sent from my iPhone

 On Apr 3, 2015, at 10:19 PM, Graham Cox graham@bigpond.com wrote:
 
 
 On 4 Apr 2015, at 1:13 pm, Roland King r...@rols.org wrote:
 
 That’s most definitely not what Graham is looking for. He’s looking for a 
 way to convert colours programatically, and cross-platform iOS and OSX (no 
 colorsync on iOS).

I meant the ColorSync api (what did you think I meant?) but was not aware iOS 
did not rely on ColorSync,

if you had not already done so, you might look at:
https://developer.apple.com/library/ios/technotes/tn2313/_index.html#//apple_ref/doc/uid/DTS40014694-CH1-ACTIVECOLORMGMTCOLORSYNC-HOW_DOES_COLORSYNC_WORK_

 That's right. In short, a CG equivalent to -[NSColor colorUsingColorspace:] 
 is what I need

why don't you just use cocoa?

 - I just need to ensure that colours that could originate as grays for 
 example, end up as RGBA colours, since I'm doing work directly on the four 
 components. Converting gray is easy enough actually, if I have to do that 
 myself, but it would be nice if there were a funciton that would work across 
 all possible colorspaces.
 
 I thought Id' seen a CG function for this in the past, but I can't remember 
 where I saw it and I may be mistaken.
 
 --Graham
 
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/etaffel%40me.com
 
 This email sent to etaf...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Converting colorspace of a CGColor

2015-04-04 Thread Kyle Sluder
On Sat, Apr 4, 2015, at 03:13 AM, edward m taffel wrote:
 I meant the ColorSync api (what did you think I meant?) but was not aware
 iOS did not rely on ColorSync,

The ColorSync API has been deprecated on OS X since 10.6, and has never
existed on iOS.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Converting colorspace of a CGColor

2015-04-04 Thread edward m taffel


Sent from my iPhone

 On Apr 4, 2015, at 9:08 PM, Kyle Sluder k...@ksluder.com wrote:
 
 On Sat, Apr 4, 2015, at 03:13 AM, edward m taffel wrote:
 I meant the ColorSync api (what did you think I meant?) but was not aware
 iOS did not rely on ColorSync,
 
 The ColorSync API has been deprecated on OS X since 10.6, and has never
 existed on iOS.
 
 --Kyle Slude

there is a newer version which has been available since then [how should it be 
otherwise?]: please see the headers.

perhaps I was unclear: if a «conversion» is desired,  by this I mean a 
conversion performed by a cmm, one must set it up  submit it. on OS X this is 
via the ColorSync api. i surmise the iOS cmm is the same, or a lighter weight 
version, of the OS X cmm [if anyone knows more please enlighten us]. unless 
there is published api for negotiating the OS X cmm, one must write requisite 
code to perform the conversion or
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/etaffel%40me.com
 
 This email sent to etaf...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Converting colorspace of a CGColor

2015-04-04 Thread Graham Cox

 On 5 Apr 2015, at 12:19 pm, edward m taffel etaf...@me.com wrote:
 
 perhaps I was unclear: if a «conversion» is desired,  by this I mean a 
 conversion performed by a cmm


That isn't quite what I meant by conversion, though it may well end up doing 
what I want, at least on the Mac.

What I mean is that in order to do some calculations on a colour, I need them 
to be normalised to a 4-component RGBA format. So If I have a CGColorRef that 
is in the grayscale colorspace for example, I convert it to RGBA. (for gray 
that's trivial). For a color in the CMYK colorspace, that's not quite so 
trivial. But of course converting between colours that are calibrated to a 
particular CMM is going much further than that, and I'm not really needing that 
(it would probably be the right thing to do in a calibrated colour environment, 
but since that's not what exists on iOS, I'm compromising in that results on 
the Mac would not preserve a particular calibration).


Going back a step, I saw this in the documentation for 
CGGradientCreateWithColors():

 
 colors
 A non-empty array of CGColor objects that should be in the color space 
 specified by space. If space is not NULL, each color will be converted (if 
 necessary) to that color space and the gradient will drawn in that color 
 space. Otherwise, each color will be converted to and drawn in the GenericRGB 
 color space.

This led me to believe that there existed, within the Core Graphics API, a way 
to perform such a conversion. I also thought I'd recollected seeing one, though 
I can't recall what code I was working on at the time to find out what I did 
there. This is available in iOS, so it suggested there is a color conversion 
API somewhere there. It does also specifically exclude indexed or pattern 
colorspaces, but that's OK for my needs anyway.

It will probably suffice to comment my code such that it's clear that passing 
in any old CGColorRef is not good enough - it has to match the RGBA colorspace 
I use (and I can assert that). But ideally it would accept any color and 
convert it as needed exactly as CGGradient says it does.

--Graham





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Converting colorspace of a CGColor—part 2

2015-04-04 Thread edward m taffel


Sent from my iPhone

 On Apr 4, 2015, at 9:08 PM, Kyle Sluder k...@ksluder.com wrote:
 
 On Sat, Apr 4, 2015, at 03:13 AM, edward m taffel wrote:
 I meant the ColorSync api (what did you think I meant?) but was not aware
 iOS did not rely on ColorSync,
 
 The ColorSync API has been deprecated on OS X since 10.6, and has never
 existed on iOS.

or link a 3rd party cmm.

so, what I meant was: conditionally compile for platform using nscolor on OS X, 
as you get it for free,  do what you have to on iOS. to use CGColor one must 
still conditionally compile the conversion based on platform:


 
 --Kyle Sluder
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/etaffel%40me.com
 
 This email sent to etaf...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Converting colorspace of a CGColor

2015-04-04 Thread Graham Cox

 On 4 Apr 2015, at 8:13 pm, edward m taffel etaf...@me.com wrote:
 
 why don't you just use cocoa?


because NSColor isn't available on iOS. Do keep up...

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Converting colorspace of a CGColor

2015-04-03 Thread Graham Cox

 On 4 Apr 2015, at 1:13 pm, Roland King r...@rols.org wrote:
 
 That’s most definitely not what Graham is looking for. He’s looking for a way 
 to convert colours programatically, and cross-platform iOS and OSX (no 
 colorsync on iOS). 


That's right. In short, a CG equivalent to -[NSColor colorUsingColorspace:] is 
what I need - I just need to ensure that colours that could originate as grays 
for example, end up as RGBA colours, since I'm doing work directly on the four 
components. Converting gray is easy enough actually, if I have to do that 
myself, but it would be nice if there were a funciton that would work across 
all possible colorspaces.

I thought Id' seen a CG function for this in the past, but I can't remember 
where I saw it and I may be mistaken.

--Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Converting colorspace of a CGColor

2015-04-03 Thread edward m taffel
use ColorSync.

Sent from my iPhone

 On Apr 3, 2015, at 8:35 PM, Graham Cox graham@bigpond.com wrote:
 
 Is there a way to convert a CGColor to a different colorspace? It's trivial 
 with NSColor, but I want to do the same at the lower CG level to keep the 
 code as portable as possible between iOS and Mac. I'm sure I've done this in 
 the past but I'm just not seeing the right function!
 
 --Graham
 
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/etaffel%40me.com
 
 This email sent to etaf...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Converting colorspace of a CGColor

2015-04-03 Thread Roland King

 On 4 Apr 2015, at 9:38 am, edward m taffel etaf...@me.com wrote:
 
 use ColorSync.
 

That’s most definitely not what Graham is looking for. He’s looking for a way 
to convert colours programatically, and cross-platform iOS and OSX (no 
colorsync on iOS). 

I just looked in my library of bits and pieces and found some code which write 
into a bitmap and reads it out again. I don’t even know when I wrote that, and 
it’s not used in any of my projects, but I believe that was me converting 
colours at low-level. 

Surely there’s a better way (but then again I said ‘surely there is a better 
way’ when I saw the discussion on whitespace in swift and there hasn’t been one 
yet). 

 Sent from my iPhone
 
 On Apr 3, 2015, at 8:35 PM, Graham Cox graham@bigpond.com wrote:
 
 Is there a way to convert a CGColor to a different colorspace? It's trivial 
 with NSColor, but I want to do the same at the lower CG level to keep the 
 code as portable as possible between iOS and Mac. I'm sure I've done this in 
 the past but I'm just not seeing the right function!
 
 --Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com