File indexing completed on 2025-01-18 09:36:59
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_LOG_HPP
0009 #define BOOST_GIL_EXTENSION_IO_TIFF_DETAIL_LOG_HPP
0010
0011 #include <iostream>
0012
0013 extern "C" {
0014 #include "tiffio.h"
0015 }
0016
0017 namespace boost { namespace gil {
0018
0019 class tiff_no_log
0020 {
0021 public:
0022
0023 tiff_no_log()
0024 {
0025 TIFFSetErrorHandler ( nullptr );
0026 TIFFSetWarningHandler( nullptr );
0027 }
0028 };
0029
0030 class console_log
0031 {
0032 public:
0033
0034 console_log()
0035 {
0036 TIFFSetErrorHandler ( console_log::error );
0037 TIFFSetWarningHandler( console_log::warning );
0038 }
0039
0040 private:
0041
0042 static void error( const char*
0043 , const char* fmt
0044 , va_list ap
0045 )
0046 {
0047 char buf[1000];
0048 sprintf(buf, fmt, ap);
0049 std::cout << "error: " << buf << std::endl;
0050 }
0051
0052 static void warning( char const*
0053 , char const* fmt
0054 , va_list ap
0055 )
0056 {
0057 char buf[1000];
0058 sprintf(buf, fmt, ap);
0059 std::cout << "warning: " << fmt << std::endl;
0060 }
0061 };
0062
0063 }
0064 }
0065
0066 #endif