libdisplay-info/include/info.h
Pekka Paalanen 85043a07d5 info: add di_info_get_default_color_primaries()
Add a high-level function to retrieve color primaries. Wayland
compositors will be interested in this.

A high-level function may later be extended to support stand-alone
DisplayID and other sources.

The high-level data is derived from low-level API calls in
di_info_parse_edid(). As we stash the results in struct di_info to avoid
requiring the callers to explicitly free the high-level structures, this
allows keeping struct di_info deeply const in high-level API
implementation. We also avoid some dynamic allocations.

https://github.com/linuxhw/EDID.git database contains 20399 samples for
which edid-decode complains:
  Basic Display Parameters & Features: sRGB is signaled, but the chromaticities do not match.

Therefore I assume that the sRGB flag is more correct when set.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-12 16:25:44 +03:00

26 lines
444 B
C

#ifndef INFO_H
#define INFO_H
/**
* Private header for the high-level API.
*/
#include <libdisplay-info/info.h>
/**
* All information here is derived from low-level information contained in
* struct di_info. These are exposed by the high-level API only.
*/
struct di_derived_info {
struct di_color_primaries color_primaries;
};
struct di_info {
struct di_edid *edid;
char *failure_msg;
struct di_derived_info derived;
};
#endif