changeset 31187:2bff8446484c

imformats: added logic to use Tiff interface for image functions scripts/image/PKG_ADD: added logic to optionally use internal Tiff functions for imread/imwrite/imfinfo for tiff images if available.
author magedrifaat <magedrifaat@gmail.com>
date Tue, 23 Aug 2022 21:52:47 +0200
parents 90eccc78d958
children 66cf3c7c06e8
files .build/scripts/image/PKG_ADD libinterp/corefcn/__tiff__.cc
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/__tiff__.cc	Thu Aug 18 20:44:06 2022 +0200
+++ b/libinterp/corefcn/__tiff__.cc	Tue Aug 23 21:52:47 2022 +0200
@@ -2403,7 +2403,7 @@
     if (! tif)
       error ("Failed to open Tiff file\n");
     
-    // TODO(maged): check of there is more to be done for r+
+    // TODO(maged): check if there is more to be done for r+
     if (is_rplus && ! TIFFSetDirectory (tif, 0))
       error ("Failed to open Tiff file\n");
 
@@ -2559,7 +2559,7 @@
     
     TIFF *tif = tiff_handle->get_file ();
 
-    // TODO(maged): nargout and ycbcr
+    // FIXME: add support for reading in YCbCr mode
     octave_unused_parameter (nargout);
 
     // Obtain all necessary tags
@@ -2611,7 +2611,7 @@
 
     TIFF *tif = tiff_handle->get_file ();
 
-    // TODO(maged): nargout and ycbcr
+    // FIXME: add support for reading in YCbCr mode
     octave_unused_parameter (nargout);
 
     if (TIFFIsTiled (tif))
@@ -2650,7 +2650,7 @@
 
     TIFF *tif = tiff_handle->get_file ();
 
-    // TODO(maged): nargout and ycbcr
+    // FIXME: add support for reading in YCbCr mode
     octave_unused_parameter (nargout);
 
     if (! TIFFIsTiled (tif))
@@ -2928,6 +2928,7 @@
 #if defined (HAVE_TIFF)
     int nargin = args.length ();
 
+    // FIXME: add support for writing in YCbCr mode
     if (nargin < 2)
       error ("Wrong number of arguments\n");
     
@@ -2974,7 +2975,7 @@
 #if defined (HAVE_TIFF)
     int nargin = args.length ();
 
-    // TODO(maged): add support for YCbCr data
+    // FIXME: add support for writing in YCbCr mode
     if (nargin < 3)
       error ("Too few arguments provided\n");
     
@@ -3010,7 +3011,7 @@
 #if defined (HAVE_TIFF)
     int nargin = args.length ();
 
-    // TODO(maged): add support for YCbCr data
+    // FIXME: add support for writing in YCbCr mode
     if (nargin < 3)
       error ("Too few arguments provided\n");
     
@@ -3479,9 +3480,13 @@
   DEFUN (__tiff_make_tagid__, , ,
          "Create the TagID structure from the internal map")
   {
+#if defined (HAVE_TIFF)
     std::map<std::string, octave_value> tag_ov_map;
     for (auto it = tag_name_map.cbegin (); it != tag_name_map.cend (); it++)
       tag_ov_map[it->first] = octave_value (it->second);
     return octave_value_list(octave_scalar_map (tag_ov_map));
+#else
+    err_disabled_feature ("F__tiff_make_tagid__", "Tiff");
+#endif
   }
 }