From 2ce451daa972d5591bb2aae19ec1cd7a0735c0f1 Mon Sep 17 00:00:00 2001 From: mulx10 Date: Mon, 15 Jul 2019 14:37:25 +0530 Subject: [PATCH] Removed unused params & revised docstring --- src/mlpack/core/data/image_info.hpp | 10 ++-------- src/mlpack/core/data/image_info_impl.hpp | 6 ++---- src/mlpack/tests/image_load_test.cpp | 5 +++-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/mlpack/core/data/image_info.hpp b/src/mlpack/core/data/image_info.hpp index 296857225d..bfa9e7805a 100644 --- a/src/mlpack/core/data/image_info.hpp +++ b/src/mlpack/core/data/image_info.hpp @@ -37,14 +37,14 @@ namespace data { * @return Boolean value indicating success if it is an image. */ inline bool ImageFormatSupported(const std::string& fileName, - bool save = false); + const bool save = false); class ImageInfo { public: /** * Instantiate the ImageInfo object with the given image width, height, - * channels parameter. + * number of channels and quality parameter. * * @param width Image width. * @param height Image height. @@ -88,12 +88,6 @@ class ImageInfo // Compression of the image if saved as jpg (0 - 100). size_t quality; - - // Image format. - std::string format; - - // Flip the image vertical upon loading/saving. - bool flipVertical; }; } // namespace data diff --git a/src/mlpack/core/data/image_info_impl.hpp b/src/mlpack/core/data/image_info_impl.hpp index 6c1139e3e9..0fabbf7a75 100644 --- a/src/mlpack/core/data/image_info_impl.hpp +++ b/src/mlpack/core/data/image_info_impl.hpp @@ -27,7 +27,7 @@ static const std::vector loadFileTypes({"jpg", "png", "tga", static const std::vector saveFileTypes({"jpg", "png", "tga", "bmp", "hdr"}); -inline bool ImageFormatSupported(const std::string& fileName, bool save) +inline bool ImageFormatSupported(const std::string& fileName, const bool save) { if (save) { @@ -58,9 +58,7 @@ inline ImageInfo::ImageInfo(const size_t width, width(width), height(height), channels(channels), - quality(quality), - format(""), - flipVertical(true) + quality(quality) { // Do nothing. } diff --git a/src/mlpack/tests/image_load_test.cpp b/src/mlpack/tests/image_load_test.cpp index 55ace04867..0e2bbb0459 100644 --- a/src/mlpack/tests/image_load_test.cpp +++ b/src/mlpack/tests/image_load_test.cpp @@ -22,7 +22,8 @@ using namespace std; BOOST_AUTO_TEST_SUITE(ImageLoadTest); /** - * Test the invalid extension. + * Test if an image with an unsupported extension throws an expected + * exception. */ BOOST_AUTO_TEST_CASE(LoadInvalidExtensionFile) { @@ -33,7 +34,7 @@ BOOST_AUTO_TEST_CASE(LoadInvalidExtensionFile) } /** - * Test the images is loaded correctly into the matrix using the API. + * Test that the image is loaded correctly into the matrix using the API. */ BOOST_AUTO_TEST_CASE(LoadImageAPITest) {