[arrayfire] 207/284: BUGFIX Handle 16-bit data in saveImage

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sun Feb 7 18:59:34 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/experimental
in repository arrayfire.

commit 6da71e59db4d2839585c63187ec7dc7a7d4dec2d
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Mon Jan 11 14:22:28 2016 -0500

    BUGFIX Handle 16-bit data in saveImage
---
 src/api/c/imageio.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/api/c/imageio.cpp b/src/api/c/imageio.cpp
index e372cd7..5471305 100644
--- a/src/api/c/imageio.cpp
+++ b/src/api/c/imageio.cpp
@@ -299,9 +299,16 @@ af_err af_save_image(const char* filename, const af_array in_)
             AF_CHECK(af_mul(&in, in_, c255, false));
             AF_CHECK(af_release_array(c255));
             free_in = true;
-        } else {
+        } else if(max_real < 256) {
             in = in_;
         }
+        else if (max_real < 65536) {
+            af_array c255 = 0;
+            AF_CHECK(af_constant(&c255, 257.0, info.ndims(), info.dims().get(), f32));
+            AF_CHECK(af_div(&in, in_, c255, false));
+            AF_CHECK(af_release_array(c255));
+            free_in = true;
+        }
 
         // FI = row major | AF = column major
         uint nDstPitch = FreeImage_GetPitch(pResultBitmap);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list