Closed ccameron-chromium closed 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.
Format
is ok thoughEncoding
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.
Thanks all!
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).