colour lib

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 31 07:07:07 PDT 2016


On Wed, 31 Aug 2016 19:33:24 +1000, Manu via Digitalmars-d wrote:
> On 31 August 2016 at 17:58, Andrea Fontana via Digitalmars-d
>> I always think the perfect colour library should work using a superset
>> of all colour spaces, for example cie xyz (is it a superset, isn't
>> it?). isColour(T) then IMO should check if x,y,z properties exists (or
>> toXYZ() method).
> 
> Yeah... that would be wickedly slow.

That depends on how often you incur the conversion cost. If you're 
storing your whole image in your custom color type and converting to read 
every pixel, that's not so great. If you have an existing image with one 
colorspace and a user wants to add text in a color defined in a different 
colorspace, you only need to convert once, after the user uses the color 
picker.

If you have two images that you want to combine and they're using 
different colorspaces, you must incur that cost anyway, and the image 
library should support that. The color library shouldn't put up barriers.


More information about the Digitalmars-d mailing list