Browse Source

DebugTools: make CommpareImage usable with CORRADE_COMPARE_AS().

pull/317/head
Vladimír Vondruš 7 years ago
parent
commit
db44b570f7
  1. 7
      doc/changelog.dox
  2. 6
      src/Magnum/DebugTools/CompareImage.h

7
doc/changelog.dox

@ -59,6 +59,13 @@ See also:
recognizes also uppercase file extensions (see
[mosra/magnum#312](https://github.com/mosra/magnum/pull/312))
@subsubsection changelog-latest-changes-debugtools DebugTools library
- @ref DebugTools::CompareImage, @ref DebugTools::CompareImageToFile and
other variants are now usable directly through @ref CORRADE_COMPARE_AS(),
no need to pass an explicit instance to @ref CORRADE_COMPARE_WITH() when
just the default parameters are needed
@subsubsection changelog-latest-changes-platform Platform libraries
- On OpenGL ES builds, @ref Platform::Sdl2Application now tells SDL whether

6
src/Magnum/DebugTools/CompareImage.h

@ -100,6 +100,8 @@ template<> class MAGNUM_DEBUGTOOLS_EXPORT Comparator<Magnum::DebugTools::Compare
public:
explicit Comparator(Magnum::Float maxThreshold, Magnum::Float meanThreshold): Magnum::DebugTools::Implementation::ImageComparatorBase{nullptr, maxThreshold, meanThreshold} {}
/*implicit*/ Comparator(): Comparator{0.0f, 0.0f} {}
bool operator()(const Magnum::ImageView2D& actual, const Magnum::ImageView2D& expected) {
return Magnum::DebugTools::Implementation::ImageComparatorBase::operator()(actual, expected);
}
@ -120,6 +122,8 @@ template<> class MAGNUM_DEBUGTOOLS_EXPORT Comparator<Magnum::DebugTools::Compare
public:
explicit Comparator(PluginManager::Manager<Magnum::Trade::AbstractImporter>* manager, Magnum::Float maxThreshold, Magnum::Float meanThreshold): Magnum::DebugTools::Implementation::ImageComparatorBase{manager, maxThreshold, meanThreshold} {}
/*implicit*/ Comparator(): Comparator{nullptr, 0.0f, 0.0f} {}
bool operator()(const Magnum::ImageView2D& actual, const std::string& expected) {
return Magnum::DebugTools::Implementation::ImageComparatorBase::operator()(actual, expected);
}
@ -129,6 +133,8 @@ template<> class MAGNUM_DEBUGTOOLS_EXPORT Comparator<Magnum::DebugTools::Compare
public:
explicit Comparator(PluginManager::Manager<Magnum::Trade::AbstractImporter>* manager, Magnum::Float maxThreshold, Magnum::Float meanThreshold): Magnum::DebugTools::Implementation::ImageComparatorBase{manager, maxThreshold, meanThreshold} {}
/*implicit*/ Comparator(): Comparator{nullptr, 0.0f, 0.0f} {}
bool operator()(const std::string& actual, const Magnum::ImageView2D& expected) {
return Magnum::DebugTools::Implementation::ImageComparatorBase::operator()(actual, expected);
}

Loading…
Cancel
Save