The implementation takes the form a a very simple C plugin, source is available on request. It can certainly be improved much, for example I use jas_image_readcmptsample 3 times for every pixel.
Please advise if you have ideas for performance or feature improvements.
UPDATE: it is now much faster using jas_image_readcmpt on whole image width...