PistonDevelopers / texture

A library for texture conventions
MIT License
7 stars 4 forks source link

Color spaces (sRGB etc.) #43

Open bvssvni opened 8 years ago

bvssvni commented 8 years ago

This library is intended for 2D textures where choice of color space is implemented by graphics backends. The Format enum describes the memory layout used to create and update textures. Therefore, Format::Rgba8 describes channels and bits, but no color space information.

The most common format used in image editors, cameras etc. is sRGB. Since this is supported by shader pipelines on most modern hardware, it is intended to be the default behavior for Piston 2D graphics backends.

Therefore, unless a backend specifies otherwise, the color space is assumed to be sRGB.

This is based on the following assumptions:

btbouwens commented 5 years ago

I see several example programs where Texture's are used to display images, and the images I'm working with are typically 8 or 16 bit monochrome, so having only Rgba8 as a possible Format feels somewhat restrictive. Being a total Rust noob I probably underestimate the complexity of generalisation to multiple formats.