On Mon, Nov 25, 2024 at 12:43 PM Niklas Haas <ffm...@haasn.xyz> wrote:

> On Mon, 25 Nov 2024 14:16:19 +0100 Niklas Haas <ffm...@haasn.xyz> wrote:
> > From: Niklas Haas <g...@haasn.dev>
>

<snip>


> >  av_csp_trc_function av_csp_trc_func_inv_from_id(enum
> AVColorTransferCharacteristic trc);
> >
> > +/**
> > + * Struct encapsulating a color in an arbitrary three-component
> colorspace.
> > + * This is typically RGB, but may also be e.g. CIE XYZ.
> > + */
> > +typedef struct AVColor {
> > +    double c[3];
> > +} AVColor;
> > +
> > +static inline AVColor av_color(double x, double y, double z)
> > +{
> > +    return (AVColor) {{ x, y, z }};
> > +}
>
> I'd appreciate suggestions on a better name, or another way to handle this.
> I'm not fond of the idea of functions that mutate a double[3] in place, but
> that might be the way to go if we want to avoid this awkward struct.
>

This looks a lot like a generic 3D vector ... and a constructor for it.
Why not use something more generic like av_vec3d_t, or AVVec3D ... if there
isn't a type like this already.

I personally use v3x1_t to represent xyY, XYZ
https://github.com/pkoshevoy/aeyae/blob/master/yae/video/yae_colorspace.h
https://github.com/pkoshevoy/aeyae/blob/master/yae/utils/yae_linear_algebra.h
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to