Closed virtualritz closed 4 months ago
In your code you can rename these types with use … as
or type
, either at the root of your crate or a custom prelude module.
The channel type is generic, so you should be able to use it with f16
already.
Renaming types in this crate would be too disruptive for users, and I don't think it's worth the hassle. RGB
is a much more common name used in the industry, which is bigger than Rust, and Rust's convention doesn't improve anything here.
I never understand the "hassle" argument for renames, something that takes a few seconds to do in a modern IDE, if you maintain a dependent crate.
And the versioning in Cargo.toml
then makes sure the right rgb
crate gets referenced.
I.e. if this was C/C++, fair enough. But in Rust this argument simply does not hold water.
Anyway, you are the maintainer. As the Brits would say: I hear you. :wink:
Naming of structs in this crate doesn't follow Rust naming conventions.
I.e.
RGB
should beRgb
,RGBA
should beRgba
.Type aliases should have the type prefix too. I.e.
RGB8
should beRgbU8
.Finally, in visual effects, most image data is
f16
orf32
. It would be noice to have these as aliases.The
f16
ones would be behind ahalf
feature gate that pulls in the resp. crate.Available type aliases would then be:
RgbU8
RgbaU8
RgbU16
RgbaU16
RgbF16
RgbaF16
RgbF32
RgbaF32