--- /dev/null
+/*
+ Copyright (C) 2014-2019 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "bitmap_text.h"
+#include "image.h"
+
+bool
+operator== (BitmapText const & a, BitmapText const & b)
+{
+ if (!a.rectangle.equal(b.rectangle, 0.000001)) {
+ return false;
+ }
+
+ return *a.image == *b.image;
+}
+
+bool
+operator!= (BitmapText const & a, BitmapText const & b)
+{
+ return !(a == b);
+}
+
+
dcpomatic::Rect<double> rectangle;
};
+extern bool operator== (BitmapText const & a, BitmapText const & b);
+extern bool operator!= (BitmapText const & a, BitmapText const & b);
+
#endif
/*
- Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2019 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include "player_text.h"
#include "font.h"
+#include "util.h"
#include <boost/foreach.hpp>
using std::list;
}
}
}
+
+bool
+operator== (PlayerText const & a, PlayerText const & b)
+{
+ return deep_equals(a.fonts, b.fonts) && deep_equals(a.bitmap, b.bitmap) && deep_equals(a.string, b.string);
+}
{
return (p.x >= x && p.x <= (x + width) && p.y >= y && p.y <= (y + height));
}
+
+ bool equal (Rect<T> const & other, T threshold) const
+ {
+ return std::abs(x - other.x) < threshold &&
+ std::abs(y - other.y) < threshold &&
+ std::abs(width - other.width) < threshold &&
+ std::abs(height - other.height) < threshold;
+ }
};
}
--- /dev/null
+/*
+ Copyright (C) 2016-2019 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "string_text.h"
+
+bool
+operator== (StringText const & a, StringText const & b)
+{
+ return static_cast<dcp::SubtitleString const &>(a) == static_cast<dcp::SubtitleString const &>(b) && a.outline_width == b.outline_width;
+}
+
int outline_width;
};
+extern bool operator== (StringText const & a, StringText const & b);
+
#endif
return l;
}
+template <class T>
+bool
+deep_equals (std::list<boost::shared_ptr<T> > a, std::list<boost::shared_ptr<T> > b)
+{
+ if (a.size() != b.size()) {
+ return false;
+ }
+
+ typename std::list<boost::shared_ptr<T> >::const_iterator i = a.begin();
+ typename std::list<boost::shared_ptr<T> >::const_iterator j = b.begin();
+
+ while (i != a.end()) {
+ if (**i != **j) {
+ return false;
+ }
+ ++i;
+ ++j;
+ }
+
+ return true;
+}
+
+template <class T>
+bool
+deep_equals (std::list<T> a, std::list<T> b)
+{
+ if (a.size() != b.size()) {
+ return false;
+ }
+
+ typename std::list<T>::const_iterator i = a.begin();
+ typename std::list<T>::const_iterator j = b.begin();
+
+ while (i != a.end()) {
+ if (*i != *j) {
+ return false;
+ }
+ ++i;
+ ++j;
+ }
+
+ return true;
+}
+
#endif
+
audio_processor.cc
audio_ring_buffers.cc
audio_stream.cc
+ bitmap_text.cc
butler.cc
text_content.cc
text_decoder.cc
server.cc
shuffler.cc
state.cc
+ string_text.cc
spl.cc
spl_entry.cc
string_log_entry.cc