From 2f6d88e168f36719ba00fb6db779bc9ca06001b2 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Fri, 27 Nov 2020 00:38:04 -0500 Subject: [PATCH] various Readers: Fix GetCache return type Tests: fix ImageWriter cache type --- src/ImageReader.h | 4 +++- src/QtHtmlReader.h | 4 +++- src/QtImageReader.h | 4 +++- src/QtTextReader.h | 4 +++- tests/ImageWriter_Tests.cpp | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/ImageReader.h b/src/ImageReader.h index aa96272fd..2fcb963aa 100644 --- a/src/ImageReader.h +++ b/src/ImageReader.h @@ -48,6 +48,8 @@ namespace openshot { + // Forward decls + class CacheBase; /** * @brief This class uses the ImageMagick++ libraries, to open image files, and return @@ -90,7 +92,7 @@ namespace openshot void Close() override; /// Get the cache object used by this reader (always returns NULL for this object) - CacheMemory* GetCache() override { return NULL; }; + CacheBase* GetCache() override { return NULL; }; /// Get an openshot::Frame object for a specific frame number of this reader. All numbers /// return the same Frame, since they all share the same image data. diff --git a/src/QtHtmlReader.h b/src/QtHtmlReader.h index 3d426afb0..cd5a2750a 100644 --- a/src/QtHtmlReader.h +++ b/src/QtHtmlReader.h @@ -49,6 +49,8 @@ class QImage; namespace openshot { + // Forward decls + class CacheBase; /** * @brief This class uses Qt libraries, to create frames with rendered HTML, and return @@ -115,7 +117,7 @@ namespace openshot void Close() override; /// Get the cache object used by this reader (always returns NULL for this object) - openshot::CacheMemory* GetCache() override { return NULL; }; + CacheBase* GetCache() override { return NULL; }; /// Get an openshot::Frame object for a specific frame number of this reader. All numbers /// return the same Frame, since they all share the same image data. diff --git a/src/QtImageReader.h b/src/QtImageReader.h index 5162b8f45..b61ca3af3 100644 --- a/src/QtImageReader.h +++ b/src/QtImageReader.h @@ -42,6 +42,8 @@ namespace openshot { + // Forward decl + class CacheBase; /** * @brief This class uses the Qt library, to open image files, and return @@ -88,7 +90,7 @@ namespace openshot void Close() override; /// Get the cache object used by this reader (always returns NULL for this object) - CacheMemory* GetCache() override { return NULL; }; + CacheBase* GetCache() override { return NULL; }; /// Get an openshot::Frame object for a specific frame number of this reader. All numbers /// return the same Frame, since they all share the same image data. diff --git a/src/QtTextReader.h b/src/QtTextReader.h index 2fd203ad4..d66681f31 100644 --- a/src/QtTextReader.h +++ b/src/QtTextReader.h @@ -49,6 +49,8 @@ class QImage; namespace openshot { + // Forward decls + class CacheBase; /** * @brief This class uses Qt libraries, to create frames with "Text", and return @@ -126,7 +128,7 @@ namespace openshot void Close() override; /// Get the cache object used by this reader (always returns NULL for this object) - openshot::CacheMemory* GetCache() override { return NULL; }; + CacheBase* GetCache() override { return NULL; }; /// Get an openshot::Frame object for a specific frame number of this reader. All numbers /// return the same Frame, since they all share the same image data. diff --git a/tests/ImageWriter_Tests.cpp b/tests/ImageWriter_Tests.cpp index d74907bf3..e4e500ddf 100644 --- a/tests/ImageWriter_Tests.cpp +++ b/tests/ImageWriter_Tests.cpp @@ -85,7 +85,7 @@ TEST(Gif) // Basic Reader state queries CHECK_EQUAL("ImageReader", r1.Name()); - CacheMemory* c = r1.GetCache(); + CacheBase* c = r1.GetCache(); CHECK_EQUAL(true, c == nullptr); CHECK_EQUAL(false, r1.IsOpen());