1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

LibVideo: Set CodingIndependentCodePoints in its member functions

This moves the setting of code points in CICP structs to member
functions completely so that the code having to set these code points
can be much cleaner.
This commit is contained in:
Zaggy1024 2022-10-29 17:39:45 -05:00 committed by Andreas Kling
parent 074f771b59
commit 3720f66bb1
3 changed files with 42 additions and 27 deletions

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "LibVideo/Color/CodingIndependentCodePoints.h"
#include <LibCore/ArgsParser.h>
#include <LibCore/ElapsedTimer.h>
#include <LibGUI/Application.h>
@ -90,8 +91,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto frame = frame_result.release_value();
auto& cicp = frame->cicp();
video_track.color_format.replace_code_points_if_specified(cicp);
cicp.default_code_points_if_unspecified(Video::ColorPrimaries::BT709, Video::TransferCharacteristics::BT709, Video::MatrixCoefficients::BT709);
cicp.adopt_specified_values(video_track.color_format.to_cicp());
cicp.default_code_points_if_unspecified({ Video::ColorPrimaries::BT709, Video::TransferCharacteristics::BT709, Video::MatrixCoefficients::BT709, Video::ColorRange::Studio });
auto convert_result = frame->output_to_bitmap(image);
if (convert_result.is_error()) {