The ieeehalfprecision.c file from the matlab package covers all possible
half values quickly and efficiently, using only type punning to integers,
bit comparisons (& and the like) and bit shifts.  The licence is BSD and
the api is super simple:

  int singles2halfp(void *target, void *source, int numel);
  int doubles2halfp(void *target, void *source, int numel);
  int halfp2singles(void *target, void *source, int numel);
  int halfp2doubles(void *target, void *source, int numel);

All you'd want to do is touch it up a bit to use your lcms's
cmsUInt16Number, cmsInt16Number, cmsUInt32Number and cmsInt32Number
typedefs instead of ieeehalfprecision.c's current UINT16_TYPE,
INT16_TYPE, UINT32_TYPE and INT32_TYPE typedefs.

You shouldn't need it to be a plugin, just a (new) part of the default api.

I can create a github fork and send a pull request of what I suggest if
you like.

-JimC
-- 
James Cloos <cl...@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to