WICG / canvas-color-space

Proposed web platform feature to add color management, wide gamut and high bit-depth support to the <canvas> element.
Other
78 stars 19 forks source link

More convenient pixel format strings #13

Open annevk opened 7 years ago

annevk commented 7 years ago

"10-10-10-2" doesn't seem great. Are there no names for this kind of thing we could use?

junov commented 7 years ago

OpenGL uses this notation: RGB10_A2

annevk commented 7 years ago

Converted to a string enum that would be "rgb10-a2", which seems more reasonable to me.

yellowdoge commented 5 years ago

It was indeed surprising to see float16, 8-8-8-8 (and, in the WhatWG Spec PR, 10-10-10-2). I guess the idea of avoiding OpenGL's Sized Internal Format (GL_RGBA16F, GL_RGBA8 and GL_RGB10_A2, respectively), is to not specify the channel endianness and using instead what the platform provides.

Alternatively, what we can do is to use OpenGL's Type which will give us: GL_UNSIGNED_BYTE, GL_UNSIGNED_INT_2_10_10_10_REV and GL_HALF_FLOAT, specifying the storage of the channels but leaving the channels undefined.

@fserb WDYT?

OpenGL's relevant Spec is glTexImage2D, see the Table 2 here.

yellowdoge commented 5 years ago

I see now that 10-10-10-2 (and 12-12-12-12, for the case) were removed in #22 in an effort to simplify the options offered.