X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=ycbcr.h;fp=ycbcr.h;h=1c55c3976f579255f0c8115fee16f9fb14d8d64f;hp=6f9f4c9d3ac6b25e880c2931e439c3549688694e;hb=f44c81569a268efea44f1f6df03a000711b18ffc;hpb=06b6e60952d58b700fa95be16496cc9c2a1af346 diff --git a/ycbcr.h b/ycbcr.h index 6f9f4c9..1c55c39 100644 --- a/ycbcr.h +++ b/ycbcr.h @@ -39,6 +39,7 @@ #include "image_format.h" +#include #include namespace movit { @@ -75,7 +76,13 @@ float compute_chroma_offset(float pos, unsigned subsampling_factor, unsigned res // Given , compute the values needed to turn Y'CbCr into R'G'B'; // first subtract the returned offset, then left-multiply the returned matrix // (the scaling is already folded into it). -void compute_ycbcr_matrix(YCbCrFormat ycbcr_format, float *offset, Eigen::Matrix3d *ycbcr_to_rgb); +// +// is the data type you're rendering from; normally, it would should match +// , but for the special case of 10- and 12-bit Y'CbCr, +// we support storing it in 16-bit formats, which incurs extra scaling factors. +// You can get that scaling factor in if you want. +void compute_ycbcr_matrix(YCbCrFormat ycbcr_format, float *offset, Eigen::Matrix3d *ycbcr_to_rgb, + GLenum type = GL_UNSIGNED_BYTE, double *scale_factor = NULL); } // namespace movit