summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-12-27 20:35:19 +0000
committerCarl Hetherington <cth@carlh.net>2014-12-27 20:35:19 +0000
commitd6633a73369339c419f33fb9d641f342826a3290 (patch)
tree7909203ea854f7039b62074004df92bec7aec796 /src
parent6f125b65d1bc0650735624d7ada17a2ff573cbc4 (diff)
Rename color -> colour.
Diffstat (limited to 'src')
-rw-r--r--src/colour_matrix.cc2
-rw-r--r--src/font.cc16
-rw-r--r--src/font.h4
-rw-r--r--src/interop_subtitle_content.cc16
-rw-r--r--src/subtitle_content.cc4
-rw-r--r--src/subtitle_string.cc16
-rw-r--r--src/subtitle_string.h16
-rw-r--r--src/types.cc32
-rw-r--r--src/types.h18
9 files changed, 62 insertions, 62 deletions
diff --git a/src/colour_matrix.cc b/src/colour_matrix.cc
index 72f952c3..1a997326 100644
--- a/src/colour_matrix.cc
+++ b/src/colour_matrix.cc
@@ -19,7 +19,7 @@
#include "colour_matrix.h"
-/* sRGB color matrix for XYZ -> RGB. This is the same as the one used by the Fraunhofer
+/* sRGB colour matrix for XYZ -> RGB. This is the same as the one used by the Fraunhofer
EasyDCP player, I think.
*/
diff --git a/src/font.cc b/src/font.cc
index f43e83df..99f49f90 100644
--- a/src/font.cc
+++ b/src/font.cc
@@ -39,7 +39,7 @@ Font::Font (boost::shared_ptr<const cxml::Node> node)
italic = node->optional_bool_attribute ("Italic");
optional<string> c = node->optional_string_attribute ("Color");
if (c) {
- color = Color (c.get ());
+ colour = Colour (c.get ());
}
optional<string> const e = node->optional_string_attribute ("Effect");
if (e) {
@@ -47,7 +47,7 @@ Font::Font (boost::shared_ptr<const cxml::Node> node)
}
c = node->optional_string_attribute ( "EffectColor");
if (c) {
- effect_color = Color (c.get ());
+ effect_colour = Colour (c.get ());
}
subtitle_nodes = type_children<Subtitle> (node, "Subtitle");
font_nodes = type_children<Font> (node, "Font");
@@ -57,8 +57,8 @@ Font::Font (boost::shared_ptr<const cxml::Node> node)
Font::Font (std::list<boost::shared_ptr<Font> > const & font_nodes)
: size (0)
, italic (false)
- , color ("FFFFFFFF")
- , effect_color ("FFFFFFFF")
+ , colour ("FFFFFFFF")
+ , effect_colour ("FFFFFFFF")
{
for (list<shared_ptr<Font> >::const_iterator i = font_nodes.begin(); i != font_nodes.end(); ++i) {
if ((*i)->id) {
@@ -70,14 +70,14 @@ Font::Font (std::list<boost::shared_ptr<Font> > const & font_nodes)
if ((*i)->italic) {
italic = (*i)->italic.get ();
}
- if ((*i)->color) {
- color = (*i)->color.get ();
+ if ((*i)->colour) {
+ colour = (*i)->colour.get ();
}
if ((*i)->effect) {
effect = (*i)->effect.get ();
}
- if ((*i)->effect_color) {
- effect_color = (*i)->effect_color.get ();
+ if ((*i)->effect_colour) {
+ effect_colour = (*i)->effect_colour.get ();
}
}
}
diff --git a/src/font.h b/src/font.h
index 979166cd..d5ea5636 100644
--- a/src/font.h
+++ b/src/font.h
@@ -50,9 +50,9 @@ public:
boost::optional<std::string> id;
int size;
boost::optional<bool> italic;
- boost::optional<Color> color;
+ boost::optional<Colour> colour;
boost::optional<Effect> effect;
- boost::optional<Color> effect_color;
+ boost::optional<Colour> effect_colour;
std::list<boost::shared_ptr<Subtitle> > subtitle_nodes;
std::list<boost::shared_ptr<Font> > font_nodes;
diff --git a/src/interop_subtitle_content.cc b/src/interop_subtitle_content.cc
index 0fdee0b4..09b30e99 100644
--- a/src/interop_subtitle_content.cc
+++ b/src/interop_subtitle_content.cc
@@ -86,10 +86,10 @@ InteropSubtitleContent::xml_as_string () const
optional<string> font;
bool italic = false;
- Color color;
+ Colour colour;
int size = 0;
Effect effect = NONE;
- Color effect_color;
+ Colour effect_colour;
int spot_number = 1;
Time last_in;
Time last_out;
@@ -109,18 +109,18 @@ InteropSubtitleContent::xml_as_string () const
bool const font_changed =
font != i->font() ||
italic != i->italic() ||
- color != i->color() ||
+ colour != i->colour() ||
size != i->size() ||
effect != i->effect() ||
- effect_color != i->effect_color();
+ effect_colour != i->effect_colour();
if (font_changed) {
font = i->font ();
italic = i->italic ();
- color = i->color ();
+ colour = i->colour ();
size = i->size ();
effect = i->effect ();
- effect_color = i->effect_color ();
+ effect_colour = i->effect_colour ();
}
if (!font_element || font_changed) {
@@ -129,10 +129,10 @@ InteropSubtitleContent::xml_as_string () const
font_element->set_attribute ("Id", font.get ());
}
font_element->set_attribute ("Italic", italic ? "yes" : "no");
- font_element->set_attribute ("Color", color.to_argb_string());
+ font_element->set_attribute ("Color", colour.to_argb_string());
font_element->set_attribute ("Size", raw_convert<string> (size));
font_element->set_attribute ("Effect", effect_to_string (effect));
- font_element->set_attribute ("EffectColor", effect_color.to_argb_string());
+ font_element->set_attribute ("EffectColor", effect_colour.to_argb_string());
font_element->set_attribute ("Script", "normal");
font_element->set_attribute ("Underlined", "no");
font_element->set_attribute ("Weight", "normal");
diff --git a/src/subtitle_content.cc b/src/subtitle_content.cc
index 592bfc62..1b5e6a1b 100644
--- a/src/subtitle_content.cc
+++ b/src/subtitle_content.cc
@@ -132,7 +132,7 @@ SubtitleContent::maybe_add_subtitle (string text, ParseState const & parse_state
SubtitleString (
effective_font.id,
effective_font.italic.get(),
- effective_font.color.get(),
+ effective_font.colour.get(),
effective_font.size,
effective_subtitle.in,
effective_subtitle.out,
@@ -140,7 +140,7 @@ SubtitleContent::maybe_add_subtitle (string text, ParseState const & parse_state
effective_text.v_align,
text,
effective_font.effect ? effective_font.effect.get() : NONE,
- effective_font.effect_color.get(),
+ effective_font.effect_colour.get(),
effective_subtitle.fade_up_time,
effective_subtitle.fade_down_time
)
diff --git a/src/subtitle_string.cc b/src/subtitle_string.cc
index a92eac92..a8dfd555 100644
--- a/src/subtitle_string.cc
+++ b/src/subtitle_string.cc
@@ -28,7 +28,7 @@ using namespace dcp;
SubtitleString::SubtitleString (
optional<string> font,
bool italic,
- Color color,
+ Colour colour,
int size,
Time in,
Time out,
@@ -36,13 +36,13 @@ SubtitleString::SubtitleString (
VAlign v_align,
string text,
Effect effect,
- Color effect_color,
+ Colour effect_colour,
Time fade_up_time,
Time fade_down_time
)
: _font (font)
, _italic (italic)
- , _color (color)
+ , _colour (colour)
, _size (size)
, _in (in)
, _out (out)
@@ -50,7 +50,7 @@ SubtitleString::SubtitleString (
, _v_align (v_align)
, _text (text)
, _effect (effect)
- , _effect_color (effect_color)
+ , _effect_colour (effect_colour)
, _fade_up_time (fade_up_time)
, _fade_down_time (fade_down_time)
{
@@ -74,7 +74,7 @@ dcp::operator== (SubtitleString const & a, SubtitleString const & b)
return (
a.font() == b.font() &&
a.italic() == b.italic() &&
- a.color() == b.color() &&
+ a.colour() == b.colour() &&
a.size() == b.size() &&
a.in() == b.in() &&
a.out() == b.out() &&
@@ -82,7 +82,7 @@ dcp::operator== (SubtitleString const & a, SubtitleString const & b)
a.v_align() == b.v_align() &&
a.text() == b.text() &&
a.effect() == b.effect() &&
- a.effect_color() == b.effect_color() &&
+ a.effect_colour() == b.effect_colour() &&
a.fade_up_time() == b.fade_up_time() &&
a.fade_down_time() == b.fade_down_time()
);
@@ -101,8 +101,8 @@ dcp::operator<< (ostream& s, SubtitleString const & sub)
s << "non-italic";
}
- s << ", size " << sub.size() << ", color " << sub.color() << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ";\n"
- << "effect " << ((int) sub.effect()) << ", effect color " << sub.effect_color();
+ s << ", size " << sub.size() << ", colour " << sub.colour() << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ";\n"
+ << "effect " << ((int) sub.effect()) << ", effect colour " << sub.effect_colour();
return s;
}
diff --git a/src/subtitle_string.h b/src/subtitle_string.h
index 512a1b5b..0f066164 100644
--- a/src/subtitle_string.h
+++ b/src/subtitle_string.h
@@ -40,7 +40,7 @@ public:
SubtitleString (
boost::optional<std::string> font,
bool italic,
- Color color,
+ Colour colour,
int size,
Time in,
Time out,
@@ -48,7 +48,7 @@ public:
VAlign v_align,
std::string text,
Effect effect,
- Color effect_color,
+ Colour effect_colour,
Time fade_up_time,
Time fade_down_time
);
@@ -62,8 +62,8 @@ public:
return _italic;
}
- Color color () const {
- return _color;
+ Colour colour () const {
+ return _colour;
}
Time in () const {
@@ -93,8 +93,8 @@ public:
return _effect;
}
- Color effect_color () const {
- return _effect_color;
+ Colour effect_colour () const {
+ return _effect_colour;
}
Time fade_up_time () const {
@@ -128,7 +128,7 @@ private:
/** true if the text is italic */
bool _italic;
/** text colour */
- Color _color;
+ Colour _colour;
/** Size in points as if the screen height is 11 inches, so a 72pt font
* would be 1/11th of the screen height.
*/
@@ -142,7 +142,7 @@ private:
VAlign _v_align;
std::string _text;
Effect _effect;
- Color _effect_color;
+ Colour _effect_colour;
Time _fade_up_time;
Time _fade_down_time;
};
diff --git a/src/types.cc b/src/types.cc
index fc6d50f3..c97fb7b4 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -55,8 +55,8 @@ dcp::operator!= (Fraction const & a, Fraction const & b)
return (a.numerator != b.numerator || a.denominator != b.denominator);
}
-/** Construct a Color, initialising it to black. */
-Color::Color ()
+/** Construct a Colour, initialising it to black. */
+Colour::Colour ()
: r (0)
, g (0)
, b (0)
@@ -64,10 +64,10 @@ Color::Color ()
}
-/** Construct a Color from R, G and B. The values run between
+/** Construct a Colour from R, G and B. The values run between
* 0 and 255.
*/
-Color::Color (int r_, int g_, int b_)
+Colour::Colour (int r_, int g_, int b_)
: r (r_)
, g (g_)
, b (b_)
@@ -75,11 +75,11 @@ Color::Color (int r_, int g_, int b_)
}
-/** Construct a Color from an ARGB hex string; the alpha value is ignored.
+/** Construct a Colour from an ARGB hex string; the alpha value is ignored.
* @param argb_hex A string of the form AARRGGBB, where e.g. RR is a two-character
* hex value.
*/
-Color::Color (string argb_hex)
+Colour::Colour (string argb_hex)
{
int alpha;
if (sscanf (argb_hex.c_str(), "%2x%2x%2x%2x", &alpha, &r, &g, &b) < 4) {
@@ -91,7 +91,7 @@ Color::Color (string argb_hex)
* hex value. The alpha value will always be FF (ie 255; maximum alpha).
*/
string
-Color::to_argb_string () const
+Colour::to_argb_string () const
{
stringstream s;
s << "FF";
@@ -105,28 +105,28 @@ Color::to_argb_string () const
return t;
}
-/** operator== for Colors.
- * @param a First color to compare.
- * @param b Second color to compare.
+/** operator== for Colours.
+ * @param a First colour to compare.
+ * @param b Second colour to compare.
*/
bool
-dcp::operator== (Color const & a, Color const & b)
+dcp::operator== (Colour const & a, Colour const & b)
{
return (a.r == b.r && a.g == b.g && a.b == b.b);
}
-/** operator!= for Colors.
- * @param a First color to compare.
- * @param b Second color to compare.
+/** operator!= for Colours.
+ * @param a First colour to compare.
+ * @param b Second colour to compare.
*/
bool
-dcp::operator!= (Color const & a, Color const & b)
+dcp::operator!= (Colour const & a, Colour const & b)
{
return !(a == b);
}
ostream &
-dcp::operator<< (ostream& s, Color const & c)
+dcp::operator<< (ostream& s, Colour const & c)
{
s << "(" << c.r << ", " << c.g << ", " << c.b << ")";
return s;
diff --git a/src/types.h b/src/types.h
index 98244891..f685806f 100644
--- a/src/types.h
+++ b/src/types.h
@@ -164,15 +164,15 @@ enum Formulation {
DCI_SPECIFIC
};
-/** @class Color
- * @brief An RGB color (aka colour).
+/** @class Colour
+ * @brief An RGB colour.
*/
-class Color
+class Colour
{
public:
- Color ();
- Color (int r_, int g_, int b_);
- Color (std::string argb_hex);
+ Colour ();
+ Colour (int r_, int g_, int b_);
+ Colour (std::string argb_hex);
int r; ///< red component, from 0 to 255
int g; ///< green component, from 0 to 255
@@ -181,9 +181,9 @@ public:
std::string to_argb_string () const;
};
-extern bool operator== (Color const & a, Color const & b);
-extern bool operator!= (Color const & a, Color const & b);
-extern std::ostream & operator<< (std::ostream & s, Color const & c);
+extern bool operator== (Colour const & a, Colour const & b);
+extern bool operator!= (Colour const & a, Colour const & b);
+extern std::ostream & operator<< (std::ostream & s, Colour const & c);
typedef std::pair<std::string, boost::shared_ptr<const parse::AssetMap> > PathAssetMap;