X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Frgba.cc;h=2e6a4fab632aa6e64c251fba52ac51f899d44dc0;hb=53d0a9a844841fe10b2720543c032a687c548108;hp=1076af4335574a65c165cdbe81415cb8cfe073bc;hpb=2da4caba7871455c097c0ed940dd6f2332dbda5d;p=dcpomatic.git diff --git a/src/lib/rgba.cc b/src/lib/rgba.cc index 1076af433..2e6a4fab6 100644 --- a/src/lib/rgba.cc +++ b/src/lib/rgba.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 Carl Hetherington + Copyright (C) 2016-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,33 +18,38 @@ */ + #include "rgba.h" -#include "warnings.h" -DCPOMATIC_DISABLE_WARNINGS +#include +LIBDCP_DISABLE_WARNINGS #include -DCPOMATIC_ENABLE_WARNINGS +LIBDCP_ENABLE_WARNINGS #include + using std::string; using boost::lexical_cast; + RGBA::RGBA (cxml::ConstNodePtr node) { - r = node->number_child ("R"); - g = node->number_child ("G"); - b = node->number_child ("B"); - a = node->number_child ("A"); + r = node->number_child("R"); + g = node->number_child("G"); + b = node->number_child("B"); + a = node->number_child("A"); } + void RGBA::as_xml (xmlpp::Node* parent) const { - parent->add_child("R")->add_child_text (lexical_cast (int (r))); - parent->add_child("G")->add_child_text (lexical_cast (int (g))); - parent->add_child("B")->add_child_text (lexical_cast (int (b))); - parent->add_child("A")->add_child_text (lexical_cast (int (a))); + parent->add_child("R")->add_child_text(lexical_cast(int(r))); + parent->add_child("G")->add_child_text(lexical_cast(int(g))); + parent->add_child("B")->add_child_text(lexical_cast(int(b))); + parent->add_child("A")->add_child_text(lexical_cast(int(a))); } + bool RGBA::operator< (RGBA const & other) const {