From 6af0caf1376a27c9007ff3c5dd0a3d4f91074960 Mon Sep 17 00:00:00 2001 From: Subrata Das <40207448+subratappt@users.noreply.github.com> Date: Tue, 25 Jan 2022 03:35:48 +0530 Subject: [PATCH] Add `imshow` support for `double` data type Add `imshow` support for `double` data type. ```c++ namespace plt = matplotlibcpp; . . std::vector A(264*264); . . plt::imshow(A.data(),264,264,1); ``` --- matplotlibcpp.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index d95d46a..5fe7007 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -957,6 +957,11 @@ inline void imshow(const float *ptr, const int rows, const int columns, const in detail::imshow((void *) ptr, NPY_FLOAT, rows, columns, colors, keywords, out); } +inline void imshow(const double *ptr, const int rows, const int columns, const int colors, const std::map &keywords = {}, PyObject** out = nullptr) +{ + detail::imshow((void *) ptr, NPY_DOUBLE, rows, columns, colors, keywords, out); +} + #ifdef WITH_OPENCV void imshow(const cv::Mat &image, const std::map &keywords = {}) {