shfty-elysian / elysian-legacy

Field function compiler
0 stars 0 forks source link

Generalize context -> color conversion #62

Closed Shfty closed 1 year ago

Shfty commented 1 year ago

Currently, conversion is strictly based on COLOR property (Vec4) -> RGBA, and all mappings from other properties to color are done on the shape side.

This is not ideal, as it forces RGBA as an intermediary, which introduces unneeded work for output formats that don't have 4 channels.

Need to come up with an abstraction that can extend the existing Field -> COLOR -> RGBA setup to allow Field -> DISTANCE -> Luma and similar.

Shfty commented 1 year ago

Done: Covered by the Struct -> Vec<P::Subpixel> conversion function used by rasterize.