Sunshine latest
Self-hosted game stream host for Moonlight.
video_colorspace.cpp File Reference

Definitions for colorspace functions. More...

#include "video_colorspace.h"
#include "logging.h"
#include "video.h"
#include <libswscale/swscale.h>
Include dependency graph for video_colorspace.cpp:

Functions

avcodec_colorspace_t video::avcodec_colorspace_from_sunshine_colorspace (const sunshine_colorspace_t &sunshine_colorspace)
 
const color_tvideo::color_vectors_from_colorspace (colorspace_e colorspace, bool full_range)
 
const color_tvideo::color_vectors_from_colorspace (const sunshine_colorspace_t &colorspace)
 
sunshine_colorspace_t video::colorspace_from_client_config (const config_t &config, bool hdr_display)
 
bool video::colorspace_is_hdr (const sunshine_colorspace_t &colorspace)
 
const color_tvideo::new_color_vectors_from_colorspace (const sunshine_colorspace_t &colorspace)
 New version of color_vectors_from_colorspace() function that better adheres to the standards. Returned vectors are used to perform RGB->YUV conversion. Unlike its predecessor, color vectors will produce output in UINT range, not UNORM range. Input is still in UNORM range. Returned vectors won't modify color primaries and color transfer function.
 

Detailed Description

Definitions for colorspace functions.

Function Documentation

◆ new_color_vectors_from_colorspace()

const color_t * video::new_color_vectors_from_colorspace ( const sunshine_colorspace_t & colorspace)

New version of color_vectors_from_colorspace() function that better adheres to the standards. Returned vectors are used to perform RGB->YUV conversion. Unlike its predecessor, color vectors will produce output in UINT range, not UNORM range. Input is still in UNORM range. Returned vectors won't modify color primaries and color transfer function.

Parameters
colorspaceTargeted YUV colorspace.
Returns
const color_t* that contains RGB->YUV transformation vectors. Components range_y and range_uv are there for backwards compatibility and can be ignored in the computation.