Hello,
const Channel = std.meta.FieldEnum(zigimg.color.Rgb24);
fn f(
in: *const zigimg.Image,
out: *zigimg.Image,
buf: []i16,
comptime channel: Channel,
) void {
const col = comptime @tagName(channel);
...
Is my code. I really don’t understand, why I get this compile error, though:
src/main.zig:207:35: error: expected enum or union; found 'type'
const col = comptime @tagName(channel);
When removing the comptime keyword in from of channel, I get a normal compile error telling me that the compiler is unable to resolve the value at comptime. I really dont wanna make a big inline else but current I don’t see an alternative.
I have tried using different “channel selector types”, a plain enum { a, b, c } or a ´´u2´´ which I later convert to a comptime string still end up being a type for some reason.