WICG / canvas-color-space

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

ImageDataStorageType renaming #46

Closed ccameron-chromium closed 3 years ago

ccameron-chromium commented 3 years ago

Rename ImageDataStorageType to ImageDataStorageFormat. This matches corresponding CanvasStorageFormat.

Also change uint8 and uint16 to unorm8 and unorm16. This matches CanvasStorageFormat names, and is also a better choice, because it is more descriptive, and doesn't preclude other uses of Uint16Array (e.g, for actual-unsigned-integer values, or for R5G6B5, or half-float).

ccameron-chromium commented 3 years ago

Having discussed this some more, the names "unorm8" and "unorm16" are definitely better than "uint8" and "uint16". And they match the canvas options. Also, having ImageDataStorageFormat align with CanvasStorageFormat is less surprising for users.

ccameron-chromium commented 3 years ago

Format is ok though Encoding might be better? This is fine to take though.

The term "format" is the more common term for this across the modern graphics APIs (e.g, VkFormat, DXGI_FORMAT, MTLPixelFormat), and also in OpenGL (the format and internal_format parameters).

The term "encoding" is used in the context of GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, which is a different, graphics-pipline-specific concept that we'll want to keep distinct.

ccameron-chromium commented 3 years ago

Thanks all!