[whatwg] Canvas feedback

Ian Hickson ian at hixie.ch
Tue Apr 28 16:06:53 PDT 2009


On Thu, 26 Mar 2009, Biju wrote:
> On Wed, Mar 25, 2009 at 3:11 AM, Ian Hickson <ian at hixie.ch> wrote:
> > On Sat, 14 Mar 2009, Biju wrote:
> >>
> >> Just like canvas.getImageData() and canvas.putImageData()
> >>
> >> Why canvas.getImageHSLData() and canvas.putImageHSLData() API are not 
> >> provide? Is it something discussed and planned not have?
> >
> > In practice user agents actually store image data as memory buffers of 
> > RGBA data, so handling RGBA data is (or at least can be) extremely 
> > efficient. HSLA data is not a native type, so it would be an 
> > inefficient type to provide native access to.
> >
> > In practice, if you need to work in the HSLA space, then you should 
> > convert the data to HSLA and back manually, which would highlight the 
> > performance bottleneck implied in such an approach. Alternatively, 
> > convert whatever algorithms you are using to work in the RGBA space.
>
> As in both case the will be performance hit. Isnt it better to take care 
> that in C/Compiled code rather than in JavaScript . code for converting 
> from HSLA to RGBA will be already there in the browser code so that need 
> to be only exposed to JavaScript

If we do that, then people will be more likely to use HSLA, which would be 
bad since using HSLA is not the optimal way of doing this.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list