[opengtl-commits] [651] add an option parameter to the encode function

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 651
Author:   cyrille
Date:     2009-03-17 17:24:05 +0100 (Tue, 17 Mar 2009)

Log Message:
-----------
add an option parameter to the encode function

Modified Paths:
--------------
    trunk/OpenGTL/Extensions/PngDC/PngDC.cpp
    trunk/OpenGTL/Extensions/PngDC/PngDC.h
    trunk/OpenGTL/Extensions/RawDC/RawDC.cpp
    trunk/OpenGTL/Extensions/RawDC/RawDC.h
    trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.h
    trunk/OpenGTL/OpenGTL/tools/convert/GTLConvert.cpp
    trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp


Modified: trunk/OpenGTL/Extensions/PngDC/PngDC.cpp
===================================================================
--- trunk/OpenGTL/Extensions/PngDC/PngDC.cpp	2009-03-17 16:16:32 UTC (rev 650)
+++ trunk/OpenGTL/Extensions/PngDC/PngDC.cpp	2009-03-17 16:24:05 UTC (rev 651)
@@ -162,7 +162,7 @@
   return image;
 }
 
-bool PngDC::encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, GTLCore::String* _errorMessage ) const
+bool PngDC::encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, const GTLImageIO::Options* , GTLCore::String* _errorMessage ) const
 {
   GTL_ASSERT( _image );
   FILE *fp = fopen(_fileName.c_str(), "wb");

Modified: trunk/OpenGTL/Extensions/PngDC/PngDC.h
===================================================================
--- trunk/OpenGTL/Extensions/PngDC/PngDC.h	2009-03-17 16:16:32 UTC (rev 650)
+++ trunk/OpenGTL/Extensions/PngDC/PngDC.h	2009-03-17 16:24:05 UTC (rev 651)
@@ -24,5 +24,5 @@
     PngDC();
     virtual ~PngDC();
     virtual GTLCore::AbstractImage* decode( const GTLCore::String& _fileName, GTLCore::Region*  = 0, GTLCore::String* _errorMessage = 0 ) const;
-    virtual bool encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, GTLCore::String* _errorMessage = 0 ) const;
+    virtual bool encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, const GTLImageIO::Options* _options = 0, GTLCore::String* _errorMessage = 0 ) const;
 };

Modified: trunk/OpenGTL/Extensions/RawDC/RawDC.cpp
===================================================================
--- trunk/OpenGTL/Extensions/RawDC/RawDC.cpp	2009-03-17 16:16:32 UTC (rev 650)
+++ trunk/OpenGTL/Extensions/RawDC/RawDC.cpp	2009-03-17 16:24:05 UTC (rev 651)
@@ -110,7 +110,7 @@
   return new GTLCore::BufferImage( raw.imgdata.sizes.iwidth, raw.imgdata.sizes.iheight, array, GTLCore::PixelDescription( GTLCore::Type::UnsignedInteger16, 1 ) ) ;
 }
 
-bool RawDC::encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, GTLCore::String* _errorMessage ) const
+bool RawDC::encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, const GTLImageIO::Options* , GTLCore::String* _errorMessage ) const
 {
   return false;
 }

Modified: trunk/OpenGTL/Extensions/RawDC/RawDC.h
===================================================================
--- trunk/OpenGTL/Extensions/RawDC/RawDC.h	2009-03-17 16:16:32 UTC (rev 650)
+++ trunk/OpenGTL/Extensions/RawDC/RawDC.h	2009-03-17 16:24:05 UTC (rev 651)
@@ -24,6 +24,6 @@
     RawDC();
     virtual ~RawDC();
     virtual GTLCore::AbstractImage* decode( const GTLCore::String& _fileName, GTLCore::Region*  = 0, GTLCore::String* _errorMessage = 0 ) const;
-    virtual bool encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, GTLCore::String* _errorMessage = 0 ) const;
+    virtual bool encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, const GTLImageIO::Options* _options = 0, GTLCore::String* _errorMessage = 0 ) const;
     virtual bool canEncodeImage( const GTLCore::String& _fileName ) const;
 };

Modified: trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.h	2009-03-17 16:16:32 UTC (rev 650)
+++ trunk/OpenGTL/OpenGTL/GTLImageIO/ImageDC.h	2009-03-17 16:24:05 UTC (rev 651)
@@ -42,6 +42,7 @@
   }
 
 namespace GTLImageIO {
+  class Options;
   /**
    * Base class of Image Decoder / Coder .
    * @ingroup GTLImageIO
@@ -66,7 +67,7 @@
        * Save file to disk.
        * @return false if an error has happen, and fill \param _errorMessage
        */
-      virtual bool encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, GTLCore::String* _errorMessage = 0 ) const = 0;
+      virtual bool encode( const GTLCore::AbstractImage* _image, const GTLCore::Region& _region, const GTLCore::String& _fileName, const Options* _options = 0, GTLCore::String* _errorMessage = 0 ) const = 0;
       /**
        * This function will only check if the extension is in the list. If you want more
        * checking, you can reimplement in an herited class.

Modified: trunk/OpenGTL/OpenGTL/tools/convert/GTLConvert.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/tools/convert/GTLConvert.cpp	2009-03-17 16:16:32 UTC (rev 650)
+++ trunk/OpenGTL/OpenGTL/tools/convert/GTLConvert.cpp	2009-03-17 16:24:05 UTC (rev 651)
@@ -90,7 +90,7 @@
       std::cerr << "Error while decoding " << inputFileName << " : " << errMsg << std::endl;
       return EXIT_FAILURE;
     }
-    if(not encoder->encode( image, region, outputFileName, &errMsg ))
+    if(not encoder->encode( image, region, outputFileName, 0, &errMsg ))
     {
       std::cerr << "Error while encoding " << outputFileName << " : " << errMsg << std::endl;
       return EXIT_FAILURE;

Modified: trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp	2009-03-17 16:16:32 UTC (rev 650)
+++ trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp	2009-03-17 16:24:05 UTC (rev 651)
@@ -251,7 +251,7 @@
       std::cerr << "Can't find encoder for " << outputFileName << std::endl;
       return EXIT_FAILURE;
     }
-    if( not encoder->encode( &image, GTLCore::Region(0, 0, image.width(), image.height()), outputFileName, &errMsg ) )
+    if( not encoder->encode( &image, GTLCore::Region(0, 0, image.width(), image.height()), outputFileName, 0, &errMsg ) )
     {
       std::cerr << "Can't encode " << outputFileName << " : " << errMsg << std::endl;
       return EXIT_FAILURE;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/