libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd/pnm_src tiff.cxx [newimage2]


From: Edward Rosten
Subject: [libcvd-members] libcvd/pnm_src tiff.cxx [newimage2]
Date: Tue, 16 Nov 2010 20:10:09 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Branch:         newimage2
Changes by:     Edward Rosten <edrosten>        10/11/16 20:10:09

Modified files:
        pnm_src        : tiff.cxx 

Log message:
        Fix lack of deafulting for samples_per_pixel. Also, add verbose mode.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/pnm_src/tiff.cxx?cvsroot=libcvd&only_with_tag=newimage2&r1=1.16&r2=1.16.4.1

Patches:
Index: tiff.cxx
===================================================================
RCS file: /cvsroot/libcvd/libcvd/pnm_src/tiff.cxx,v
retrieving revision 1.16
retrieving revision 1.16.4.1
diff -u -b -r1.16 -r1.16.4.1
--- tiff.cxx    13 Oct 2010 17:20:24 -0000      1.16
+++ tiff.cxx    16 Nov 2010 20:10:07 -0000      1.16.4.1
@@ -216,6 +216,14 @@
        TIFFClose(tif);
 }
 
+#ifdef CVD_INTERNAL_VERBOSE_TIFF
+       #define LOG(X) do{ cerr << X; }while(0)
+       #define VAR(X) #X << " = " << X
+#else
+       #define LOG(X)
+       #define VAR(X)
+#endif
+
 
 TIFFPimpl::TIFFPimpl(istream& is)
 :i(is),row(0)
@@ -245,15 +253,26 @@
        TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
        TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);     
        TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bitspersample);
-       TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &spp);
+       
+       TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &spp);
+
        TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photo); 
        TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &pl_type);
 
+       LOG(VAR(w) << endl);
+       LOG(VAR(h) << endl);
+       LOG(VAR(bitspersample) << endl);
+       LOG(VAR(spp) << endl);
+       LOG(VAR(photo) << endl);
+       LOG(VAR(pl_type) << endl);
+
+
        //Read the sample format. If it is missing, then it
        //defaults to unsigned int as per the spec.
        if(TIFFGetField(tif, TIFFTAG_SAMPLEFORMAT, &sampleformat) == 0)
                sampleformat = SAMPLEFORMAT_UINT;
 
+       LOG(VAR(sampleformat) << endl);
 
        my_size.x = w;
        my_size.y = h;
@@ -322,6 +341,9 @@
        if(type == "bool")
                bool_rowbuf.resize((size().x + 7)/8);
 
+       LOG(VAR(type) << endl);
+       LOG(VAR(use_cooked_rgba_interface) << endl);
+
 
 
        if(use_cooked_rgba_interface)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]