diff --git a/Makefile.am b/Makefile.am index bd507256..97c91197 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,6 +16,7 @@ lms_SOURCES = \ $(top_srcdir)/av/FormatContext.cpp \ $(top_srcdir)/av/InputFormatContext.cpp \ $(top_srcdir)/av/Stream.cpp \ + $(top_srcdir)/cover/CoverArt.cpp \ $(top_srcdir)/cover/CoverArtGrabber.cpp \ $(top_srcdir)/ui/LmsApplication.cpp \ $(top_srcdir)/ui/audio/AudioWidget.cpp \ diff --git a/TODO b/TODO index a0cdd26d..7f69e311 100644 --- a/TODO +++ b/TODO @@ -3,6 +3,9 @@ - Do the feature - Admin account to add/remove users, add path to watch for Audio/Video files +[Cover] +- Scaling: find something more "reliable" than GIL and its customs extensions (adobe work, io_new) + [Database] - When removing a track, make sure to remove genre/artist/release if last of it - Use Inotify like system to watch modified/added files diff --git a/av/InputFormatContext.cpp b/av/InputFormatContext.cpp index 2f582dff..4a5fc897 100644 --- a/av/InputFormatContext.cpp +++ b/av/InputFormatContext.cpp @@ -9,8 +9,6 @@ namespace Av InputFormatContext::InputFormatContext(const boost::filesystem::path& p) : _path(p) { - std::cout << "Opening '" << p.string().c_str() << "'" << std::endl; - AVFormatContext* context = nullptr; // The last three parameters specify the file format, buffer size and @@ -103,7 +101,6 @@ InputFormatContext::getPictures(std::vector< std::vector >& pictu { if (native()->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC) { - std::cout << "Found album art..." << std::endl; AVPacket pkt = native()->streams[i]->attached_pic; std::vector data; diff --git a/boost/gil/extension/io_new/bmp_all.hpp b/boost/gil/extension/io_new/bmp_all.hpp new file mode 100644 index 00000000..f6a34f9b --- /dev/null +++ b/boost/gil/extension/io_new/bmp_all.hpp @@ -0,0 +1,25 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BMP_ALL_HPP +#define BOOST_GIL_EXTENSION_IO_BMP_ALL_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "bmp_read.hpp" +#include "bmp_write.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_BMP_ALL_HPP diff --git a/boost/gil/extension/io_new/bmp_io_old.hpp b/boost/gil/extension/io_new/bmp_io_old.hpp new file mode 100644 index 00000000..e920be55 --- /dev/null +++ b/boost/gil/extension/io_new/bmp_io_old.hpp @@ -0,0 +1,177 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BMP_IO_OLD_HPP +#define BOOST_GIL_EXTENSION_IO_BMP_IO_OLD_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "bmp_all.hpp" + +namespace boost { namespace gil { + +/// \ingroup BMP_IO +/// \brief Returns the width and height of the BMP file at the specified location. +/// Throws std::ios_base::failure if the location does not correspond to a valid BMP file +template< typename String > +inline +point2< std::ptrdiff_t > bmp_read_dimensions( const String& filename ) +{ + image_read_info< bmp_tag > info = read_image_info( filename + , bmp_tag() + ); + + return point2< std::ptrdiff_t >( info._width + , info._height + ); +} + + +/// \ingroup BMP_IO +/// \brief Loads the image specified by the given bmp image file name into the given view. +/// Triggers a compile assert if the view color space and channel depth are not supported by the BMP library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid BMP file, or if its color space or channel depth are not +/// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void bmp_read_view( const String& filename + , const View& view + ) +{ + read_view( filename + , view + , bmp_tag() + ); +} + +/// \ingroup BMP_IO +/// \brief Allocates a new image whose dimensions are determined by the given bmp image file, and loads the pixels into it. +/// Triggers a compile assert if the image color space or channel depth are not supported by the BMP library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid BMP file, or if its color space or channel depth are not +/// compatible with the ones specified by Image +template< typename String + , typename Image + > +inline +void bmp_read_image( const String& filename + , Image& img + ) +{ + read_image( filename + , img + , bmp_tag() + ); +} + +/// \ingroup BMP_IO +/// \brief Loads and color-converts the image specified by the given bmp image file name into the given view. +/// Throws std::ios_base::failure if the file is not a valid BMP file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + , typename CC + > +inline +void bmp_read_and_convert_view( const String& filename + , const View& view + , CC cc + ) +{ + read_and_convert_view( filename + , view + , cc + , bmp_tag() + ); +} + +/// \ingroup BMP_IO +/// \brief Loads and color-converts the image specified by the given bmp image file name into the given view. +/// Throws std::ios_base::failure if the file is not a valid BMP file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void bmp_read_and_convert_view( const String& filename + , const View& view + ) +{ + read_and_convert_view( filename + , view + , bmp_tag() + ); +} + +/// \ingroup BMP_IO +/// \brief Allocates a new image whose dimensions are determined by the given bmp image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid BMP file +template< typename String + , typename Image + , typename CC + > +inline +void bmp_read_and_convert_image( const String& filename + , Image& img + , CC cc + ) +{ + read_and_convert_image( filename + , img + , cc + , bmp_tag() + ); +} + +/// \ingroup BMP_IO +/// \brief Allocates a new image whose dimensions are determined by the given bmp image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid BMP file +template< typename String + , typename Image + > +inline +void bmp_read_and_convert_image( const String filename + , Image& img + ) +{ + read_and_convert_image( filename + , img + , bmp_tag() + ); +} + + +/// \ingroup BMP_IO +/// \brief Saves the view to a bmp file specified by the given bmp image file name. +/// Triggers a compile assert if the view color space and channel depth are not supported by the BMP library or by the I/O extension. +/// Throws std::ios_base::failure if it fails to create the file. +template< typename String + , typename View + > +inline +void bmp_write_view( const String& filename + , const View& view + ) +{ + write_view( filename + , view + , bmp_tag() + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_BMP_IO_OLD_HPP diff --git a/boost/gil/extension/io_new/bmp_read.hpp b/boost/gil/extension/io_new/bmp_read.hpp new file mode 100644 index 00000000..2aecf86c --- /dev/null +++ b/boost/gil/extension/io_new/bmp_read.hpp @@ -0,0 +1,32 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BMP_READ_HPP +#define BOOST_GIL_EXTENSION_IO_BMP_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "bmp_tags.hpp" +#include "formats/bmp/supported_types.hpp" +#include "formats/bmp/read.hpp" + +#include "detail/read_image.hpp" +#include "detail/read_view.hpp" +#include "detail/read_image_info.hpp" +#include "detail/read_and_convert_image.hpp" +#include "detail/read_and_convert_view.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_BMP_READ_HPP diff --git a/boost/gil/extension/io_new/bmp_tags.hpp b/boost/gil/extension/io_new/bmp_tags.hpp new file mode 100644 index 00000000..4c0b4c24 --- /dev/null +++ b/boost/gil/extension/io_new/bmp_tags.hpp @@ -0,0 +1,164 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BMP_TAGS_HPP +#define BOOST_GIL_EXTENSION_IO_BMP_TAGS_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "detail/base.hpp" + +namespace boost { namespace gil { + +/// Defines bmp tag. +struct bmp_tag : format_tag {}; + + /// See http://en.wikipedia.org/wiki/BMP_file_format#BMP_File_Header for reference. + +/// Defines type for offset value. +struct bmp_offset : property_base< uint32_t > {}; + +/// Defines type for header sizes. +struct bmp_header_size : property_base< uint32_t > +{ + static const type _size = 14; /// Constant size for bmp file header size. + static const type _win32_info_size = 40; /// Constant size for win32 bmp info header size. + static const type _os2_info_size = 12; /// Constant size for os2 bmp info header size. +}; + +/// Defines type for image width property. +struct bmp_image_width : property_base< int32_t > {}; + +/// Defines type for image height property. +struct bmp_image_height : property_base< int32_t > {}; + +/// Defines type for bits per pixels property. +struct bmp_bits_per_pixel : property_base< uint16_t > {}; + +/// Defines type for compression property. +struct bmp_compression : property_base< uint32_t > +{ + static const type _rgb = 0; /// RGB without compression + static const type _rle8 = 1; /// 8 bit index with RLE compression + static const type _rle4 = 2; /// 4 bit index with RLE compression + static const type _bitfield = 3; /// 16 or 32 bit fields without compression +}; + +/// Defines type for image size property. +struct bmp_image_size : property_base< uint32_t > {}; + +/// Defines type for horizontal resolution property. +struct bmp_horizontal_resolution : property_base< int32_t > {}; + +/// Defines type for vertical resolution property. +struct bmp_vertical_resolution : property_base< int32_t > {}; + +/// Defines type for number of colors property. +struct bmp_num_colors : property_base< uint32_t > {}; + +/// Defines type for important number of colors property. +struct bmp_num_important_colors : property_base< uint32_t > {}; + +static const uint32_t bmp_signature = 0x4D42; /// Constant signature for bmp file format. + +/// Read information for bmp images. +/// +/// The structure is returned when using read_image_info. +template<> +struct image_read_info< bmp_tag > +{ + /// Default contructor. + image_read_info< bmp_tag >() + : _valid( false ) + {} + + /// The offset, i.e. starting address, of the byte where the bitmap data can be found. + bmp_offset::type _offset; + + /// The size of this header: + /// - 40 bytes for Windows V3 header + /// - 12 bytes for OS/2 V1 header + bmp_header_size::type _header_size; + + /// The bitmap width in pixels ( signed integer ). + bmp_image_width::type _width; + + /// The bitmap height in pixels ( signed integer ). + bmp_image_height::type _height; + + /// The number of bits per pixel, which is the color depth of the image. + /// Typical values are 1, 4, 8, 16, 24 and 32. + bmp_bits_per_pixel::type _bits_per_pixel; + + /// The compression method being used. See above for a list of possible values. + bmp_compression::type _compression; + + /// The image size. This is the size of the raw bitmap data (see below), + /// and should not be confused with the file size. + bmp_image_size::type _image_size; + + /// The horizontal resolution of the image. (pixel per meter, signed integer) + bmp_horizontal_resolution::type _horizontal_resolution; + + /// The vertical resolution of the image. (pixel per meter, signed integer) + bmp_vertical_resolution::type _vertical_resolution; + + /// The number of colors in the color palette, or 0 to default to 2^n - 1. + bmp_num_colors::type _num_colors; + + /// The number of important colors used, or 0 when every color is important; + /// generally ignored. + bmp_num_important_colors::type _num_important_colors; + + /// Used internaly to identify is the header has been read. + bool _valid; +}; + +/// Read settings for bmp images. +/// +/// The structure can be used for all read_xxx functions, except read_image_info. +template<> +struct image_read_settings< bmp_tag > : public image_read_settings_base +{ + /// Default constructor + image_read_settings() + : image_read_settings_base() + {} + + /// Constructor + /// \param top_left Top left coordinate for reading partial image. + /// \param dim Dimensions for reading partial image. + image_read_settings( const point_t& top_left + , const point_t& dim + ) + : image_read_settings_base( top_left + , dim + ) + {} +}; + +/// Write information for bmp images. +/// +/// The structure can be used for write_view() function. +template<> +struct image_write_info< bmp_tag > +{ +}; + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_BMP_TAGS_HPP diff --git a/boost/gil/extension/io_new/bmp_write.hpp b/boost/gil/extension/io_new/bmp_write.hpp new file mode 100644 index 00000000..d874618b --- /dev/null +++ b/boost/gil/extension/io_new/bmp_write.hpp @@ -0,0 +1,28 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BMP_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_BMP_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "bmp_tags.hpp" +#include "formats/bmp/supported_types.hpp" +#include "formats/bmp/write.hpp" + +#include "detail/write_view.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_BMP_WRITE_HPP diff --git a/boost/gil/extension/io_new/detail/base.hpp b/boost/gil/extension/io_new/detail/base.hpp new file mode 100644 index 00000000..5170fcc6 --- /dev/null +++ b/boost/gil/extension/io_new/detail/base.hpp @@ -0,0 +1,111 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_BASE_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_BASE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "typedefs.hpp" +#include "io_error.hpp" + +namespace boost { namespace gil { + +struct format_tag {}; + +template< typename Property > +struct property_base +{ + typedef Property type; +}; + +template struct is_format_tag : is_base_and_derived< format_tag + , FormatTag + > {}; + +struct image_read_settings_base +{ +protected: + + image_read_settings_base() + : _top_left( 0, 0 ) + , _dim ( 0, 0 ) + {} + + image_read_settings_base( const point_t& top_left + , const point_t& dim + ) + : _top_left( top_left ) + , _dim ( dim ) + {} + +public: + + point_t _top_left; + point_t _dim; +}; + +/** + * Boolean meta function, mpl::true_ if the pixel type \a PixelType is supported + * by the image format identified with \a FormatTag. + * \todo the name is_supported is to generic, pick something more IO realted. + */ +// Depending on image type the parameter Pixel can be a reference type +// for bit_aligned images or a pixel for byte images. +template< typename Pixel, typename FormatTag > struct is_read_supported {}; +template< typename Pixel, typename FormatTag > struct is_write_supported {}; + + +namespace detail { + +template< typename Property > +struct property_base +{ + typedef Property type; +}; + +struct read_support_true { BOOST_STATIC_CONSTANT( bool, is_supported = true ); }; +struct read_support_false { BOOST_STATIC_CONSTANT( bool, is_supported = false ); }; +struct write_support_true { BOOST_STATIC_CONSTANT( bool, is_supported = true ); }; +struct write_support_false{ BOOST_STATIC_CONSTANT( bool, is_supported = false ); }; + +class no_log {}; + +} // namespace detail + +template struct image_read_info; +template struct image_read_settings; +template struct image_write_info; + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_BASE_HPP diff --git a/boost/gil/extension/io_new/detail/bit_operations.hpp b/boost/gil/extension/io_new/detail/bit_operations.hpp new file mode 100644 index 00000000..c8c9401c --- /dev/null +++ b/boost/gil/extension/io_new/detail/bit_operations.hpp @@ -0,0 +1,212 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_BIT_OPERATIONS_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_BIT_OPERATIONS_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace boost { namespace gil { namespace detail { + +// 1110 1100 -> 0011 0111 +template< typename Buffer + , typename IsBitAligned + > +struct mirror_bits +{ + mirror_bits( bool ) {} + + void operator() ( Buffer& ) {} +}; + + +// The functor will generate a lookup table since the +// mirror operation is quite costly. +template< typename Buffer > +struct mirror_bits< Buffer + , mpl::true_ + > +{ + mirror_bits( bool apply_operation = true ) + : _apply_operation( apply_operation ) + { + if( _apply_operation == true ) + { + byte_t i = 0; + do + { + _lookup[i] = mirror( i ); + } + while( i++ != 255 ); + } + } + + void operator() ( Buffer& buf ) + { + if( _apply_operation == true ) + { + for_each( buf.begin() + , buf.end() + , boost::bind( &mirror_bits< Buffer + , mpl::true_ + >::lookup + , *this + , _1 + ) + ); + } + } + +private: + + void lookup( byte_t& c ) + { + c = _lookup[ c ]; + } + + static byte_t mirror( byte_t c ) + { + byte_t result = 0; + for( int i = 0; i < 8; ++i ) + { + result = result << 1; + result |= ( c & 1 ); + c = c >> 1; + } + + return result; + } + +private: + + bool _apply_operation; + + array< byte_t, 256 > _lookup; +}; + + +// 0011 1111 -> 1100 0000 +template< typename Buffer + , typename IsBitAligned + > +struct negate_bits +{ + void operator() ( Buffer& ) {} +}; + +template< typename Buffer > +struct negate_bits< Buffer, mpl::true_ > +{ + void operator() ( Buffer& buf ) + { + for_each( buf.begin() + , buf.end() + , negate_bits< Buffer, mpl::true_ >::negate + ); + } + +private: + + static void negate( byte_t& b ) + { + b = ~b; + } +}; + + +// 11101100 -> 11001110 +template< typename Buffer + , typename IsBitAligned + > +struct swap_half_bytes +{ + void operator() ( Buffer& ) {} +}; + +template< typename Buffer > +struct swap_half_bytes< Buffer + , mpl::true_ + > +{ + void operator() ( Buffer& buf ) + { + for_each( buf.begin() + , buf.end() + , swap_half_bytes< Buffer, mpl::true_ >::swap + ); + } + +private: + + static void swap( byte_t& c ) + { + c = (( c << 4 ) & 0xF0 ) | (( c >> 4 ) & 0x0F ); + } +}; + +template< typename Buffer > +struct do_nothing +{ + do_nothing() {} + + void operator() ( Buffer& ) {} +}; + +/// Count consecutive zeros on the right +template< typename T > +inline +unsigned int trailing_zeros( T x ) +throw() +{ + unsigned int n = 0; + + x = ~x & (x - 1); + + while( x ) + { + n = n + 1; + x = x >> 1; + } + + return n; +} + +/// Counts ones in a bit-set +template< typename T > +inline +unsigned int count_ones( T x ) +throw() +{ + unsigned int n = 0; + + while( x ) + { + // clear the least significant bit set + x &= x - 1; + ++n; + } + + return n; +} + + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_BIT_OPERATIONS_HPP diff --git a/boost/gil/extension/io_new/detail/conversion_policies.hpp b/boost/gil/extension/io_new/detail/conversion_policies.hpp new file mode 100644 index 00000000..170d8304 --- /dev/null +++ b/boost/gil/extension/io_new/detail/conversion_policies.hpp @@ -0,0 +1,103 @@ +/* + Copyright 2007-2008 Andreas Pokorny, Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_CONVERSION_POLICIES_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_CONVERSION_POLICIES_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Andreas Pokorny, Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +namespace boost{namespace gil{ namespace detail { + +struct read_and_no_convert +{ +public: + typedef void* color_converter_type; + + template< typename InIterator + , typename OutIterator + > + void read( const InIterator& /* begin */ + , const InIterator& /* end */ + , OutIterator /* out */ + , typename disable_if< typename pixels_are_compatible< typename std::iterator_traits::value_type + , typename std::iterator_traits::value_type + >::type + >::type* /* ptr */ = 0 + ) + { + io_error( "Data cannot be copied because the pixels are incompatible." ); + } + + template< typename InIterator + , typename OutIterator + > + void read( const InIterator& begin + , const InIterator& end + , OutIterator out + , typename enable_if< typename pixels_are_compatible< typename std::iterator_traits::value_type + , typename std::iterator_traits::value_type + >::type + >::type* /* ptr */ = 0 + ) + { + std::copy( begin + , end + , out + ); + } + +}; + +template +struct read_and_convert +{ +public: + typedef CC color_converter_type; + CC _cc; + + read_and_convert( color_converter_type const& cc ) + : _cc(cc) {} + + template< typename InIterator + , typename OutIterator + > + void read( const InIterator& begin + , const InIterator& end + , OutIterator out + ) + { + typedef color_convert_deref_fn< typename std::iterator_traits::reference + , typename std::iterator_traits::value_type //reference? + , CC + > deref_t; + + std::transform( begin + , end + , out + , deref_t( _cc ) + ); + } +}; + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_CONVERSION_POLICIES_HPP diff --git a/boost/gil/extension/io_new/detail/dynamic_io_new.hpp b/boost/gil/extension/io_new/detail/dynamic_io_new.hpp new file mode 100644 index 00000000..bed2540c --- /dev/null +++ b/boost/gil/extension/io_new/detail/dynamic_io_new.hpp @@ -0,0 +1,115 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). + + See http://opensource.adobe.com/gil for most recent version including documentation. +*/ +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP_INCLUDED +#define BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP_INCLUDED + +/// \file +/// \brief Generic io functions for dealing with dynamic images +// +/// \author Hailin Jin and Lubomir Bourdev \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n Last updated May 30, 2006 + +#include +#include +#include +#include +#include + +namespace boost { namespace gil { + +// need this for various meta functions. +struct any_image_pixel_t {}; +struct any_image_channel_t {}; +struct any_image_color_space_t {}; + +namespace detail { + +template +struct construct_matched_t { + template + static bool apply(any_image& im,Pred pred) { + if (pred.template apply::type>()) { + typename mpl::at_c::type x; + im.move_in(x); + return true; + } else return construct_matched_t::apply(im,pred); + } +}; +template <> +struct construct_matched_t<0> { + template + static bool apply(any_image&,Pred) {return false;} +}; + +// A function object that can be passed to apply_operation. +// Given a predicate IsSupported taking a view type and returning an MPL boolean, +// calls the apply method of OpClass with the view if the given view IsSupported, or throws an exception otherwise +template +class dynamic_io_fnobj { + OpClass* _op; + + template + void apply(const View& view,mpl::true_ ) {_op->apply(view);} + + template + void apply( const View& view + , const Info& info + , const mpl::true_ + ) + { + _op->apply( view, info ); + } + + template + void apply(const View& /* view */ ,mpl::false_) {io_error("dynamic_io: unsupported view type for the given file format");} + + template + void apply( const View& /* view */ + , const Info& /* info */ + , const mpl::false_ + ) + { + io_error( "dynamic_io: unsupported view type for the given file format" ); + } + +public: + dynamic_io_fnobj(OpClass* op) : _op(op) {} + + typedef void result_type; + + template + void operator()(const View& view) {apply(view,typename IsSupported::template apply::type());} + + template< typename View, typename Info > + void operator()(const View& view, const Info& info ) + { + apply( view + , info + , typename IsSupported::template apply< View >::type() + ); + } + +}; + +} // namespace detail + +/// \brief Within the any_image, constructs an image with the given dimensions +/// and a type that satisfies the given predicate +template +inline bool construct_matched(any_image& im,Pred pred) { + return detail::construct_matched_t::value>::apply(im,pred); +} + +} } // namespace boost::gil + +#endif // BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP_INCLUDED diff --git a/boost/gil/extension/io_new/detail/io.hpp b/boost/gil/extension/io_new/detail/io.hpp new file mode 100644 index 00000000..da1e7a14 --- /dev/null +++ b/boost/gil/extension/io_new/detail/io.hpp @@ -0,0 +1,106 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_IO_HPP +#define BOOST_GIL_EXTENSION_IO_IO_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +/*! + * \page iobackend Adding a new io backend + * \section Overview of backend requirements + * To add support for a new IO backend the following is required: + * - a format tag, to identify the image format, derived from boost::gil::format_tag + * - boolean meta function is_supported must be implemented for + * the new format tag + * - explicit specialisation of image_read_info must be provided, containing + * runtime information available before/at reading the image + * - explicit specialisation of image_write_info must be provided, containing + * runtime encoding parameters for writing an image + * - An image reader must be specialized: + * \code + * template + * struct boost::gil::detail::reader + * { + * reader( IODevice & device ) + * reader( IODevice & device, typename ConversionPolicy::color_converter_type const& cc ) + * image_read_info get_info(); + * template + * void read_image( Image &, point_t const& top_left ); + * template + * void read_view( View &, point_t const& top_left ); + * }; + * \endcode + * - An image writer must be specialized: + * \code + * \template + * struct boost::gil::detail::writer + * { + * writer( IODevice & device ) + * template + * void apply( View const&, point_t const& top_left ); + * template + * void apply( View const&, point_t const& top_left, image_write_info const& ); + * }; + * \endcode + * + * Or instead of the items above implement overloads of read_view, read_and_convert_view, read_image, + * read_and_convert_image, write_view and read_image_info. + * + * \section ConversionPolicy Interface of the ConversionPolicy + * There are two different conversion policies in use, when reading images: + * read_and_convert and read_and_no_convert. ColorConverter + * can be a user defined color converter. + * + * \code + * struct ConversionPolicy + * { + * template + * void read( InputIterator in_begin, InputIterator in_end, + * OutputIterator out_end ); + * }; + * \endcode + * + * Methods like read_view and read_image are supposed to bail out with an + * exception instead of converting the image + * + * \section IODevice Concept of IO Device + * A Device is simply an object used to read and write data to and from a stream. + * The IODevice was added as a template paramter to be able to replace the file_name + * access functionality. This is only an interim solution, as soon as boost provides + * a good IO library, interfaces/constraints provided by that library could be used. + * + * \code + * concept IODevice + * { + * void IODevice::read( unsigned char* data, int count ); + * void IODevice::write( unsigned char* data, int count ); + * void IODevice::seek(long count, int whence); + * void IODevice::flush(); + * }; + * \endcode + * + * For the time being a boolean meta function must be specialized: + * \code + * namespace boost{namespace gil{namespace detail{ + * template + * struct detail::is_input_device; + * }}} + * \endcode + * + */ + +#endif // BOOST_GIL_EXTENSION_IO_IO_HPP diff --git a/boost/gil/extension/io_new/detail/io_device.hpp b/boost/gil/extension/io_new/detail/io_device.hpp new file mode 100644 index 00000000..be8a66af --- /dev/null +++ b/boost/gil/extension/io_new/detail/io_device.hpp @@ -0,0 +1,507 @@ +/* + Copyright 2007-2008 Andreas Pokorny, Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_IO_DEVICE_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_IO_DEVICE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Andreas Pokorny, Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include + +#include +#include "base.hpp" + +namespace boost { namespace gil { namespace detail { + +template < typename T > struct buff_item +{ + static const unsigned int size = sizeof( T ); +}; + +template <> struct buff_item< void > +{ + static const unsigned int size = 1; +}; + + +/*! + * Implements the IODevice concept c.f. to \ref IODevice required by Image libraries like + * libjpeg and libpng. + * + * \todo switch to a sane interface as soon as there is + * something good in boost. I.E. the IOChains library + * would fit very well here. + * + * This implementation is based on FILE*. + */ +template< typename FormatTag > +class file_stream_device +{ +public: + + typedef FormatTag _tag_t; + +public: + struct read_tag {}; + struct write_tag {}; + + file_stream_device( std::string const& file_name, read_tag ) + : file(0),_close(true) + { + io_error_if( ( file = fopen( file_name.c_str(), "rb" )) == NULL + , "file_stream_device: failed to open file" ); + } + + file_stream_device( std::string const& file_name, write_tag ) + : file(0),_close(true) + { + io_error_if( ( file = fopen( file_name.c_str(), "wb" )) == NULL + , "file_stream_device: failed to open file" ); + } + + file_stream_device( FILE * filep) + : file(filep),_close(false) + { + } + + ~file_stream_device() + { + if(_close) + fclose(file); + } + + int getc_unchecked() + { + return std::getc( file ); + } + + char getc() + { + int ch; + + if(( ch = std::getc( file )) == EOF ) + io_error( "file_stream_device: unexpected EOF" ); + + return ( char ) ch; + } + + std::size_t read( byte_t* data + , std::size_t count ) + { + return fread( data, 1, static_cast( count ), file ); + } + + /// Reads array + template< typename T + , int N + > + size_t read( T (&buf)[N] ) + { + return read( buf, N ); + } + + /// Reads byte + uint8_t read_int8() throw() + { + byte_t m[1]; + + read( m ); + return m[0]; + } + + /// Reads 16 bit little endian integer + uint16_t read_int16() throw() + { + byte_t m[2]; + + read( m ); + return (m[1] << 8) | m[0]; + } + + /// Reads 32 bit little endian integer + uint32_t read_int32() throw() + { + byte_t m[4]; + + read( m ); + return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0]; + } + + /// Writes number of elements from a buffer + template < typename T > + size_t write(const T *buf, size_t cnt) throw() + { + return fwrite( buf, buff_item::size, cnt, file ); + } + + /// Writes array + template < typename T + , size_t N + > + size_t write( const T (&buf)[N] ) throw() + { + return write( buf, N ); + } + + /// Writes byte + void write_int8( uint8_t x ) throw() + { + byte_t m[1] = { x }; + write(m); + } + + /// Writes 16 bit little endian integer + void write_int16( uint16_t x ) throw() + { + byte_t m[2]; + + m[0] = byte_t( x >> 0 ); + m[1] = byte_t( x >> 8 ); + + write( m ); + } + + /// Writes 32 bit little endian integer + void write_int32( uint32_t x ) throw() + { + byte_t m[4]; + + m[0] = byte_t( x >> 0 ); + m[1] = byte_t( x >> 8 ); + m[2] = byte_t( x >> 16 ); + m[3] = byte_t( x >> 24 ); + + write( m ); + } + + + //!\todo replace with std::ios::seekdir? + void seek( long count, int whence = SEEK_SET ) + { + fseek(file, count, whence ); + } + + void flush() + { + fflush( file ); + } + + /// Prints formatted ASCII text + void print_line( const std::string& line ) + { + fwrite( line.c_str(), sizeof( char ), line.size(), file ); + } + +private: + + file_stream_device( file_stream_device const& ); + file_stream_device& operator=( file_stream_device const& ); + + //@todo: why not fstream? + FILE* file; + + bool _close; + +}; + + +/** + * Input stream device + */ +template< typename FormatTag > +class istream_device +{ +public: + istream_device( std::istream& in ) + : _in( in ) {} + + int getc_unchecked() + { + return _in.get(); + } + + char getc() + { + int ch; + + if(( ch = _in.get() ) == EOF ) + io_error( "file_stream_device: unexpected EOF" ); + + return ( char ) ch; + } + + std::size_t read( byte_t* data + , std::size_t count ) + { + std::streamsize cr = 0; + + do + { + _in.peek(); + std::streamsize c = _in.readsome( reinterpret_cast< char* >( data ) + , static_cast< std::streamsize >( count )); + + count -= static_cast< std::size_t >( c ); + data += c; + cr += c; + + } while( count && _in ); + + return static_cast< std::size_t >( cr ); + } + + /// Reads array + template< typename T + , int N + > + size_t read( T (&buf)[N] ) + { + return read( buf, N ); + } + + /// Reads byte + uint8_t read_int8() throw() + { + byte_t m[1]; + + read( m ); + return m[0]; + } + + /// Reads 16 bit little endian integer + uint16_t read_int16() throw() + { + byte_t m[2]; + + read( m ); + return (m[1] << 8) | m[0]; + } + + /// Reads 32 bit little endian integer + uint32_t read_int32() throw() + { + byte_t m[4]; + + read( m ); + return (m[3] << 24) | (m[2] << 16) | (m[1] << 8) | m[0]; + } + + void seek( long count, int whence = SEEK_SET ) + { + _in.seekg( count + , whence == SEEK_SET ? std::ios::beg + :( whence == SEEK_CUR ? std::ios::cur + : std::ios::end ) + ); + } + + void write( const byte_t* data + , std::size_t count ) + { + io_error( "Bad io error." ); + } + + void flush() {} + +private: + + std::istream& _in; +}; + +/** + * Output stream device + */ +template< typename FormatTag > +class ostream_device +{ +public: + ostream_device( std::ostream & out ) + : _out( out ) + { + } + + size_t read( byte_t* data + , std::size_t count ) + { + io_error( "Bad io error." ); + + return 0; + } + + void seek( long count, int whence ) + { + _out.seekp( count + , whence == SEEK_SET + ? std::ios::beg + : ( whence == SEEK_CUR + ?std::ios::cur + :std::ios::end ) + ); + } + + void write( const byte_t* data + , std::size_t count ) + { + _out.write( reinterpret_cast( data ) + , static_cast( count ) + ); + } + + /// Writes array + template < typename T + , size_t N + > + void write( const T (&buf)[N] ) throw() + { + write( buf, N ); + } + + /// Writes byte + void write_int8( uint8_t x ) throw() + { + byte_t m[1] = { x }; + write(m); + } + + /// Writes 16 bit little endian integer + void write_int16( uint16_t x ) throw() + { + byte_t m[2]; + + m[0] = byte_t( x >> 0 ); + m[1] = byte_t( x >> 8 ); + + write( m ); + } + + /// Writes 32 bit little endian integer + void write_int32( uint32_t x ) throw() + { + byte_t m[4]; + + m[0] = byte_t( x >> 0 ); + m[1] = byte_t( x >> 8 ); + m[2] = byte_t( x >> 16 ); + m[3] = byte_t( x >> 24 ); + + write( m ); + } + + void flush() + { + _out << std::flush; + } + + /// Prints formatted ASCII text + void print_line( const std::string& line ) + { + _out << line; + } + + + +private: + + std::ostream& _out; +}; + + +/** + * Metafunction to detect input devices. + * Should be replaced by an external facility in the future. + */ +template< typename IODevice > struct is_input_device : mpl::false_{}; +template< typename FormatTag > struct is_input_device< file_stream_device< FormatTag > > : mpl::true_{}; +template< typename FormatTag > struct is_input_device< istream_device< FormatTag > > : mpl::true_{}; + +template< typename FormatTag + , typename T + , typename D = void + > +struct is_adaptable_input_device : mpl::false_{}; + +template< typename FormatTag + , typename T + > +struct is_adaptable_input_device< FormatTag + , T + , typename enable_if< mpl::or_< is_base_and_derived< std::istream, T > + , is_same < std::istream, T > + > + >::type + > : mpl::true_ +{ + typedef istream_device< FormatTag > device_type; +}; + +template< typename FormatTag > +struct is_adaptable_input_device< FormatTag + , FILE* + , void + > + : mpl::true_ +{ + typedef file_stream_device< FormatTag > device_type; +}; + + + +/** + * Metafunction to detect output devices. + * Should be replaced by an external facility in the future. + */ +template struct is_output_device : mpl::false_{}; + +template< typename FormatTag > struct is_output_device< file_stream_device< FormatTag > > : mpl::true_{}; +template< typename FormatTag > struct is_output_device< ostream_device < FormatTag > > : mpl::true_{}; + +template< typename FormatTag + , typename IODevice + , typename D = void + > +struct is_adaptable_output_device : mpl::false_ {}; + +template< typename FormatTag + , typename T + > struct is_adaptable_output_device< FormatTag + , T + , typename enable_if< mpl::or_< is_base_and_derived< std::ostream, T > + , is_same < std::ostream, T > + > + >::type + > : mpl::true_ +{ + typedef ostream_device< FormatTag > device_type; +}; + +template struct is_adaptable_output_device + : mpl::true_ +{ + typedef file_stream_device< FormatTag > device_type; +}; + +template< typename Device, typename FormatTag, typename ConversionPolicy > class reader; +template< typename Device, typename FormatTag, typename Log = no_log > class writer; + +template< typename Device, typename FormatTag > class dynamic_image_reader; +template< typename Device, typename FormatTag, typename Log = no_log > class dynamic_image_writer; +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_IO_DEVICE_HPP diff --git a/boost/gil/extension/io_new/detail/io_error.hpp b/boost/gil/extension/io_new/detail/io_error.hpp new file mode 100644 index 00000000..b6c6e11a --- /dev/null +++ b/boost/gil/extension/io_new/detail/io_error.hpp @@ -0,0 +1,41 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_IO_ERROR_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_IO_ERROR_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2010 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +namespace boost { namespace gil { namespace detail { + +inline +void io_error( const std::string& descr ) +{ + throw std::ios_base::failure( descr ); +} + +inline +void io_error_if( bool expr, const std::string& descr ) +{ + if( expr ) + io_error( descr ); +} + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_IO_ERROR_HPP \ No newline at end of file diff --git a/boost/gil/extension/io_new/detail/path_spec.hpp b/boost/gil/extension/io_new/detail/path_spec.hpp new file mode 100644 index 00000000..9a6c030e --- /dev/null +++ b/boost/gil/extension/io_new/detail/path_spec.hpp @@ -0,0 +1,79 @@ +/* + Copyright 2007-2008 Andreas Pokorny, Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_PATH_SPEC_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_PATH_SPEC_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Andreas Pokorny, Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#ifdef BOOST_GIL_IO_ADD_FS_PATH_SUPPORT +#include +#endif // BOOST_GIL_IO_ADD_FS_PATH_SUPPORT +namespace boost{ namespace gil{ namespace detail{ + +template struct is_supported_path_spec : mpl::false_ {}; +template<> struct is_supported_path_spec< std::string > : mpl::true_ {}; +template<> struct is_supported_path_spec< std::wstring > : mpl::true_ {}; +template<> struct is_supported_path_spec< const char* > : mpl::true_ {}; +template<> struct is_supported_path_spec< char* > : mpl::true_ {}; + +template struct is_supported_path_spec : mpl::true_ {}; +template struct is_supported_path_spec : mpl::true_ {}; + +#ifdef BOOST_GIL_IO_ADD_FS_PATH_SUPPORT +template +struct is_supported_path_spec > : mpl::true_ +{}; +#endif // BOOST_GIL_IO_ADD_FS_PATH_SUPPORT + +inline std::string convert_to_string( std::string const& obj) +{ + return obj; +} + +inline std::string convert_to_string( std::wstring const& s ) +{ + std::size_t len = wcslen( s.c_str() ); + char* c = reinterpret_cast( alloca( len )); + wcstombs( c, s.c_str(), len ); + + return std::string( c, c + len ); +} + +inline std::string convert_to_string( const char* str ) +{ + return std::string( str ); +} + +inline std::string convert_to_string( char* str ) +{ + return std::string( str ); +} + +#ifdef BOOST_GIL_IO_ADD_FS_PATH_SUPPORT +template +inline std::string convert_to_string( filesystem::basic_path const& path ) +{ + return convert_to_string( path.string() ); +} +#endif // BOOST_GIL_IO_ADD_FS_PATH_SUPPORT + +}}} + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_PATH_SPEC_HPP diff --git a/boost/gil/extension/io_new/detail/read_and_convert_image.hpp b/boost/gil/extension/io_new/detail/read_and_convert_image.hpp new file mode 100644 index 00000000..46e50c0c --- /dev/null +++ b/boost/gil/extension/io_new/detail/read_and_convert_image.hpp @@ -0,0 +1,320 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_READ_AND_CONVERT_IMAGE_HPP +#define BOOST_GIL_EXTENSION_IO_READ_AND_CONVERT_IMAGE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include "base.hpp" +#include "io_device.hpp" +#include "path_spec.hpp" +#include "conversion_policies.hpp" + +namespace boost{ namespace gil { + +/// \ingroup IO + +/// \brief Reads and color-converts an image. Image memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction. +/// \param img The image in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \param cc Color converter function object. +/// \throw std::ios_base::failure +template< typename Device + , typename Image + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_image( Device& file + , Image& img + , const image_read_settings< FormatTag >& settings + , const ColorConverter& cc + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_input_device< Device > + > + >::type* /* ptr */ = 0 + ) +{ + typedef detail::read_and_convert< ColorConverter > reader_color_convert; + + detail::reader< Device + , FormatTag + , reader_color_convert + > reader( file + , cc + , settings + ); + + reader.init_image( img + , reader.get_info() + ); + + reader.apply( view( img )); +} + +/// \brief Reads and color-converts an image. Image memory is allocated. +/// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. +/// \param img The image in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \param cc Color converter function object. +/// \throw std::ios_base::failure +template< typename Device + , typename Image + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_image( Device& file + , Image& img + , const image_read_settings< FormatTag >& settings + , const ColorConverter& cc + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_adaptable_input_device< FormatTag + , Device + > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_input_device< FormatTag + , Device + >::device_type device_type; + device_type dev( file ); + + read_and_convert_image( dev + , img + , settings + , cc + ); +} + +/// \brief Reads and color-converts an image. Image memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param img The image in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \param cc Color converter function object. +/// \throw std::ios_base::failure +template < typename String + , typename Image + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_image( const String& file_name + , Image& img + , const image_read_settings< FormatTag >& settings + , const ColorConverter& cc + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device< FormatTag > device( detail::convert_to_string( file_name ) + , typename detail::file_stream_device< FormatTag >::read_tag() + ); + + read_and_convert_image( device + , img + , settings + , cc + ); +} + +/// \brief Reads and color-converts an image. Image memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param img The image in which the data is read into. +/// \param cc Color converter function object. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename String + , typename Image + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_image( const String& file_name + , Image& img + , const ColorConverter& cc + , const FormatTag& + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_image( file_name + , img + , image_read_settings< FormatTag >() + , cc + ); +} + +/// \brief Reads and color-converts an image. Image memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction or is_adaptable_input_device. +/// \param img The image in which the data is read into. +/// \param cc Color converter function object. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename Device + , typename Image + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_image( Device& device + , Image& img + , const ColorConverter& cc + , const FormatTag& + , typename enable_if< mpl::and_< mpl::or_< detail::is_input_device< Device > + , detail::is_adaptable_input_device< FormatTag + , Device + > + > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_image( device + , img + , image_read_settings< FormatTag >() + , cc + ); +} + +/// \brief Reads and color-converts an image. Image memory is allocated. Default color converter is used. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param img The image in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename String + , typename Image + , typename FormatTag + > +inline +void read_and_convert_image( const String& file_name + , Image& img + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_image( file_name + , img + , settings + , default_color_converter() + ); +} + +/// \brief Reads and color-converts an image. Image memory is allocated. Default color converter is used. +/// \param file It's a device. Must satisfy is_input_device metafunction or is_adaptable_input_device. +/// \param img The image in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename Device + , typename Image + , typename FormatTag + > +inline +void read_and_convert_image( Device& device + , Image& img + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< mpl::or_< detail::is_input_device< Device > + , detail::is_adaptable_input_device< FormatTag + , Device + > + > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_image( device + , img + , settings + , default_color_converter() + ); +} + +/// \brief Reads and color-converts an image. Image memory is allocated. Default color converter is used. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param img The image in which the data is read into. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename String + , typename Image + , typename FormatTag + > +inline +void read_and_convert_image( const String& file_name + , Image& img + , const FormatTag& + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_image( file_name + , img + , image_read_settings< FormatTag >() + , default_color_converter() + ); +} + +/// \brief Reads and color-converts an image. Image memory is allocated. Default color converter is used. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param img The image in which the data is read into. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename Device + , typename Image + , typename FormatTag + > +inline +void read_and_convert_image( Device& device + , Image& img + , const FormatTag& + , typename enable_if< mpl::and_< mpl::or_< detail::is_input_device< Device > + , detail::is_adaptable_input_device< FormatTag + , Device + > + > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_image( device + , img + , image_read_settings< FormatTag >() + , default_color_converter() + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_READ_AND_CONVERT_IMAGE_HPP diff --git a/boost/gil/extension/io_new/detail/read_and_convert_view.hpp b/boost/gil/extension/io_new/detail/read_and_convert_view.hpp new file mode 100644 index 00000000..b60a1020 --- /dev/null +++ b/boost/gil/extension/io_new/detail/read_and_convert_view.hpp @@ -0,0 +1,321 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_READ_AND_CONVERT_VIEW_HPP +#define BOOST_GIL_EXTENSION_IO_READ_AND_CONVERT_VIEW_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include "base.hpp" +#include "io_device.hpp" +#include "path_spec.hpp" +#include "conversion_policies.hpp" + +namespace boost{ namespace gil { + +/// \ingroup IO + +/// \brief Reads and color-converts an image view. No memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction. +/// \param view The image view in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \param cc Color converter function object. +/// \throw std::ios_base::failure +template< typename Device + , typename View + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_view( Device& file + , const View& view + , const image_read_settings< FormatTag >& settings + , const ColorConverter& cc + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_input_device< Device > + > + >::type* /* ptr */ = 0 + ) +{ + typedef detail::read_and_convert< ColorConverter > reader_color_convert; + + detail::reader< Device + , FormatTag + , reader_color_convert + > reader( file + , cc + , settings + ); + + reader.init_view( view + , reader.get_info() + ); + + reader.apply( view ); +} + +/// \brief Reads and color-converts an image view. No memory is allocated. +/// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. +/// \param view The image view in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \param cc Color converter function object. +/// \throw std::ios_base::failure +template< typename Device + , typename View + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_view( Device& file + , const View& view + , const image_read_settings< FormatTag >& settings + , const ColorConverter& cc + , typename enable_if< mpl::and_< detail::is_adaptable_input_device< FormatTag + , Device + > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_input_device< FormatTag + , Device + >::device_type device_type; + + device_type dev( file ); + + read_and_convert_view( dev + , view + , settings + , cc + ); +} + +/// \brief Reads and color-converts an image view. No memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param view The image view in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \param cc Color converter function object. +/// \throw std::ios_base::failure +template < typename String + , typename View + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_view( const String& file_name + , const View& view + , const image_read_settings< FormatTag >& settings + , const ColorConverter& cc + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device< FormatTag > device( detail::convert_to_string( file_name ) + , typename detail::file_stream_device< FormatTag >::read_tag() + ); + + read_and_convert_view( device + , view + , settings + , cc + ); +} + +/// \brief Reads and color-converts an image view. No memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param view The image view in which the data is read into. +/// \param cc Color converter function object. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename String + , typename View + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_view( const String& file_name + , const View& view + , const ColorConverter& cc + , const FormatTag& + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_view( file_name + , view + , image_read_settings< FormatTag >() + , cc + ); +} + +/// \brief Reads and color-converts an image view. No memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction or is_adaptable_input_device. +/// \param view The image view in which the data is read into. +/// \param cc Color converter function object. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename Device + , typename View + , typename ColorConverter + , typename FormatTag + > +inline +void read_and_convert_view( Device& device + , const View& view + , const ColorConverter& cc + , const FormatTag& + , typename enable_if< mpl::and_< mpl::or_< detail::is_input_device< Device > + , detail::is_adaptable_input_device< FormatTag + , Device + > + > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_view( device + , view + , image_read_settings< FormatTag >() + , cc + ); +} + +/// \brief Reads and color-converts an image view. No memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param view The image view in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename String + , typename View + , typename FormatTag + > +inline +void read_and_convert_view( const String& file_name + , const View& view + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_view( file_name + , view + , settings + , default_color_converter() + ); +} + +/// \brief Reads and color-converts an image view. No memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction or is_adaptable_input_device. +/// \param view The image view in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename Device + , typename View + , typename FormatTag + > +inline +void read_and_convert_view( Device& device + , const View& view + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< mpl::or_< detail::is_input_device< Device > + , detail::is_adaptable_input_device< FormatTag + , Device + > + > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_view( device + , view + , settings + , default_color_converter() + ); +} + +/// \brief Reads and color-converts an image view. No memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param view The image view in which the data is read into. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename String + , typename View + , typename FormatTag + > +inline +void read_and_convert_view( const String& file_name + , const View& view + , const FormatTag& + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_view( file_name + , view + , image_read_settings< FormatTag >() + , default_color_converter() + ); +} + +/// \brief Reads and color-converts an image view. No memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction or is_adaptable_input_device. +/// \param view The image view in which the data is read into. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename Device + , typename View + , typename FormatTag + > +inline +void read_and_convert_view( Device& device + , const View& view + , const FormatTag& + , typename enable_if< mpl::and_< mpl::or_< detail::is_input_device< Device > + , detail::is_adaptable_input_device< FormatTag + , Device + > + > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + read_and_convert_view( device + , view + , image_read_settings< FormatTag >() + , default_color_converter() + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_READ_AND_CONVERT_VIEW_HPP diff --git a/boost/gil/extension/io_new/detail/read_image.hpp b/boost/gil/extension/io_new/detail/read_image.hpp new file mode 100644 index 00000000..09d92f84 --- /dev/null +++ b/boost/gil/extension/io_new/detail/read_image.hpp @@ -0,0 +1,437 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_READ_IMAGE_HPP +#define BOOST_GIL_EXTENSION_IO_READ_IMAGE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include + +#include "base.hpp" +#include "io_device.hpp" +#include "path_spec.hpp" +#include "conversion_policies.hpp" + +namespace boost{ namespace gil { + +/// \ingroup IO + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction. +/// \param img The image in which the data is read into. Must satisfy is_read_supported metafunction. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename Device + , typename Image + , typename FormatTag + > +inline +void read_image( Device& file + , Image& img + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< detail::is_input_device< Device > + , is_format_tag < FormatTag > + , is_read_supported < typename get_pixel_type< typename Image::view_t >::type + , FormatTag + > + > + >::type* /* ptr */ = 0 + ) +{ + detail::reader< Device + , FormatTag + , detail::read_and_no_convert + > reader( file + , settings + ); + + reader.init_image( img + , reader.get_info() + ); + + reader.apply( view( img )); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. +/// \param img The image in which the data is read into. Must satisfy is_read_supported metafunction. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename Device + , typename Image + , typename FormatTag + > +inline +void read_image( Device& file + , Image& img + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< detail::is_adaptable_input_device< FormatTag + , Device + > + , is_format_tag< FormatTag > + , is_read_supported< typename get_pixel_type< typename Image::view_t >::type + , FormatTag + > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_input_device< FormatTag + , Device + >::device_type device_type; + + device_type dev(file); + detail::reader< device_type + , FormatTag + , detail::read_and_no_convert + > reader( dev + , settings + ); + + reader.init_image( img + , reader.get_info() + ); + + reader.apply( view( img )); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param img The image in which the data is read into. Must satisfy is_read_supported metafunction. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename String + , typename Image + , typename FormatTag + > +inline +void read_image( const String& file_name + , Image& img + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< detail::is_supported_path_spec< String > + , is_format_tag< FormatTag > + , is_read_supported< typename get_pixel_type< typename Image::view_t >::type + , FormatTag + > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::file_stream_device::read_tag read_tag; + + detail::file_stream_device device( detail::convert_to_string( file_name ) + , read_tag() + ); + + read_image( device + , img + , settings + ); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction. +/// \param img The image in which the data is read into. Must satisfy is_read_supported metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename Device + , typename Image + , typename FormatTag + > +inline +void read_image( Device& file + , Image& img + , const FormatTag& + , typename enable_if< mpl::and_< detail::is_input_device< Device > + , is_format_tag < FormatTag > + , is_read_supported < typename get_pixel_type< typename Image::view_t >::type + , FormatTag + > + > + >::type* /* ptr */ = 0 + ) +{ + read_image( file + , img + , image_read_settings< FormatTag >() + ); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. +/// \param img The image in which the data is read into. Must satisfy is_read_supported metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename Device + , typename Image + , typename FormatTag + > +inline +void read_image( Device& file + , Image& img + , const FormatTag& + , typename enable_if< mpl::and_< detail::is_adaptable_input_device< FormatTag + , Device + > + , is_format_tag< FormatTag > + , is_read_supported< typename get_pixel_type< typename Image::view_t >::type + , FormatTag + > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_input_device< FormatTag, Device >::device_type device_type; + device_type dev( file ); + + read_image( dev + , img + , image_read_settings< FormatTag >() + ); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param img The image in which the data is read into. Must satisfy is_read_supported metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename String + , typename Image + , typename FormatTag + > +inline +void read_image( const String& file_name + , Image& img + , const FormatTag& + , typename enable_if< mpl::and_< detail::is_supported_path_spec< String > + , is_format_tag< FormatTag > + , is_read_supported< typename get_pixel_type< typename Image::view_t >::type + , FormatTag + > + > + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device< FormatTag > device( detail::convert_to_string( file_name ) + , typename detail::file_stream_device< FormatTag >::read_tag() + ); + + read_image( device + , img + , image_read_settings< FormatTag >() + ); +} + +///////////////////////////// dynamic images + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction. +/// \param images Dynamic image ( mpl::vector ). See boost::gil::dynamic_image extension. +/// \param settings Specifies read settings depending on the image format. +template < typename Device + , typename Images + , typename FormatTag + > +inline +void read_image( Device& file + , any_image< Images >& images + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< detail::is_input_device< Device > + , is_format_tag < FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + detail::dynamic_image_reader< Device + , FormatTag + > dyn_reader( file + , settings + ); + + dyn_reader.init_image( images + , dyn_reader.get_info() + ); + + dyn_reader.apply( images ); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. +/// \param images Dynamic image ( mpl::vector ). See boost::gil::dynamic_image extension. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure + +template < typename Device + , typename Images + , typename FormatTag + > +inline +void read_image( Device& file + , any_image< Images >& images + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< detail::is_adaptable_input_device< FormatTag + , Device + > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_input_device< FormatTag + , Device + >::device_type device_type; + device_type dev( file ); + + detail::reader< device_type + , FormatTag + , detail::read_and_no_convert + > reader( dev + , settings + ); + + reader.init_image( images + , reader.get_info + ); + + reader.apply( view( images )); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param images Dynamic image ( mpl::vector ). See boost::gil::dynamic_image extension. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename String + , typename Images + , typename FormatTag + > +inline +void read_image( const String& file_name + , any_image< Images >& images + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< detail::is_supported_path_spec< String > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::file_stream_device< FormatTag >::read_tag read_tag; + + detail::file_stream_device device( detail::convert_to_string( file_name ) + , read_tag() + ); + + read_image( device + , images + , settings + ); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction. +/// \param images Dynamic image ( mpl::vector ). See boost::gil::dynamic_image extension. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename Device + , typename Images + , typename FormatTag + > +inline +void read_image( Device& file + , any_image< Images >& images + , const FormatTag& + , typename enable_if< mpl::and_< detail::is_input_device< Device > + , is_format_tag < FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + read_image( file + , images + , image_read_settings< FormatTag >() + ); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. +/// \param images Dynamic image ( mpl::vector ). See boost::gil::dynamic_image extension. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename Device + , typename Images + , typename FormatTag + > +inline +void read_image( Device& file + , any_image< Images >& images + , const FormatTag& + , typename enable_if< mpl::and_< detail::is_adaptable_input_device< FormatTag + , Device + > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_input_device< FormatTag + , Device + >::device_type device_type; + device_type dev( file ); + + read_image( dev + , images + , image_read_settings< FormatTag >() + ); +} + +/// \brief Reads an image without conversion. Image memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param images Dynamic image ( mpl::vector ). See boost::gil::dynamic_image extension. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename String + , typename Images + , typename FormatTag + > +inline +void read_image( const String& file_name + , any_image< Images >& images + , const FormatTag& + , typename enable_if< mpl::and_< detail::is_supported_path_spec< String > + , is_format_tag< FormatTag > + > + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device< FormatTag > device( detail::convert_to_string( file_name ) + , typename detail::file_stream_device< FormatTag >::read_tag() + ); + + read_image( device + , images + , image_read_settings< FormatTag >() + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_READ_IMAGE_HPP diff --git a/boost/gil/extension/io_new/detail/read_image_info.hpp b/boost/gil/extension/io_new/detail/read_image_info.hpp new file mode 100644 index 00000000..4c721cd1 --- /dev/null +++ b/boost/gil/extension/io_new/detail/read_image_info.hpp @@ -0,0 +1,206 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_IMAGE_READ_INFO_HPP +#define BOOST_GIL_EXTENSION_IO_IMAGE_READ_INFO_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include "base.hpp" +#include "io_device.hpp" +#include "path_spec.hpp" + +namespace boost{ namespace gil { + +/// \ingroup IO + +/// \brief Returns the image info. Image info is file format specific. +/// \param file It's a device. Must satisfy is_input_device metafunction. +/// \param settings Specifies read settings depending on the image format. +/// \return image_read_info object dependent on the image format. +/// \throw std::ios_base::failure +template< typename Device + , typename FormatTag + > +inline +image_read_info< FormatTag > +read_image_info( Device& file + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_input_device< Device > + > + >::type* /* ptr */ = 0 + ) +{ + return detail::reader< Device + , FormatTag + , detail::read_and_no_convert + >( file + , settings + ).get_info(); +} + +/// \brief Returns the image info. Image info is file format specific. +/// \param file It's a device. Must satisfy is_input_device metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \return image_read_info object dependent on the image format. +/// \throw std::ios_base::failure +template< typename Device + , typename FormatTag + > +inline +image_read_info< FormatTag > +read_image_info( Device& file + , const FormatTag& + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_input_device< Device > + > + >::type* /* ptr */ = 0 + ) +{ + return read_image_info( file + , image_read_settings< FormatTag >() + ); +} + + +/// \brief Returns the image info. Image info is file format specific. +/// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. +/// \param settings Specifies read settings depending on the image format. +/// \return image_read_info object dependent on the image format. +/// \throw std::ios_base::failure +template< typename Device + , typename FormatTag + > +inline +image_read_info +read_image_info( Device& file + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_adaptable_input_device< FormatTag + , Device + > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_input_device< FormatTag + , Device + >::device_type device_type; + + device_type dev( file ); + + return detail::reader< device_type + , FormatTag + , detail::read_and_no_convert + >( dev + , settings + ).get_info(); +} + +/// \brief Returns the image info. Image info is file format specific. +/// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \return image_read_info object dependent on the image format. +/// \throw std::ios_base::failure +template< typename Device + , typename FormatTag + > +inline +image_read_info< FormatTag > +read_image_info( Device& file + , const FormatTag& + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_adaptable_input_device< FormatTag + , Device + > + > + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_input_device< FormatTag + , Device + >::device_type device_type; + + device_type dev( file ); + + return read_image_info( dev + , image_read_settings< FormatTag >() + ); +} + +/// \brief Returns the image info. Image info is file format specific. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param settings Specifies read settings depending on the image format. +/// \return image_read_info object dependent on the image format. +/// \throw std::ios_base::failure +template< typename String + , typename FormatTag + > +inline +image_read_info< FormatTag > +read_image_info( const String& file_name + , const image_read_settings< FormatTag >& settings + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device< FormatTag > reader( detail::convert_to_string( file_name ) + , typename detail::file_stream_device< FormatTag >::read_tag() + ); + + return read_image_info( reader + , settings + ); +} + +/// \brief Returns the image info. Image info is file format specific. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \return image_read_info object dependent on the image format. +/// \throw std::ios_base::failure +template< typename String + , typename FormatTag + > +inline +image_read_info< FormatTag > +read_image_info( const String& file_name + , const FormatTag& + , typename enable_if< mpl::and_< is_format_tag< FormatTag > + , detail::is_supported_path_spec< String > + > + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device< FormatTag > reader( detail::convert_to_string( file_name ) + , typename detail::file_stream_device< FormatTag >::read_tag() + ); + + return read_image_info( reader + , image_read_settings< FormatTag >() + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_IMAGE_READ_INFO_HPP diff --git a/boost/gil/extension/io_new/detail/read_view.hpp b/boost/gil/extension/io_new/detail/read_view.hpp new file mode 100644 index 00000000..8ffe5ea3 --- /dev/null +++ b/boost/gil/extension/io_new/detail/read_view.hpp @@ -0,0 +1,209 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_READ_VIEW_HPP +#define BOOST_GIL_EXTENSION_IO_READ_VIEW_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include "base.hpp" +#include "io_device.hpp" +#include "path_spec.hpp" + +namespace boost{ namespace gil { + +/// \ingroup IO + +/// \brief Reads an image view without conversion. No memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction. +/// \param view The image view in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename Device + , typename View + , typename FormatTag + > +inline +void read_view( Device& file + , const View& view + , const image_read_settings< FormatTag >& settings + , typename enable_if< typename mpl::and_< typename detail::is_input_device< Device >::type + , typename is_format_tag < FormatTag >::type + , typename is_read_supported < typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::reader< Device + , FormatTag + , detail::read_and_no_convert + > reader( file + , settings + ); + + reader.init_view( view + , reader.get_info() + ); + + reader.apply( view ); +} + +/// \brief Reads an image view without conversion. No memory is allocated. +/// \param file It's a device. Must satisfy is_adaptable_input_device metafunction. +/// \param view The image view in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename Device + , typename View + , typename FormatTag + > +inline +void read_view( Device& file + , const View& view + , const image_read_settings< FormatTag >& settings + , typename enable_if< typename mpl::and_< typename detail::is_adaptable_input_device< FormatTag + , Device + >::type + , typename is_format_tag::type + , typename is_read_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_input_device< FormatTag + , Device + >::device_type device_type; + + device_type dev( file ); + + detail::reader< device_type + , FormatTag + , detail::read_and_no_convert + > reader( dev + , settings + ); + + reader.init_view( view + , reader.get_info() + ); + + reader.apply( view ); +} + +/// \brief Reads an image view without conversion. No memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param view The image view in which the data is read into. +/// \param settings Specifies read settings depending on the image format. +/// \throw std::ios_base::failure +template < typename String + , typename View + , typename FormatTag + > +inline +void read_view( const String& file_name + , const View& view + , const image_read_settings< FormatTag >& settings + , typename enable_if< typename mpl::and_< typename detail::is_supported_path_spec< String >::type + , typename is_format_tag< FormatTag >::type + , typename is_read_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device device( detail::convert_to_string( file_name ) + , typename detail::file_stream_device< FormatTag >::read_tag() + ); + + read_view( device + , view + , settings + ); +} + +/// \brief Reads an image view without conversion. No memory is allocated. +/// \param file_name File name. Must satisfy is_supported_path_spec metafunction. +/// \param view The image view in which the data is read into. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template < typename String + , typename View + , typename FormatTag + > +inline +void read_view( const String& file_name + , const View& view + , const FormatTag& + , typename enable_if< typename mpl::and_< typename detail::is_supported_path_spec< String >::type + , typename is_format_tag< FormatTag >::type + , typename is_read_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + read_view( file_name + , view + , image_read_settings< FormatTag >() + ); +} + +/// \brief Reads an image view without conversion. No memory is allocated. +/// \param file It's a device. Must satisfy is_input_device metafunction or is_adaptable_input_device. +/// \param view The image view in which the data is read into. +/// \param tag Defines the image format. Must satisfy is_format_tag metafunction. +/// \throw std::ios_base::failure +template< typename Device + , typename View + , typename FormatTag + > +inline +void read_view( Device& device + , const View& view + , const FormatTag& + , typename enable_if< typename mpl::and_< typename is_format_tag< FormatTag >::type + , typename mpl::or_< typename detail::is_input_device< Device >::type + , typename detail::is_adaptable_input_device< FormatTag + , Device + >::type + >::type + , typename is_read_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + read_view( device + , view + , image_read_settings< FormatTag >() + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_READ_VIEW_HPP diff --git a/boost/gil/extension/io_new/detail/reader_base.hpp b/boost/gil/extension/io_new/detail/reader_base.hpp new file mode 100644 index 00000000..a8d6abd2 --- /dev/null +++ b/boost/gil/extension/io_new/detail/reader_base.hpp @@ -0,0 +1,140 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_READER_BASE_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_READER_BASE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "base.hpp" + +namespace boost { namespace gil { namespace detail { + +/// Reader Base Class +/// +/// It provides some basic functionality which is shared for all readers. +/// For instance, it recreates images when necessary. It checks whether +/// user supplied coordinates are valid. +/// +/// @tparam FormatTag A format tag, like jpeg_tag. +/// @tparam ConversionPolicy Conversion policy, see coversion_policies.hpp. +template< typename FormatTag + , typename ConversionPolicy + > +struct reader_base +{ +public: + + /// Initializes an image. But also does some check ups. + /// + /// @tparam Image Image which implements boost::gil's ImageConcept. + /// + /// @param img The image. + /// @param info The image read info. + template< typename Image > + void init_image( Image& img + , const image_read_info< FormatTag >& info + ) + { + _info = info; + + setup( _settings._dim ); + + img.recreate( _settings._dim.x + , _settings._dim.y + ); + } + + template< typename View > + void init_view( const View& view + , const image_read_info< FormatTag >& info + ) + { + _info = info; + + setup( view.dimensions() ); + } + +protected: + + reader_base( const image_read_settings< FormatTag >& settings ) + : _settings( settings ) + {} + reader_base( const typename ConversionPolicy::color_converter_type& cc + , const image_read_settings< FormatTag >& settings + ) + : _settings( settings ) + , _cc_policy( cc ) + {} + +private: + + void setup( const point_t& dim ) + { + check_coordinates( dim ); + + if( dim == point_t( 0, 0 )) + { + _settings._dim.x = _info._width; + _settings._dim.y = _info._height; + } + else + { + _settings._dim = dim; + } + } + + void check_coordinates( const point_t& dim ) + { + typedef point_t::value_type int_t; + + int_t width = static_cast< int_t >( _info._width ); + int_t height = static_cast< int_t >( _info._height ); + + io_error_if( ( _settings._top_left.x < 0 + || _settings._top_left.y < 0 + || dim.x < 0 + || dim.y < 0 + ) + , "User provided view has incorrect size." ); + + + io_error_if( ( ( width ) < _settings._top_left.x + && ( width ) <= dim.x + && ( height ) < _settings._top_left.y + && ( height ) <= dim.y ) + , "User provided view has incorrect size." ); + + io_error_if( ( ( _settings._top_left.x + dim.x ) > width + || ( _settings._top_left.y + dim.y ) > height + ) + , "User provided view has incorrect size." ); + + } + +protected: + + image_read_settings< FormatTag > _settings; + image_read_info< FormatTag > _info; + + ConversionPolicy _cc_policy; +}; + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_READER_BASE_HPP diff --git a/boost/gil/extension/io_new/detail/row_buffer_helper.hpp b/boost/gil/extension/io_new/detail/row_buffer_helper.hpp new file mode 100644 index 00000000..1e1752f1 --- /dev/null +++ b/boost/gil/extension/io_new/detail/row_buffer_helper.hpp @@ -0,0 +1,154 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_READ_HELPER_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_READ_HELPER_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief Helper for having one read implementation used for +/// bit_aligned and byte images. +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include "typedefs.hpp" + + +namespace boost { namespace gil { namespace detail { + +template< typename Pixel + , typename DummyT = void + > +struct row_buffer_helper +{ + typedef Pixel element_t; + typedef std::vector< element_t > buffer_t; + typedef typename buffer_t::iterator iterator_t; + + row_buffer_helper( std::size_t width + , bool + ) + : _row_buffer( width ) + {} + + element_t* data() { return &_row_buffer[0]; } + + iterator_t begin() { return _row_buffer.begin(); } + iterator_t end() { return _row_buffer.end(); } + + buffer_t& buffer() { return _row_buffer; } + +private: + + buffer_t _row_buffer; +}; + +template +struct row_buffer_helper< Pixel + , typename enable_if< typename mpl::and_< typename is_bit_aligned< Pixel >::type + , typename is_homogeneous< Pixel >::type + >::type + >::type + > +{ + typedef byte_t element_t; + typedef std::vector< element_t > buffer_t; + typedef Pixel pixel_type; + typedef bit_aligned_pixel_iterator iterator_t; + + row_buffer_helper( std::size_t width + , bool in_bytes + ) + : _c( ( width + * num_channels< pixel_type >::type::value + * channel_type< pixel_type >::type::num_bits + ) + >> 3 + ) + + , _r( width + * num_channels< pixel_type >::type::value + * channel_type< pixel_type >::type::num_bits + - ( _c << 3 ) + ) + { + if( in_bytes ) + { + _row_buffer.resize( width ); + } + else + { + // add one byte if there are remaining bits + _row_buffer.resize( _c + ( _r!=0 )); + } + } + + element_t* data() { return &_row_buffer[0]; } + + iterator_t begin() { return iterator_t( &_row_buffer.front(),0 ); } + iterator_t end() { return _r == 0 ? iterator_t( &_row_buffer.back() + 1, 0 ) + : iterator_t( &_row_buffer.back() , (int) _r ); + } + + buffer_t& buffer() { return _row_buffer; } + +private: + + // For instance 25 pixels of rgb2 type would be: + // overall 25 pixels * 3 channels * 2 bits/channel = 150 bits + // c = 18 bytes + // r = 6 bits + + std::size_t _c; // number of full bytes + std::size_t _r; // number of remaining bits + + buffer_t _row_buffer; +}; + +template< typename View + , typename D = void + > +struct row_buffer_helper_view : row_buffer_helper< typename View::value_type > +{ + row_buffer_helper_view( std::size_t width + , bool in_bytes + ) + : row_buffer_helper< typename View::value_type >( width + , in_bytes + ) + {} +}; + + +template< typename View > +struct row_buffer_helper_view< View + , typename enable_if< typename is_bit_aligned< typename View::value_type + >::type + >::type + > : row_buffer_helper< typename View::reference > +{ + row_buffer_helper_view( std::size_t width + , bool in_bytes + ) + : row_buffer_helper< typename View::reference >( width + , in_bytes + ) + {} +}; + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_READ_HELPER_HPP diff --git a/boost/gil/extension/io_new/detail/typedefs.hpp b/boost/gil/extension/io_new/detail/typedefs.hpp new file mode 100644 index 00000000..45b79d2d --- /dev/null +++ b/boost/gil/extension/io_new/detail/typedefs.hpp @@ -0,0 +1,87 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BASE_HPP +#define BOOST_GIL_EXTENSION_IO_BASE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include + +#include +#include + +#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA +#include +#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA + +namespace boost { namespace gil { + +struct double_zero { static double apply() { return 0.0; } }; +struct double_one { static double apply() { return 1.0; } }; + +typedef scoped_channel_value< double, double_zero, double_one > bits64f; + +typedef unsigned char byte_t; +typedef std::vector< byte_t > byte_vector_t; + +typedef point2< std::ptrdiff_t > point_t; + +} // namespace gil +} // namespace boost + +namespace boost { + +template<> struct is_floating_point< gil::bits32f > : mpl::true_ {}; +template<> struct is_floating_point< gil::bits64f > : mpl::true_ {}; + +} // namespace boost + +namespace boost { namespace gil { namespace detail { + +///@todo We should use boost::preprocessor here. + +typedef bit_aligned_image1_type< 1, gray_layout_t >::type gray1_image_t; +typedef bit_aligned_image1_type< 2, gray_layout_t >::type gray2_image_t; +typedef bit_aligned_image1_type< 4, gray_layout_t >::type gray4_image_t; + +typedef pixel< double, gray_layout_t > gray64f_pixel_t; +#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA +typedef pixel< double, gray_alpha_layout_t > gray_alpha64f_pixel_t; +#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA +typedef pixel< double, rgb_layout_t > rgb64f_pixel_t; +typedef pixel< double, rgba_layout_t > rgba64f_pixel_t; + +typedef image< gray64f_pixel_t , false > gray64f_image_t; + +#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA +typedef image< gray_alpha32f_pixel_t, false > gray_alpha32f_image_t; +typedef image< gray_alpha32f_pixel_t, true > gray_alpha32f_planar_image_t; +typedef image< gray_alpha64f_pixel_t, false > gray_alpha64f_image_t; +typedef image< gray_alpha64f_pixel_t, true > gray_alpha64f_planar_image_t; +#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA +typedef image< rgb64f_pixel_t , false > rgb64f_image_t; +typedef image< rgb64f_pixel_t , true > rgb64f_planar_image_t; +typedef image< rgba64f_pixel_t , false > rgba64f_image_t; +typedef image< rgba64f_pixel_t , true > rgba64f_planar_image_t; + +} // namespace details +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_BASE_HPP diff --git a/boost/gil/extension/io_new/detail/write_view.hpp b/boost/gil/extension/io_new/detail/write_view.hpp new file mode 100644 index 00000000..9e0fd50c --- /dev/null +++ b/boost/gil/extension/io_new/detail/write_view.hpp @@ -0,0 +1,366 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_WRITE_VIEW_HPP +#define BOOST_GIL_EXTENSION_IO_WRITE_VIEW_HPP + +#include +#include +#include +#include + +#include "base.hpp" +#include "io_device.hpp" +#include "path_spec.hpp" +#include "conversion_policies.hpp" + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +namespace boost{ namespace gil { + +/// \ingroup IO +template< typename Device + , typename View + , typename FormatTag + > +inline +void write_view( Device& device + , const View& view + , const FormatTag& + , typename enable_if< typename mpl::and_< typename detail::is_output_device< Device >::type + , typename is_format_tag< FormatTag >::type + , typename is_write_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::writer< Device + , FormatTag + > writer( device ); + + writer.apply( view ); +} + +template< typename Device + , typename View + , typename FormatTag + > +inline +void write_view( Device& device + , const View& view + , const FormatTag& tag + , typename enable_if< typename mpl::and_< typename detail::is_adaptable_output_device< FormatTag + , Device + >::type + , typename is_format_tag< FormatTag >::type + , typename is_write_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_output_device< FormatTag + , Device + >::device_type dev_t; + dev_t dev( device ); + + write_view( dev + , view + , tag + ); +} + +template< typename String + , typename View + , typename FormatTag + > +inline +void write_view( const String& file_name + , const View& view + , const FormatTag& tag + , typename enable_if< typename mpl::and_< typename detail::is_supported_path_spec< String >::type + , typename is_format_tag< FormatTag >::type + , typename is_write_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device device( detail::convert_to_string( file_name ) + , typename detail::file_stream_device::write_tag() + ); + + write_view( device + , view + , tag + ); +} + +/// \ingroup IO +template< typename Device + , typename View + , typename FormatTag + , typename Log + > +inline +void write_view( Device& device + , const View& view + , const image_write_info& info + , typename enable_if< typename mpl::and_< typename detail::is_output_device< Device >::type + , typename is_format_tag< FormatTag >::type + , typename is_write_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::writer< Device + , FormatTag + , Log + > writer( device ); + + writer.apply( view + , info ); +} + +template< typename Device + , typename View + , typename FormatTag + , typename Log + > +inline +void write_view( Device& device + , const View& view + , const image_write_info< FormatTag, Log >& info + , typename enable_if< typename mpl::and_< typename detail::is_adaptable_output_device< FormatTag + , Device + >::type + , typename is_format_tag< FormatTag >::type + , typename is_write_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + typename detail::is_adaptable_output_device< FormatTag + , Device + >::device_type dev( device ); + + write_view( dev + , view + , info + ); +} + +template< typename String + , typename View + , typename FormatTag + , typename Log + > +inline +void write_view( const String& file_name + , const View& view + , const image_write_info< FormatTag, Log >& info + , typename enable_if< typename mpl::and_< typename detail::is_supported_path_spec< String >::type + , typename is_format_tag< FormatTag >::type + , typename is_write_supported< typename get_pixel_type< View >::type + , FormatTag + >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device< FormatTag > device( detail::convert_to_string( file_name ) + , typename detail::file_stream_device< FormatTag >::write_tag() + ); + + write_view( device + , view + , info + ); +} + + +////////////////////////////////////// dynamic_image + +// without image_write_info +template< typename Device + , typename Views + , typename FormatTag + > +inline +void write_view( Device& device + , const any_image_view< Views >& view + , const FormatTag& + , typename enable_if< typename mpl::and_< typename detail::is_output_device< Device >::type + , typename is_format_tag< FormatTag >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::dynamic_image_writer< Device + , FormatTag + > dyn_writer( device ); + + dyn_writer.apply( view ); +} + +template< typename Device + , typename Views + , typename FormatTag + > +inline +void write_view( Device& device + , const any_image_view< Views >& views + , const FormatTag& tag + , typename enable_if< typename mpl::and_< typename detail::is_adaptable_output_device< FormatTag + , Device + >::type + , typename is_format_tag< FormatTag >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + typedef typename detail::is_adaptable_output_device< FormatTag + , Device + >::device_type dev_t; + dev_t dev( device ); + + write_view( dev + , views + , tag + ); +} + +template< typename String + , typename Views + , typename FormatTag + > +inline +void write_view( const String& file_name + , const any_image_view< Views >& views + , const FormatTag& tag + , typename enable_if< typename mpl::and_< typename detail::is_supported_path_spec< String >::type + , typename is_format_tag< FormatTag >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device device( detail::convert_to_string( file_name ) + , typename detail::file_stream_device::write_tag() + ); + + write_view( device + , views + , tag + ); +} + +// with image_write_info +/// \ingroup IO +template< typename Device + , typename Views + , typename FormatTag + , typename Log + > +inline +void write_view( Device& device + , const any_image_view< Views >& views + , const image_write_info< FormatTag + , Log + >& info + , typename enable_if< typename mpl::and_< typename detail::is_output_device< Device >::type + , typename is_format_tag< FormatTag >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::dynamic_image_writer< Device + , FormatTag + , Log + > dyn_writer( device ); + + dyn_writer.apply( views + , info + ); +} + +template< typename Device + , typename Views + , typename FormatTag + , typename Log + > +inline +void write_view( Device& device + , const any_image_view< Views >& views + , const image_write_info< FormatTag + , Log + >& info + , typename enable_if< typename mpl::and_< typename detail::is_adaptable_output_device< FormatTag + , Device + >::type + , typename is_format_tag< FormatTag >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + typename detail::is_adaptable_output_device< FormatTag + , Device + >::device_type dev( device ); + + write_view( dev + , views + , info + ); +} + +template< typename String + , typename Views + , typename FormatTag + , typename Log + > +inline +void write_view( const String& file_name + , const any_image_view< Views >& views + , const image_write_info< FormatTag + , Log + >& info + , typename enable_if< typename mpl::and_< typename detail::is_supported_path_spec< String >::type + , typename is_format_tag< FormatTag >::type + >::type + >::type* /* ptr */ = 0 + ) +{ + detail::file_stream_device< FormatTag > device( detail::convert_to_string( file_name ) + , typename detail::file_stream_device< FormatTag >::write_tag() + ); + + write_view( device + , views + , info + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_WRITE_VIEW_HPP diff --git a/boost/gil/extension/io_new/formats/bmp/is_allowed.hpp b/boost/gil/extension/io_new/formats/bmp/is_allowed.hpp new file mode 100644 index 00000000..720b2202 --- /dev/null +++ b/boost/gil/extension/io_new/formats/bmp/is_allowed.hpp @@ -0,0 +1,92 @@ +/* + Copyright 2009 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BMP_IO_IS_ALLOWED_HPP +#define BOOST_GIL_EXTENSION_IO_BMP_IO_IS_ALLOWED_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +namespace boost { namespace gil { namespace detail { + +template< typename View > +bool is_allowed( const image_read_info< bmp_tag >& info + , mpl::true_ // is read_and_no_convert + ) +{ + bmp_bits_per_pixel::type src_bits_per_pixel = 0; + + switch( info._bits_per_pixel ) + { + case 1: + case 4: + case 8: + { + if( info._header_size == bmp_header_size::_win32_info_size + && info._compression != bmp_compression::_rle8 + && info._compression != bmp_compression::_rle4 + ) + { + src_bits_per_pixel = 32; + } + else + { + src_bits_per_pixel = 24; + } + + break; + } + + case 15: + case 16: + { + src_bits_per_pixel = 24; + + break; + } + + case 24: + case 32: + { + src_bits_per_pixel = info._bits_per_pixel; + + break; + } + default: + { + io_error( "Pixel size not supported." ); + } + } + + typedef typename channel_traits< typename element_type< typename View::value_type >::type >::value_type channel_t; + bmp_bits_per_pixel::type dst_bits_per_pixel = detail::unsigned_integral_num_bits< channel_t >::value + * num_channels< View >::value; + + return ( dst_bits_per_pixel == src_bits_per_pixel ); +} + +template< typename View > +bool is_allowed( const image_read_info< bmp_tag >& /* info */ + , mpl::false_ // is read_and_convert + ) +{ + return true; +} + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_BMP_IO_IS_ALLOWED_HPP diff --git a/boost/gil/extension/io_new/formats/bmp/read.hpp b/boost/gil/extension/io_new/formats/bmp/read.hpp new file mode 100644 index 00000000..b7bab9d5 --- /dev/null +++ b/boost/gil/extension/io_new/formats/bmp/read.hpp @@ -0,0 +1,865 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BMP_IO_READ_HPP +#define BOOST_GIL_EXTENSION_IO_BMP_IO_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "is_allowed.hpp" + +namespace boost { namespace gil { namespace detail { + +/// Color channel mask +struct bit_field +{ + unsigned int mask; // Bit mask at corresponding position + unsigned int width; // Bit width of the mask + unsigned int shift; // Bit position from right to left +}; + +/// BMP color masks +struct color_mask +{ + bit_field red; // Red bits + bit_field green; // Green bits + bit_field blue; // Blue bits +}; + + +template< typename Device + , typename ConversionPolicy + > +class reader< Device + , bmp_tag + , ConversionPolicy + > + : public reader_base< bmp_tag + , ConversionPolicy + > +{ +private: + + typedef typename ConversionPolicy::color_converter_type cc_t; + +public: + + reader( Device& device + , const image_read_settings< bmp_tag >& settings + ) + : reader_base< bmp_tag + , ConversionPolicy >( settings ) + , _io_dev( device ) + {} + + reader( Device& device + , const cc_t& cc + , const image_read_settings< bmp_tag >& settings + ) + : reader_base< bmp_tag + , ConversionPolicy + >( cc + , settings + ) + , _io_dev( device ) + {} + + image_read_info< bmp_tag > get_info() + { + // read file header + + // the magic number used to identify the BMP file: + // 0x42 0x4D (ASCII code points for B and M) + if( _io_dev.read_int16() == 0x424D ) + { + io_error( "Wrong magic number for bmp file." ); + } + + // the size of the BMP file in bytes + _io_dev.read_int32(); + + // reserved; actual value depends on the application that creates the image + _io_dev.read_int16(); + // reserved; actual value depends on the application that creates the image + _io_dev.read_int16(); + + _info._offset = _io_dev.read_int32(); + + + // bitmap information + + // the size of this header ( 40 bytes ) + _info._header_size = _io_dev.read_int32(); + + if( _info._header_size == bmp_header_size::_win32_info_size ) + { + _info._width = _io_dev.read_int32(); + _info._height = _io_dev.read_int32(); + + // the number of color planes being used. Must be set to 1. + _io_dev.read_int16(); + + _info._bits_per_pixel = _io_dev.read_int16(); + + _info._compression = _io_dev.read_int32(); + + _info._image_size = _io_dev.read_int32(); + + _info._horizontal_resolution = _io_dev.read_int32(); + _info._vertical_resolution = _io_dev.read_int32(); + + _info._num_colors = _io_dev.read_int32(); + _info._num_important_colors = _io_dev.read_int32(); + + } + else if( _info._header_size == bmp_header_size::_os2_info_size ) + { + _info._width = static_cast< bmp_image_width::type >( _io_dev.read_int16() ); + _info._height = static_cast< bmp_image_height::type >( _io_dev.read_int16() ); + + // the number of color planes being used. Must be set to 1. + _io_dev.read_int16(); + + _info._bits_per_pixel = _io_dev.read_int16(); + + _info._compression = bmp_compression::_rgb; + + // not used + _info._image_size = 0; + _info._horizontal_resolution = 0; + _info._vertical_resolution = 0; + _info._num_colors = 0; + _info._num_important_colors = 0; + } + else + { + io_error( "Invalid BMP info header." ); + } + + _info._valid = true; + + return _info; + } + + template< typename View > + void apply( const View& dst_view ) + { + if( !_info._valid ) + { + get_info(); + } + + typedef typename is_same< ConversionPolicy + , read_and_no_convert + >::type is_read_and_convert_t; + + io_error_if( !is_allowed< View >( this->_info + , is_read_and_convert_t() + ) + , "Image types aren't compatible." + ); + + // the row pitch must be multiple 4 bytes + int pitch; + + if( _info._bits_per_pixel < 8 ) + { + pitch = (( this->_info._width * this->_info._bits_per_pixel ) + 7 ) >> 3; + } + else + { + pitch = _info._width * (( this->_info._bits_per_pixel + 7 ) >> 3); + } + + pitch = (pitch + 3) & ~3; + + + std::ptrdiff_t ybeg = 0; + std::ptrdiff_t yend = this->_settings._dim.y; + std::ptrdiff_t yinc = 1; + + // offset to first scanline + std::ptrdiff_t offset = 0; + + if( _info._height > 0 ) + { + // the image is upside down + ybeg = this->_settings._dim.y - 1; + yend = -1; + yinc = -1; + + offset = _info._offset + + ( this->_info._height + - this->_settings._top_left.y + - this->_settings._dim.y + ) * pitch; + + + } + else + { + offset = _info._offset + + this->_settings._top_left.y * pitch; + } + + switch( _info._bits_per_pixel ) + { + case 1: + { + read_palette_image< gray1_image_t::view_t + , mirror_bits< byte_vector_t + , mpl::true_ + > + > ( dst_view + , pitch + , ybeg + , yend + , yinc + , offset + ); + break; + } + + case 4: + { + switch ( _info._compression ) + { + case bmp_compression::_rle4: + { + read_palette_image_rle( dst_view + , ybeg + , yend + , yinc + , offset + ); + + break; + } + + case bmp_compression::_rgb: + { + read_palette_image< gray4_image_t::view_t + , swap_half_bytes< byte_vector_t + , mpl::true_ + > + > ( dst_view + , pitch + , ybeg + , yend + , yinc + , offset + ); + break; + } + + default: + { + io_error( "Unsupported compression mode in BMP file." ); + break; + } + } + break; + } + + case 8: + { + switch ( _info._compression ) + { + case bmp_compression::_rle8: + { + read_palette_image_rle( dst_view + , ybeg + , yend + , yinc + , offset + ); + break; + } + + case bmp_compression::_rgb: + { + read_palette_image< gray8_image_t::view_t + , do_nothing< std::vector< gray8_pixel_t > > + > ( dst_view + , pitch + , ybeg + , yend + , yinc + , offset + ); + break; + } + + default: + { + io_error( "Unsupported compression mode in BMP file." ); + break; + } + } + + break; + } + + case 15: case 16: + { + read_data_15( dst_view + , pitch + , ybeg + , yend + , yinc + , offset + ); + + break; + } + + case 24: { read_data< bgr8_view_t >( dst_view, pitch, ybeg, yend, yinc, offset ); break; } + case 32: { read_data< bgra8_view_t >( dst_view, pitch, ybeg, yend, yinc, offset ); break; } + } + } + +private: + + void read_palette( std::vector< rgba8_pixel_t >& palette ) + { + int entries = _info._num_colors; + + if( entries == 0 ) + { + entries = 1 << _info._bits_per_pixel; + } + + palette.resize( entries ); + + for( int i = 0; i < entries; ++i ) + { + get_color( palette[i], blue_t() ) = _io_dev.read_int8(); + get_color( palette[i], green_t() ) = _io_dev.read_int8(); + get_color( palette[i], red_t() ) = _io_dev.read_int8(); + + // there are 4 entries when windows header + // but 3 for os2 header + if( _info._header_size == bmp_header_size::_win32_info_size ) + { + _io_dev.read_int8(); + } + + } // for + } + + template< typename View_Src + , typename Byte_Manipulator + , typename View_Dst + > + void read_palette_image( const View_Dst& view + , int pitch + , std::ptrdiff_t ybeg + , std::ptrdiff_t yend + , std::ptrdiff_t yinc + , std::ptrdiff_t offset + ) + { + std::vector< rgba8_pixel_t > pal; + read_palette( pal ); + + // jump to first scanline + _io_dev.seek( static_cast< long >( offset )); + + typedef row_buffer_helper_view< View_Src > rh_t; + typedef typename rh_t::iterator_t it_t; + + rh_t rh( pitch, true ); + + // we have to swap bits + Byte_Manipulator byte_manipulator; + + for( std::ptrdiff_t y = ybeg; y != yend; y += yinc ) + { + // @todo: For now we're reading the whole scanline which is + // slightly inefficient. Later versions should try to read + // only the bytes which are necessary. + _io_dev.read( reinterpret_cast< byte_t* >( rh.data() ) + , pitch + ); + + byte_manipulator( rh.buffer() ); + + typename View_Dst::x_iterator dst_it = view.row_begin( y ); + + it_t it = rh.begin() + this->_settings._top_left.x; + it_t end = it + this->_settings._dim.x; + + for( ; it != end; ++it, ++dst_it ) + { + unsigned char c = get_color( *it, gray_color_t() ); + *dst_it = pal[ c ]; + } + } + } + + template< typename View > + void read_data_15( const View& view + , int pitch + , std::ptrdiff_t ybeg + , std::ptrdiff_t yend + , std::ptrdiff_t yinc + , std::ptrdiff_t offset + ) + { + byte_vector_t row( pitch ); + + // read the color masks + color_mask mask = { {0} }; + if( _info._compression == bmp_compression::_bitfield ) + { + mask.red.mask = _io_dev.read_int32(); + mask.green.mask = _io_dev.read_int32(); + mask.blue.mask = _io_dev.read_int32(); + + mask.red.width = count_ones( mask.red.mask ); + mask.green.width = count_ones( mask.green.mask ); + mask.blue.width = count_ones( mask.blue.mask ); + + mask.red.shift = trailing_zeros( mask.red.mask ); + mask.green.shift = trailing_zeros( mask.green.mask ); + mask.blue.shift = trailing_zeros( mask.blue.mask ); + } + else if( _info._compression == bmp_compression::_rgb ) + { + switch( _info._bits_per_pixel ) + { + case 15: + case 16: + { + mask.red.mask = 0x007C00; mask.red.width = 5; mask.red.shift = 10; + mask.green.mask = 0x0003E0; mask.green.width = 5; mask.green.shift = 5; + mask.blue.mask = 0x00001F; mask.blue.width = 5; mask.blue.shift = 0; + break; + } + + case 24: + case 32: + { + mask.red.mask = 0xFF0000; mask.red.width = 8; mask.red.shift = 16; + mask.green.mask = 0x00FF00; mask.green.width = 8; mask.green.shift = 8; + mask.blue.mask = 0x0000FF; mask.blue.width = 8; mask.blue.shift = 0; + break; + } + } + } + else + { + io_error( "bmp_reader::apply(): unsupported BMP compression" ); + } + + // jump to first scanline + _io_dev.seek( static_cast< long >( offset )); + + typedef rgb8_image_t image_t; + typedef image_t::view_t::x_iterator it_t; + + for( std::ptrdiff_t y = ybeg; y != yend; y += yinc ) + { + // @todo: For now we're reading the whole scanline which is + // slightly inefficient. Later versions should try to read + // only the bytes which are necessary. + _io_dev.read( &row.front(), row.size() ); + + image_t img_row( _info._width, 1 ); + image_t::view_t v = gil::view( img_row ); + it_t it = v.row_begin( 0 ); + + it_t beg = v.row_begin( 0 ) + this->_settings._top_left.x; + it_t end = beg + this->_settings._dim.x; + + byte_t* src = &row.front(); + for( int32_t i = 0 ; i < _info._width; ++i, src += 2 ) + { + int p = ( src[1] << 8 ) | src[0]; + + int r = ((p & mask.red.mask) >> mask.red.shift) << (8 - mask.red.width); + int g = ((p & mask.green.mask) >> mask.green.shift) << (8 - mask.green.width); + int b = ((p & mask.blue.mask) >> mask.blue.shift) << (8 - mask.blue.width); + + get_color( it[i], red_t() ) = static_cast< byte_t >( r ); + get_color( it[i], green_t() ) = static_cast< byte_t >( g ); + get_color( it[i], blue_t() ) = static_cast< byte_t >( b ); + } + + this->_cc_policy.read( beg + , end + , view.row_begin( y ) + ); + } + } + + + // 8-8-8 BGR + // 8-8-8-8 BGRA + template< typename View_Src + , typename View_Dst + > + void read_data( const View_Dst& view + , int pitch + , std::ptrdiff_t ybeg + , std::ptrdiff_t yend + , std::ptrdiff_t yinc + , std::ptrdiff_t offset + ) + { + byte_vector_t row( pitch ); + + // jump to first scanline + _io_dev.seek( static_cast< long >( offset )); + + View_Src v = interleaved_view( _info._width + , 1 + , (typename View_Src::value_type*) &row.front() + , _info._width * num_channels< View_Src >::value + ); + + typename View_Src::x_iterator beg = v.row_begin( 0 ) + this->_settings._top_left.x; + typename View_Src::x_iterator end = beg + this->_settings._dim.x; + + for( std::ptrdiff_t y = ybeg; y != yend; y += yinc ) + { + // @todo: For now we're reading the whole scanline which is + // slightly inefficient. Later versions should try to read + // only the bytes which are necessary. + _io_dev.read( &row.front(), row.size() ); + + this->_cc_policy.read( beg + , end + , view.row_begin( y ) + ); + } + } + + + template< typename Buffer + , typename View + > + void copy_row_if_needed( const Buffer& buf + , const View& view + , std::ptrdiff_t y + ) + { + if( y >= this->_settings._top_left.y + && y < this->_settings._dim.y + ) + { + typename Buffer::const_iterator beg = buf.begin() + this->_settings._top_left.x; + typename Buffer::const_iterator end = beg + this->_settings._dim.x; + + std::copy( beg + , end + , view.row_begin( y ) + ); + } + } + + template< typename View_Dst > + void read_palette_image_rle( const View_Dst& view + , std::ptrdiff_t ybeg + , std::ptrdiff_t yend + , std::ptrdiff_t yinc + , std::ptrdiff_t offset + ) + { + assert( _info._compression == bmp_compression::_rle4 + || _info._compression == bmp_compression::_rle8 + ); + + std::vector< rgba8_pixel_t > pal; + read_palette( pal ); + + // jump to start of rle4 data + _io_dev.seek( static_cast< long >( offset )); + + // we need to know the stream position for padding purposes + std::size_t stream_pos = offset; + + typedef std::vector< rgba8_pixel_t > Buf_type; + Buf_type buf( this->_settings._dim.x ); + Buf_type::iterator dst_it = buf.begin(); + Buf_type::iterator dst_end = buf.end(); + + std::ptrdiff_t y = ybeg; + bool finished = false; + + while ( !finished ) + { + std::ptrdiff_t count = _io_dev.read_int8(); + std::ptrdiff_t second = _io_dev.read_int8(); + stream_pos += 2; + + if ( count ) + { + // encoded mode + + // clamp to boundary + if( count > dst_end - dst_it ) + { + count = dst_end - dst_it; + } + + if( _info._compression == bmp_compression::_rle4 ) + { + std::ptrdiff_t cs[2] = { second >> 4, second & 0x0f }; + + for( int i = 0; i < count; ++i ) + { + *dst_it++ = pal[ cs[i & 1] ]; + } + } + else + { + for( int i = 0; i < count; ++i ) + { + *dst_it++ = pal[ second ]; + } + } + } + else + { + switch( second ) + { + case 0: // end of row + { + copy_row_if_needed( buf, view, y ); + + y += yinc; + if( y == yend ) + { + finished = true; + } + else + { + dst_it = buf.begin(); + dst_end = buf.end(); + } + + break; + } + + case 1: // end of bitmap + { + copy_row_if_needed( buf, view, y ); + finished = true; + + break; + } + + case 2: // offset coordinates + { + std::ptrdiff_t dx = _io_dev.read_int8(); + std::ptrdiff_t dy = _io_dev.read_int8() * yinc; + stream_pos += 2; + + if( dy ) + { + copy_row_if_needed( buf, view, y ); + } + + std::ptrdiff_t x = dst_it - buf.begin(); + x += dx; + + if( x > _info._width ) + { + io_error( "Mangled BMP file." ); + } + + y += dy; + if( yinc > 0 ? y > yend : y < yend ) + { + io_error( "Mangled BMP file." ); + } + + dst_it = buf.begin() + x; + dst_end = buf.end(); + + break; + } + + default: // absolute mode + { + count = second; + + // clamp to boundary + if( count > dst_end - dst_it ) + { + count = dst_end - dst_it; + } + + if ( _info._compression == bmp_compression::_rle4 ) + { + for( int i = 0; i < count; ++i ) + { + uint8_t packed_indices = _io_dev.read_int8(); + ++stream_pos; + + *dst_it++ = pal[ packed_indices >> 4 ]; + if( ++i == second ) + break; + + *dst_it++ = pal[ packed_indices & 0x0f ]; + } + } + else + { + for( int i = 0; i < count; ++i ) + { + uint8_t c = _io_dev.read_int8(); + ++stream_pos; + *dst_it++ = pal[ c ]; + } + } + + // pad to word boundary + if( ( stream_pos - offset ) & 1 ) + { + _io_dev.seek( 1, SEEK_CUR ); + ++stream_pos; + } + + break; + } + } + } + } + } + +protected: + + Device& _io_dev; + image_read_info< bmp_tag > _info; +}; + +/////////////////////////////////// dynamic image + +class bmp_type_format_checker +{ +public: + + bmp_type_format_checker( const bmp_bits_per_pixel::type& bpp ) + : _bpp( bpp ) + {} + + template< typename Image > + bool apply() + { + if( _bpp < 32 ) + { + return pixels_are_compatible< typename Image::value_type, rgb8_pixel_t >::value + ? true + : false; + } + else + { + return pixels_are_compatible< typename Image::value_type, rgba8_pixel_t >::value + ? true + : false; + } + } + +private: + + const bmp_bits_per_pixel::type& _bpp; +}; + +struct bmp_read_is_supported +{ + template< typename View > + struct apply : public is_read_supported< typename get_pixel_type< View >::type + , bmp_tag + > + {}; +}; + +template< typename Device + > +class dynamic_image_reader< Device + , bmp_tag + > + : public reader< Device + , bmp_tag + , detail::read_and_no_convert + > +{ + typedef reader< Device + , bmp_tag + , detail::read_and_no_convert + > parent_t; + +public: + + dynamic_image_reader( Device& device + , const image_read_settings< bmp_tag >& settings + ) + : parent_t( device + , settings + ) + {} + + template< typename Images > + void apply( any_image< Images >& images ) + { + if( !this->_info._valid ) + { + parent_t::get_info(); + } + + bmp_type_format_checker format_checker( this->_info._bits_per_pixel ); + + if( !construct_matched( images + , format_checker + )) + { + io_error( "No matching image type between those of the given any_image and that of the file" ); + } + else + { + init_image( images + , this->_info + ); + + dynamic_io_fnobj< bmp_read_is_supported + , parent_t + > op( this ); + + apply_operation( view( images ) + , op + ); + } + } +}; + +} // detail +} // gil +} // boost + +#endif // BOOST_GIL_EXTENSION_IO_BMP_IO_READ_HPP diff --git a/boost/gil/extension/io_new/formats/bmp/supported_types.hpp b/boost/gil/extension/io_new/formats/bmp/supported_types.hpp new file mode 100644 index 00000000..3ff427e9 --- /dev/null +++ b/boost/gil/extension/io_new/formats/bmp/supported_types.hpp @@ -0,0 +1,147 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BMP_SUPPORTED_TYPES_HPP +#define BOOST_GIL_EXTENSION_IO_BMP_SUPPORTED_TYPES_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include +#include + +#include + +namespace boost { namespace gil { namespace detail { + +// Read support + +template< typename Channel + , typename ColorSpace + > +struct bmp_read_support : read_support_false +{ + static const bmp_bits_per_pixel::type bpp = 0; +}; + +template< typename BitField + , bool Mutable + > +struct bmp_read_support< packed_dynamic_channel_reference< BitField + , 1 + , Mutable + > + , gray_t + > : read_support_true +{ + static const bmp_bits_per_pixel::type bpp = 1; +}; + +template< typename BitField + , bool Mutable + > +struct bmp_read_support< packed_dynamic_channel_reference< BitField + , 4 + , Mutable + > + , gray_t + > : read_support_true +{ + static const bmp_bits_per_pixel::type bpp = 4; +}; + + +template<> +struct bmp_read_support< bits8 + , gray_t + > : read_support_true +{ + static const bmp_bits_per_pixel::type bpp = 8; +}; + + + +template<> +struct bmp_read_support< bits8 + , rgb_t + > : read_support_true +{ + static const bmp_bits_per_pixel::type bpp = 24; +}; + + +template<> +struct bmp_read_support< bits8 + , rgba_t + > : read_support_true +{ + static const bmp_bits_per_pixel::type bpp = 32; +}; + + +// Write support + +template< typename Channel + , typename ColorSpace + > +struct bmp_write_support : write_support_false +{}; + +template<> +struct bmp_write_support< bits8 + , rgb_t + > : write_support_true {}; + +template<> +struct bmp_write_support< bits8 + , rgba_t + > : write_support_true {}; + +} // namespace detail + + +template< typename Pixel > +struct is_read_supported< Pixel + , bmp_tag + > + : mpl::bool_< detail::bmp_read_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + >::is_supported + > +{ + typedef detail::bmp_read_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + > parent_t; + + static const typename bmp_bits_per_pixel::type bpp = parent_t::bpp; +}; + +template< typename Pixel > +struct is_write_supported< Pixel + , bmp_tag + > + : mpl::bool_< detail::bmp_write_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + >::is_supported + > {}; + +} // namespace gil +} // namespace boost + + +#endif // BOOST_GIL_EXTENSION_IO_BMP_SUPPORTED_TYPES_HPP diff --git a/boost/gil/extension/io_new/formats/bmp/write.hpp b/boost/gil/extension/io_new/formats/bmp/write.hpp new file mode 100644 index 00000000..75c51478 --- /dev/null +++ b/boost/gil/extension/io_new/formats/bmp/write.hpp @@ -0,0 +1,215 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_BMP_IO_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_BMP_IO_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include + +#include + +namespace boost { namespace gil { namespace detail { + +template < int N > struct get_bgr_cs {}; +template <> struct get_bgr_cs< 1 > { typedef gray8_view_t type; }; +template <> struct get_bgr_cs< 3 > { typedef bgr8_view_t type; }; +template <> struct get_bgr_cs< 4 > { typedef bgra8_view_t type; }; + +template< typename Device > +class writer< Device + , bmp_tag + > +{ +public: + + writer( Device& file ) + : _out( file ) + { + } + + ~writer() + { + } + + template + void apply( const View& view ) + { + write( view ); + } + + template + void apply( const View& view + , const image_write_info< bmp_tag >& /* info */ + ) + { + // Add code here, once image_write_info< bmp_tag > isn't empty anymore. + + write( view ); + } + +private: + + template< typename View > + void write( const View& view ) + { + typedef typename channel_type< + typename get_pixel_type< View >::type >::type channel_t; + + typedef typename color_space_type< View >::type color_space_t; + + // check if supported +/* + /// todo + if( bmp_read_write_support_private::channel != 8) + { + io_error("Input view type is incompatible with the image type"); + } +*/ + + // compute the file size + int bpp = num_channels< View >::value * 8; + int entries = 0; + +/* + /// @todo: Not supported for now. bit_aligned_images refer to indexed images + /// in this context. + if( bpp <= 8 ) + { + entries = 1 << bpp; + } +*/ + + std::size_t spn = ( view.width() * num_channels< View >::value + 3 ) & ~3; + std::size_t ofs = bmp_header_size::_size + + bmp_header_size::_win32_info_size + + entries * 4; + + std::size_t siz = ofs + spn * view.height(); + + // write the BMP file header + _out.write_int16( bmp_signature ); + _out.write_int32( (uint32_t) siz ); + _out.write_int16( 0 ); + _out.write_int16( 0 ); + _out.write_int32( (uint32_t) ofs ); + + // writes Windows information header + _out.write_int32( bmp_header_size::_win32_info_size ); + _out.write_int32( static_cast< uint32_t >( view.width() )); + _out.write_int32( static_cast< uint32_t >( view.height() )); + _out.write_int16( 1 ); + _out.write_int16( static_cast< uint16_t >( bpp )); + _out.write_int32( bmp_compression::_rgb ); + _out.write_int32( 0 ); + _out.write_int32( 0 ); + _out.write_int32( 0 ); + _out.write_int32( entries ); + _out.write_int32( 0 ); + + write_image< View + , typename get_bgr_cs< num_channels< View >::value >::type + >( view, spn ); + } + + + template< typename View + , typename BMP_View + > + void write_image( const View& view + , const std::size_t spn + ) + { + byte_vector_t buffer( spn ); + std::fill( buffer.begin(), buffer.end(), 0 ); + + + BMP_View row = interleaved_view( view.width() + , 1 + , (typename BMP_View::value_type*) &buffer.front() + , spn + ); + + for( typename View::y_coord_t y = view.height() - 1; y > -1; --y ) + { + copy_pixels( subimage_view( view + , 0 + , (int) y + , (int) view.width() + , 1 + ) + , row + ); + + _out.write( &buffer.front(), spn ); + } + + } + +private: + + Device& _out; +}; + + +struct bmp_write_is_supported +{ + template< typename View > + struct apply + : public is_write_supported< typename get_pixel_type< View >::type + , bmp_tag + > + {}; +}; + +template< typename Device > +class dynamic_image_writer< Device + , bmp_tag + > + : public writer< Device + , bmp_tag + > +{ + typedef writer< Device + , bmp_tag + > parent_t; + +public: + + dynamic_image_writer( Device& file ) + : parent_t( file ) + {} + + template< typename Views > + void apply( const any_image_view< Views >& views ) + { + dynamic_io_fnobj< bmp_write_is_supported + , parent_t + > op( this ); + + apply_operation( views, op ); + } +}; + +} // detail +} // gil +} // boost + +#endif // BOOST_GIL_EXTENSION_IO_BMP_IO_WRITE_HPP diff --git a/boost/gil/extension/io_new/formats/jpeg/base.hpp b/boost/gil/extension/io_new/formats/jpeg/base.hpp new file mode 100644 index 00000000..113df11f --- /dev/null +++ b/boost/gil/extension/io_new/formats/jpeg/base.hpp @@ -0,0 +1,39 @@ +/* + Copyright 2010 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_JPEG_IO_BASE_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_JPEG_IO_BASE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2010 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// +#include + +namespace boost { namespace gil { namespace detail { + +class jpeg_io_base +{ + +protected: + + jpeg_error_mgr _jerr; + jmp_buf _mark; +}; + + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_JPEG_IO_BASE_HPP diff --git a/boost/gil/extension/io_new/formats/jpeg/is_allowed.hpp b/boost/gil/extension/io_new/formats/jpeg/is_allowed.hpp new file mode 100644 index 00000000..78691eb6 --- /dev/null +++ b/boost/gil/extension/io_new/formats/jpeg/is_allowed.hpp @@ -0,0 +1,54 @@ +/* + Copyright 2009 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_JPEG_IO_IS_ALLOWED_HPP +#define BOOST_GIL_EXTENSION_IO_JPEG_IO_IS_ALLOWED_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +namespace boost { namespace gil { namespace detail { + +template< typename View > +bool is_allowed( const image_read_info< jpeg_tag >& info + , mpl::true_ // is read_and_no_convert + ) +{ + if( info._color_space == JCS_YCbCr ) + { + // We read JCS_YCbCr files as rgb. + return ( is_read_supported< typename View::value_type + , jpeg_tag + >::_color_space == JCS_RGB ); + } + + return ( is_read_supported< typename View::value_type + , jpeg_tag + >::_color_space == info._color_space ); +} + +template< typename View > +bool is_allowed( const image_read_info< jpeg_tag >& /* info */ + , mpl::false_ // is read_and_convert + ) +{ + return true; +} + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_IO_IS_ALLOWED_HPP diff --git a/boost/gil/extension/io_new/formats/jpeg/read.hpp b/boost/gil/extension/io_new/formats/jpeg/read.hpp new file mode 100644 index 00000000..accc3e22 --- /dev/null +++ b/boost/gil/extension/io_new/formats/jpeg/read.hpp @@ -0,0 +1,418 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_JPEG_IO_READ_HPP +#define BOOST_GIL_EXTENSION_IO_JPEG_IO_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "base.hpp" +#include "is_allowed.hpp" + +namespace boost { namespace gil { namespace detail { + +template +struct jpeg_decompress_mgr : public jpeg_io_base +{ + jpeg_decompress_mgr( Device& file ) + : in(file) + { + _cinfo.err = jpeg_std_error( &_jerr ); + _cinfo.client_data = this; + + // Error exit handler: does not return to caller. + _jerr.error_exit = &jpeg_decompress_mgr::error_exit; + + if( setjmp( _mark )) { raise_error(); } + + _src._jsrc.bytes_in_buffer = 0; + _src._jsrc.next_input_byte = buffer; + _src._jsrc.init_source = reinterpret_cast< void(*) ( j_decompress_ptr )>( &jpeg_decompress_mgr< Device >::init_device ); + _src._jsrc.fill_input_buffer = reinterpret_cast< boolean(*)( j_decompress_ptr )>( &jpeg_decompress_mgr< Device >::fill_buffer ); + _src._jsrc.skip_input_data = reinterpret_cast< void(*) ( j_decompress_ptr + , long num_bytes + ) >( &jpeg_decompress_mgr< Device >::skip_input_data ); + _src._jsrc.term_source = reinterpret_cast< void(*) ( j_decompress_ptr ) >( &jpeg_decompress_mgr< Device >::close_device ); + _src._jsrc.resync_to_restart = jpeg_resync_to_restart; + _src._this = this; + + jpeg_create_decompress( &_cinfo ); + + _cinfo.src = &_src._jsrc; + + jpeg_read_header( &_cinfo + , TRUE ); + + io_error_if( _cinfo.data_precision != 8 + , "Image file is not supported." + ); + } + + ~jpeg_decompress_mgr() + { + jpeg_destroy_decompress( &_cinfo ); + } + +protected: + + // Taken from jerror.c + /* + * Error exit handler: must not return to caller. + * + * Applications may override this if they want to get control back after + * an error. Typically one would longjmp somewhere instead of exiting. + * The setjmp buffer can be made a private field within an expanded error + * handler object. Note that the info needed to generate an error message + * is stored in the error object, so you can generate the message now or + * later, at your convenience. + * You should make sure that the JPEG object is cleaned up (with jpeg_abort + * or jpeg_destroy) at some point. + */ + static void error_exit( j_common_ptr cinfo ) + { + jpeg_decompress_mgr< Device >* mgr = reinterpret_cast< jpeg_decompress_mgr< Device >* >( cinfo->client_data ); + + longjmp( mgr->_mark, 1 ); + } + + void raise_error() + { + // we clean up in the destructor + + io_error( "jpeg is invalid." ); + } + +private: + + // See jdatasrc.c for default implementation for the following static member functions. + + static void init_device( jpeg_decompress_struct * cinfo ) + { + gil_jpeg_source_mgr* src = reinterpret_cast< gil_jpeg_source_mgr* >( cinfo->src ); + src->_jsrc.bytes_in_buffer = 0; + src->_jsrc.next_input_byte = src->_this->buffer; + } + + static boolean fill_buffer( jpeg_decompress_struct * cinfo ) + { + gil_jpeg_source_mgr* src = reinterpret_cast< gil_jpeg_source_mgr* >( cinfo->src ); + size_t count= src->_this->in.read(src->_this->buffer, sizeof(src->_this->buffer) ); + + if( count <= 0 ) + { + // libjpeg does that: adding an EOF marker + src->_this->buffer[0] = (JOCTET) 0xFF; + src->_this->buffer[1] = (JOCTET) JPEG_EOI; + count = 2; + } + + src->_jsrc.next_input_byte = src->_this->buffer; + src->_jsrc.bytes_in_buffer = count; + + return TRUE; + } + + static void skip_input_data( jpeg_decompress_struct * cinfo, long num_bytes ) + { + gil_jpeg_source_mgr* src = reinterpret_cast< gil_jpeg_source_mgr* >( cinfo->src ); + + if( num_bytes > 0 ) + { + while( num_bytes > long( src->_jsrc.bytes_in_buffer )) + { + num_bytes -= (long) src->_jsrc.bytes_in_buffer; + fill_buffer( cinfo ); + } + + src->_jsrc.next_input_byte += num_bytes; + src->_jsrc.bytes_in_buffer -= num_bytes; + } + } + + static void close_device( jpeg_decompress_struct* ) {} + +protected: + jpeg_decompress_struct _cinfo; + + +private: + Device ∈ + + struct gil_jpeg_source_mgr + { + jpeg_source_mgr _jsrc; + jpeg_decompress_mgr* _this; + }; + + gil_jpeg_source_mgr _src; + + // libjpeg default is 4096 - see jdatasrc.c + JOCTET buffer[4096]; +}; + +template< typename Device + , typename ConversionPolicy + > +class reader< Device + , jpeg_tag + , ConversionPolicy + > + : public jpeg_decompress_mgr< Device > + , public reader_base< jpeg_tag + , ConversionPolicy > +{ +public: + reader( Device& device + , const image_read_settings< jpeg_tag >& settings + ) + : jpeg_decompress_mgr( device ) + , reader_base< jpeg_tag + , ConversionPolicy >( settings ) + {} + + reader( Device& device + , const typename ConversionPolicy::color_converter_type& cc + , const image_read_settings< jpeg_tag >& settings + ) + : jpeg_decompress_mgr< Device >( device ) + , reader_base< jpeg_tag + , ConversionPolicy >( cc + , settings + ) + {} + + image_read_info< jpeg_tag > get_info() + { + image_read_info ret; + ret._width = this->_cinfo.image_width; + ret._height = this->_cinfo.image_height; + ret._num_components = this->_cinfo.num_components; + ret._color_space = this->_cinfo.jpeg_color_space; + ret._data_precision = this->_cinfo.data_precision; + + return ret; + } + + template + void apply( const View& view ) + { + // Fire exception in case of error. + if( setjmp( this->_mark )) { this->raise_error(); } + + jpeg_decompress_struct& cinfo = this->_cinfo; + cinfo.dct_method = this->_settings._dct_method; + + typedef typename is_same< ConversionPolicy + , read_and_no_convert + >::type is_read_and_convert_t; + + io_error_if( !is_allowed< View >( this->_info + , is_read_and_convert_t() + ) + , "Image types aren't compatible." + ); + + if( jpeg_start_decompress( &this->_cinfo ) == false ) + { + io_error( "Cannot start decompression." ); + } + + switch( this->_info._color_space ) + { + case JCS_GRAYSCALE: { read_rows< gray8_pixel_t >( view ); break; } + case JCS_RGB: { read_rows< rgb8_pixel_t >( view ); break; } + + //!\todo add Y'CbCr? We loose image quality when reading JCS_YCbCr as JCS_RGB + case JCS_YCbCr: { read_rows< rgb8_pixel_t >( view ); break; } + + case JCS_CMYK: { read_rows< cmyk8_pixel_t >( view ); break; } + + //!\todo add Y'CbCrK? We loose image quality when reading JCS_YCCK as JCS_CMYK + case JCS_YCCK: + { + this->_cinfo.out_color_space = JCS_CMYK; + read_rows< cmyk8_pixel_t >( view ); + + break; + } + default: { io_error( "Unsupported jpeg color space." ); } + } + + jpeg_finish_decompress ( &this->_cinfo ); + } + +private: + + template< typename ImagePixel + , typename View + > + void read_rows( const View& view ) + { + typedef std::vector buffer_t; + buffer_t buffer( this->_info._width ); + + // In case of an error we'll jump back to here and fire an exception. + // @todo Is the buffer above cleaned up when the exception is thrown? + // The strategy right now is to allocate necessary memory before + // the setjmp. + if( setjmp( this->_mark )) { this->raise_error(); } + + + JSAMPLE *row_adr = reinterpret_cast< JSAMPLE* >( &buffer[0] ); + + //Skip scanlines if necessary. + for( int y = 0; y < this->_settings._top_left.y; ++y ) + { + io_error_if( jpeg_read_scanlines( &this->_cinfo + , &row_adr + , 1 + ) !=1 + , "jpeg_read_scanlines: fail to read JPEG file" + ); + } + + // Read data. + for( int y = 0; y < view.height(); ++y ) + { + io_error_if( jpeg_read_scanlines( &this->_cinfo + , &row_adr + , 1 + ) !=1 + , "jpeg_read_scanlines: fail to read JPEG file" + ); + + typename buffer_t::iterator beg = buffer.begin() + this->_settings._top_left.x; + typename buffer_t::iterator end = beg + this->_settings._dim.x; + + this->_cc_policy.read( beg + , end + , view.row_begin( y ) + ); + } + + //@todo: There might be a better way to do that. + while( this->_cinfo.output_scanline < this->_cinfo.image_height ) + { + io_error_if( jpeg_read_scanlines( &this->_cinfo + , &row_adr + , 1 + ) !=1 + , "jpeg_read_scanlines: fail to read JPEG file" + ); + } + + } +}; + +struct jpeg_type_format_checker +{ + jpeg_type_format_checker( jpeg_color_space::type color_space ) + : _color_space( color_space ) + {} + + template< typename Image > + bool apply() + { + return is_read_supported< typename get_pixel_type< typename Image::view_t >::type + , jpeg_tag + >::_color_space == _color_space; + } + +private: + + jpeg_color_space::type _color_space; +}; + +struct jpeg_read_is_supported +{ + template< typename View > + struct apply : public is_read_supported< typename get_pixel_type< View >::type + , jpeg_tag + > + {}; +}; + +template< typename Device + > +class dynamic_image_reader< Device + , jpeg_tag + > + : public reader< Device + , jpeg_tag + , detail::read_and_no_convert + > +{ + typedef reader< Device + , jpeg_tag + , detail::read_and_no_convert + > parent_t; + +public: + + dynamic_image_reader( Device& device + , const image_read_settings< jpeg_tag >& settings + ) + : parent_t( device + , settings + ) + {} + + template< typename Images > + void apply( any_image< Images >& images ) + { + jpeg_type_format_checker format_checker( this->_info._color_space != JCS_YCbCr + ? this->_info._color_space + : JCS_RGB + ); + + if( !construct_matched( images + , format_checker + )) + { + io_error( "No matching image type between those of the given any_image and that of the file" ); + } + else + { + init_image( images + , this->_info + ); + + dynamic_io_fnobj< jpeg_read_is_supported + , parent_t + > op( this ); + + apply_operation( view( images ) + , op + ); + } + } +}; + +} // detail +} // gil +} // boost + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_IO_READ_HPP diff --git a/boost/gil/extension/io_new/formats/jpeg/supported_types.hpp b/boost/gil/extension/io_new/formats/jpeg/supported_types.hpp new file mode 100644 index 00000000..f0f0862b --- /dev/null +++ b/boost/gil/extension/io_new/formats/jpeg/supported_types.hpp @@ -0,0 +1,121 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_JPEG_SUPPORTED_TYPES_HPP +#define BOOST_GIL_EXTENSION_IO_JPEG_SUPPORTED_TYPES_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include +#include + +namespace boost { namespace gil { namespace detail { + +// Read support + +template< jpeg_color_space::type ColorSpace > +struct jpeg_rw_support_base +{ + static const jpeg_color_space::type _color_space = ColorSpace; +}; + +template< typename Channel + , typename ColorSpace + > +struct jpeg_read_support : read_support_false + , jpeg_rw_support_base< JCS_UNKNOWN > {}; + +template<> +struct jpeg_read_support< bits8 + , rgb_t + > : read_support_true + , jpeg_rw_support_base< JCS_RGB > {}; + +template<> +struct jpeg_read_support< bits8 + , cmyk_t + > : read_support_true + , jpeg_rw_support_base< JCS_CMYK > {}; + +template<> +struct jpeg_read_support< bits8 + , gray_t + > : read_support_true + , jpeg_rw_support_base< JCS_GRAYSCALE > {}; + +// Write support + +template< typename Channel + , typename ColorSpace + > +struct jpeg_write_support : write_support_false + , jpeg_rw_support_base< JCS_UNKNOWN > {}; + +template<> +struct jpeg_write_support< bits8 + , gray_t + > : write_support_true + , jpeg_rw_support_base< JCS_GRAYSCALE > {}; + +template<> +struct jpeg_write_support< bits8 + , rgb_t + > : write_support_true + , jpeg_rw_support_base< JCS_RGB > {}; + +template<> +struct jpeg_write_support< bits8 + , cmyk_t + > : write_support_true + , jpeg_rw_support_base< JCS_CMYK > {}; + +} // namespace detail + +template< typename Pixel > +struct is_read_supported< Pixel + , jpeg_tag + > + : mpl::bool_< detail::jpeg_read_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + >::is_supported + > +{ + typedef detail::jpeg_read_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + > parent_t; + + static const typename jpeg_color_space::type _color_space = parent_t::_color_space; +}; + +template< typename Pixel > +struct is_write_supported< Pixel + , jpeg_tag + > + : mpl::bool_< detail::jpeg_write_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + >::is_supported + > +{}; + + +} // namespace gil +} // namespace boost + + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_SUPPORTED_TYPES_HPP diff --git a/boost/gil/extension/io_new/formats/jpeg/write.hpp b/boost/gil/extension/io_new/formats/jpeg/write.hpp new file mode 100644 index 00000000..b8974b69 --- /dev/null +++ b/boost/gil/extension/io_new/formats/jpeg/write.hpp @@ -0,0 +1,317 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_JPEG_IO_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_JPEG_IO_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include + +#include + +#include "base.hpp" +#include "supported_types.hpp" + +namespace boost { namespace gil { namespace detail { + +template< typename Device > +class writer< Device + , jpeg_tag + > : public jpeg_io_base +{ +public: + + writer( Device& file ) + : out( file ) + { + _cinfo.err = jpeg_std_error( &_jerr ); + _cinfo.client_data = this; + + // Error exit handler: does not return to caller. + _jerr.error_exit = &writer< Device, jpeg_tag >::error_exit; + + // Fire exception in case of error. + if( setjmp( _mark )) { raise_error(); } + + _dest._jdest.free_in_buffer = sizeof( buffer ); + _dest._jdest.next_output_byte = buffer; + _dest._jdest.init_destination = reinterpret_cast< void(*) ( j_compress_ptr ) >( &writer< Device, jpeg_tag >::init_device ); + _dest._jdest.empty_output_buffer = reinterpret_cast< boolean(*)( j_compress_ptr ) >( &writer< Device, jpeg_tag >::empty_buffer ); + _dest._jdest.term_destination = reinterpret_cast< void(*) ( j_compress_ptr ) >( &writer< Device, jpeg_tag >::close_device ); + _dest._this = this; + + jpeg_create_compress( &_cinfo ); + _cinfo.dest = &_dest._jdest; + + } + + ~writer() + { + jpeg_finish_compress ( &_cinfo ); + jpeg_destroy_compress( &_cinfo ); + } + + template + void apply( const View& view ) + { + write_rows( view + , jpeg_quality::default_value + , jpeg_dct_method::default_value + ); + } + + template< typename View > + void apply( const View& view + , const image_write_info< jpeg_tag >& info ) + { + write_rows( view + , info._quality + , info._dct_method + ); + } + +private: + + template + void write_rows( const View& view + , const jpeg_quality::type quality + , const jpeg_dct_method::type dct_method + ) + { + std::vector< typename View::value_type > row_buffer( view.width() ); + + // In case of an error we'll jump back to here and fire an exception. + // @todo Is the buffer above cleaned up when the exception is thrown? + // The strategy right now is to allocate necessary memory before + // the setjmp. + if( setjmp( _mark )) { raise_error(); } + + typedef typename channel_type< typename View::value_type >::type channel_t; + + _cinfo.image_width = JDIMENSION( view.width() ); + _cinfo.image_height = JDIMENSION( view.height() ); + _cinfo.input_components = num_channels::value; + _cinfo.in_color_space = detail::jpeg_write_support< channel_t + , typename color_space_type< View >::type + >::_color_space; + + jpeg_set_defaults( &_cinfo ); + jpeg_set_quality ( &_cinfo + , quality + , TRUE + ); + + // Needs to be done after jpeg_set_defaults() since it's overridding this value back to slow. + _cinfo.dct_method = dct_method; + + jpeg_start_compress( &_cinfo + , TRUE + ); + + JSAMPLE* row_addr = reinterpret_cast< JSAMPLE* >( &row_buffer[0] ); + + for( int y =0; y != view.height(); ++ y ) + { + std::copy( view.row_begin( y ) + , view.row_end ( y ) + , row_buffer.begin() + ); + + jpeg_write_scanlines( &this->_cinfo + , &row_addr + , 1 + ); + } + } + + struct gil_jpeg_destination_mgr + { + jpeg_destination_mgr _jdest; + writer * _this; + }; + + static void init_device( jpeg_compress_struct* cinfo ) + { + gil_jpeg_destination_mgr* dest = reinterpret_cast< gil_jpeg_destination_mgr* >( cinfo->dest ); + + dest->_jdest.free_in_buffer = sizeof( dest->_this->buffer ); + dest->_jdest.next_output_byte = dest->_this->buffer; + } + + static boolean empty_buffer( jpeg_compress_struct* cinfo ) + { + gil_jpeg_destination_mgr* dest = reinterpret_cast< gil_jpeg_destination_mgr* >( cinfo->dest ); + + dest->_this->out.write( dest->_this->buffer + , buffer_size + ); + + writer::init_device( cinfo ); + return 1; + } + + static void close_device( jpeg_compress_struct* cinfo ) + { + writer::empty_buffer( cinfo ); + + gil_jpeg_destination_mgr* dest = reinterpret_cast< gil_jpeg_destination_mgr* >( cinfo->dest ); + + dest->_this->out.flush(); + } + + void raise_error() + { + io_error( "Cannot write jpeg file." ); + } + + static void error_exit( j_common_ptr cinfo ) + { + writer< Device, jpeg_tag >* mgr = reinterpret_cast< writer< Device, jpeg_tag >* >( cinfo->client_data ); + + longjmp( mgr->_mark, 1 ); + } + +private: + + Device &out; + + jpeg_compress_struct _cinfo; + + gil_jpeg_destination_mgr _dest; + + static const unsigned int buffer_size = 1024; + JOCTET buffer[buffer_size]; +}; + +struct jpeg_write_is_supported +{ + template< typename View > + struct apply + : public is_write_supported< typename get_pixel_type< View >::type + , jpeg_tag + > + {}; +}; + +// unary application +template +typename Op::result_type GIL_FORCEINLINE apply_operation_basec( const Bits& bits + , std::size_t index + , const image_write_info< Tag >& info + , Op op + ) +{ + return detail::apply_operation_fwd_fn::value>().template applyc( bits + , index + , op + ); +} + +// unary application +template< typename Types + , typename Info + , typename Bits + , typename Op + > +typename Op::result_type GIL_FORCEINLINE apply_operation_base( Bits& bits + , std::size_t index + , const Info& info + , Op op + ) +{ + return detail::apply_operation_fwd_fn< mpl::size< Types >::value>().template apply< Types + >( bits + , index + , info + , op + ); +} + + + +/// \ingroup Variant +/// \brief Invokes a generic constant operation (represented as a binary function object) on two variants +template< typename Types1 + , typename Info + , typename BinaryOp + > +GIL_FORCEINLINE +typename BinaryOp::result_type apply_operation( const variant< Types1 >& arg1 + , const Info& info + , BinaryOp op + ) +{ + typename variant< Types1 >::base_t bits = arg1.bits(); + + return apply_operation_base< Types1 + , image_write_info< jpeg_tag > + >( bits + , arg1.index() + , info + , op + ); +} + +template< typename Device > +class dynamic_image_writer< Device + , jpeg_tag + > + : public writer< Device + , jpeg_tag + > +{ + typedef writer< Device + , jpeg_tag + > parent_t; + +public: + + dynamic_image_writer( Device& file ) + : parent_t( file ) + {} + + template< typename Views > + void apply( const any_image_view< Views >& views ) + { + dynamic_io_fnobj< jpeg_write_is_supported + , parent_t + > op( this ); + + apply_operation( views, op ); + } + + template< typename Views > + void apply( const any_image_view < Views >& views + , const image_write_info< jpeg_tag >& info + ) + { + dynamic_io_fnobj< jpeg_write_is_supported + , parent_t + > op( this ); + + apply_operation( views, info, op ); + } +}; + +} // detail +} // gil +} // boost + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_IO_WRITE_HPP diff --git a/boost/gil/extension/io_new/formats/png/base.hpp b/boost/gil/extension/io_new/formats/png/base.hpp new file mode 100644 index 00000000..86bee9aa --- /dev/null +++ b/boost/gil/extension/io_new/formats/png/base.hpp @@ -0,0 +1,99 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_PNG_IO_BASE_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_PNG_IO_BASE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +namespace boost { namespace gil { namespace detail { + +template +class png_io_base +{ +public: + png_io_base( Device & io_dev ) + : _io_dev(io_dev) + {} + +protected: + Device & _io_dev; + + void check() const + { + byte_t buf[PNG_BYTES_TO_CHECK]; + + io_error_if(_io_dev.read(buf, PNG_BYTES_TO_CHECK) != PNG_BYTES_TO_CHECK, + "png_check_validity: failed to read image"); + + io_error_if(png_sig_cmp(png_bytep(buf), png_size_t(0), PNG_BYTES_TO_CHECK)!=0, + "png_check_validity: invalid png image"); + } + + static void read_data( png_structp png_ptr + , png_bytep data + , png_size_t length + ) + { + static_cast(png_get_io_ptr(png_ptr) )->read( data + , length ); + } + + static void write_data( png_structp png_ptr + , png_bytep data + , png_size_t length + ) + { + static_cast( png_get_io_ptr( png_ptr ))->write( data + , length ); + } + + static void flush( png_structp png_ptr ) + { + static_cast(png_get_io_ptr(png_ptr) )->flush(); + } + + + static int read_user_chunk_callback( png_struct* /* png_ptr */ + , png_unknown_chunkp /* chunk */ + ) + { + // @todo + return 0; + } + + static void read_row_callback( png_structp /* png_ptr */ + , png_uint_32 /* row_number */ + , int /* pass */ + ) + { + // @todo + } + +}; + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_PNG_IO_BASE_HPP diff --git a/boost/gil/extension/io_new/formats/png/is_allowed.hpp b/boost/gil/extension/io_new/formats/png/is_allowed.hpp new file mode 100644 index 00000000..cd9fbada --- /dev/null +++ b/boost/gil/extension/io_new/formats/png/is_allowed.hpp @@ -0,0 +1,55 @@ +/* + Copyright 2008 Christian Henning, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNG_IO_IS_ALLOWED_HPP +#define BOOST_GIL_EXTENSION_IO_PNG_IO_IS_ALLOWED_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace boost { namespace gil { namespace detail { + +template< typename View > +bool is_allowed( const image_read_info< png_tag >& info + , mpl::true_ // is read_and_no_convert + ) +{ + typedef typename get_pixel_type< View >::type pixel_t; + + typedef typename channel_traits< + typename element_type< pixel_t >::type >::value_type channel_t; + + const png_num_channels::type dst_num_channels = num_channels< pixel_t >::value; + const png_bitdepth::type dst_bit_depth = detail::unsigned_integral_num_bits< channel_t >::value; + + return dst_num_channels == info._num_channels + && dst_bit_depth == info._bit_depth; +} + +template< typename View > +bool is_allowed( const image_read_info< png_tag >& /* info */ + , mpl::false_ // is read_and_convert + ) +{ + return true; +} + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_PNG_IO_IS_ALLOWED_HPP diff --git a/boost/gil/extension/io_new/formats/png/read.hpp b/boost/gil/extension/io_new/formats/png/read.hpp new file mode 100644 index 00000000..8d9966a3 --- /dev/null +++ b/boost/gil/extension/io_new/formats/png/read.hpp @@ -0,0 +1,923 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_PNG_IO_READ_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_PNG_IO_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "base.hpp" +#include "is_allowed.hpp" + +namespace boost { namespace gil { namespace detail { + +template< typename Device + , typename ConversionPolicy + > +class reader< Device + , png_tag + , ConversionPolicy + > + : public png_io_base< Device > + , public reader_base< png_tag + , ConversionPolicy > +{ +public: + + reader( Device& io_dev + , const image_read_settings< png_tag >& settings + ) + : png_io_base< Device >( io_dev ) + , reader_base< png_tag + , ConversionPolicy >( settings ) + , _png_ptr ( NULL ) + , _info_ptr( NULL ) + { + this->check(); + init_reader(); + } + + reader( Device& io_dev + , const typename ConversionPolicy::color_converter_type& cc + , const image_read_settings< png_tag >& settings + ) + : png_io_base< Device >( io_dev ) + , reader_base< png_tag + , ConversionPolicy >( cc + , settings + ) + , _png_ptr ( 0 ) + , _info_ptr( 0 ) + { + this->check(); + init_reader(); + } + + ~reader() + { + png_destroy_read_struct( &_png_ptr + , &_info_ptr + , NULL + ); + } + + image_read_info get_info() const + { + image_read_info< png_tag > ret; + + // get PNG_IHDR chunk information from png_info structure + png_get_IHDR( _png_ptr + , _info_ptr + , &ret._width + , &ret._height + , &ret._bit_depth + , &ret._color_type + , &ret._interlace_method + , &ret._compression_method + , &ret._filter_method + ); + + // get number of color channels in image + ret._num_channels = png_get_channels( _png_ptr + , _info_ptr + ); + +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + + // Get CIE chromacities and referenced white point for given image + if( this->_settings._read_cie_chromacities ) + { + ret._valid_cie_colors = png_get_cHRM( _png_ptr + , _info_ptr + , &ret._white_x, &ret._white_y + , &ret._red_x, &ret._red_y + , &ret._green_x, &ret._green_y + , &ret._blue_x, &ret._blue_y + ); + } + + // get the gamma value for given image + if( this->_settings._read_file_gamma ) + { + ret._valid_file_gamma = png_get_gAMA( _png_ptr + , _info_ptr + , &ret._file_gamma + ); + if( ret._valid_file_gamma == false ) + { + ret._file_gamma = 1.0; + } + } +#else + + // Get CIE chromacities and referenced white point for given image + if( this->_settings._read_cie_chromacities ) + { + ret._valid_cie_colors = png_get_cHRM_fixed( _png_ptr + , _info_ptr + , &ret._white_x, &ret._white_y + , &ret._red_x, &ret._red_y + , &ret._green_x, &ret._green_y + , &ret._blue_x, &ret._blue_y + ); + } + + // get the gamma value for given image + if( this->_settings._read_file_gamma ) + { + ret._valid_file_gamma = png_get_gAMA_fixed( _png_ptr + , _info_ptr + , &ret._file_gamma + ); + + if( ret._valid_file_gamma == false ) + { + ret._file_gamma = 1; + } + } +#endif // BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + + // get the embedded ICC profile data for given image + if( this->_settings._read_icc_profile ) + { + png_charp icc_name = png_charp( NULL ); + png_charp profile = png_charp( NULL ); + + ret._valid_icc_profile = png_get_iCCP( _png_ptr + , _info_ptr + , &icc_name + , &ret._iccp_compression_type + , &profile + , &ret._profile_length + ); + if( icc_name ) + { + ret._icc_name.append( icc_name + , std::strlen( icc_name ) + ); + } + + if( ret._profile_length > 0 ) + { + ret._profile.append( profile + , ret._profile_length + ); + } + } + + // get the rendering intent for given image + if( this->_settings._read_intent ) + { + ret._valid_intent = png_get_sRGB( _png_ptr + , _info_ptr + , &ret._intent + ); + } + + // get image palette information from png_info structure + if( this->_settings._read_palette ) + { + png_colorp palette = png_colorp( NULL ); + + ret._valid_palette = png_get_PLTE( _png_ptr + , _info_ptr + , &palette + , &ret._num_palette + ); + + if( ret._num_palette > 0 ) + { + ret._palette.resize( ret._num_palette ); + std::copy( palette + , palette + ret._num_palette + , &ret._palette.front() + ); + } + } + + // get background color for given image + if( this->_settings._read_background ) + { + png_color_16p background = png_color_16p( NULL ); + + ret._valid_background = png_get_bKGD( _png_ptr + , _info_ptr + , &background + ); + if( background ) + { + ret._background = *background; + } + } + + // get the histogram for given image + if( this->_settings._read_histogram ) + { + png_uint_16p histogram = png_uint_16p( NULL ); + + ret._valid_histogram = png_get_hIST( _png_ptr + , _info_ptr + , &histogram + ); + + if( histogram ) + { + // the number of values is set by the number of colors inside + // the palette. + if( this->_settings._read_palette == false ) + { + png_colorp palette = png_colorp( NULL ); + png_get_PLTE( _png_ptr + , _info_ptr + , &palette + , &ret._num_palette + ); + } + + std::copy( histogram + , histogram + ret._num_palette + , &ret._histogram.front() + ); + } + } + + // get screen offsets for the given image + if( this->_settings._read_screen_offsets ) + { + ret._valid_offset = png_get_oFFs( _png_ptr + , _info_ptr + , &ret._offset_x + , &ret._offset_y + , &ret._off_unit_type + ); + } + + + // get pixel calibration settings + if( this->_settings._read_pixel_calibration ) + { + png_charp purpose = png_charp ( NULL ); + png_charp units = png_charp ( NULL ); + png_charpp params = png_charpp( NULL ); + + ret._valid_pixel_calibration = png_get_pCAL( _png_ptr + , _info_ptr + , &purpose + , &ret._X0 + , &ret._X1 + , &ret._cal_type + , &ret._num_params + , &units + , ¶ms + ); + if( purpose ) + { + ret._purpose.append( purpose + , std::strlen( purpose ) + ); + } + + if( units ) + { + ret._units.append( units + , std::strlen( units ) + ); + } + + if( ret._num_params > 0 ) + { + ret._params.resize( ret._num_params ); + + for( png_CAL_nparam::type i = 0 + ; i < ret._num_params + ; ++i + ) + { + ret._params[i].append( params[i] + , std::strlen( params[i] ) + ); + } + } + } + + // get the physical resolution for given image + if( this->_settings._read_physical_resolution ) + { + ret._valid_resolution = png_get_pHYs( _png_ptr + , _info_ptr + , &ret._res_x + , &ret._res_y + , &ret._phy_unit_type + ); + } + + // get number of significant bits for each color channel + if( this->_settings._read_number_of_significant_bits ) + { + png_color_8p sig_bits = png_color_8p( NULL ); + + ret._valid_significant_bits = png_get_sBIT( _png_ptr + , _info_ptr + , &sig_bits + ); + + // @todo Is there one or more colors? + if( sig_bits ) + { + ret._sig_bits = *sig_bits; + } + } + +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + + // get physical scale settings + if( this->_settings._read_scale_factors ) + { + ret._valid_scale_factors = png_get_sCAL( _png_ptr + , _info_ptr + , &ret._scale_unit + , &ret._scale_width + , &ret._scale_height + ); + } +#else +#ifdef BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTED + if( this->_settings._read_scale_factors ) + { + png_charp scale_width, scale_height; + + if( ret._valid_scale_factors = png_get_sCAL_s( _png_ptr + , _info_ptr + , &ret._scale_unit + , &scale_width + , &scale_height + ) + ) + { + if( scale_width ) + { + ret._scale_width.append( scale_width + , std::strlen( scale_width ) + ); + } + + if( scale_height ) + { + ret._scale_height.append( scale_height + , std::strlen( scale_height ) + ); + } + } + } +#endif // BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTED +#endif // BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + + // get comments information from png_info structure + if( this->_settings._read_comments ) + { + png_textp text = png_textp( NULL ); + + ret._valid_text = png_get_text( _png_ptr + , _info_ptr + , &text + , &ret._num_text + ); + + if( ret._num_text > 0 ) + { + ret._text.resize( ret._num_text ); + + for( png_num_text::type i = 0 + ; i < ret._num_text + ; ++i + ) + { + ret._text[i]._compression = text[i].compression; + ret._text[i]._key.append( text[i].key + , std::strlen( text[i].key ) + ); + + ret._text[i]._text.append( text[i].text + , std::strlen( text[i].text ) + ); + } + } + } + + // get last modification time for the image + if( this->_settings._read_last_modification_time ) + { + png_timep mod_time = png_timep( NULL ); + ret._valid_modification_time = png_get_tIME( _png_ptr + , _info_ptr + , &mod_time + ); + ret._mod_time = *mod_time; + } + + // get transparency data for images + if( this->_settings._read_transparency_data ) + { + png_bytep trans = png_bytep ( NULL ); + png_color_16p trans_values = png_color_16p( NULL ); + + ret._valid_transparency_factors = png_get_tRNS( _png_ptr + , _info_ptr + , &trans + , &ret._num_trans + , &trans_values + ); + + if( trans ) + { + //@todo What to do, here? How do I know the length of the "trans" array? + } + + if( ret._num_trans ) + { + ret._trans_values.resize( ret._num_trans ); + std::copy( trans_values + , trans_values + ret._num_trans + , &ret._trans_values.front() + ); + } + } + + // @todo One day! +/* + if( false ) + { + png_unknown_chunkp unknowns = png_unknown_chunkp( NULL ); + int num_unknowns = static_cast< int >( png_get_unknown_chunks( _png_ptr + , _info_ptr + , &unknowns + ) + ); + } +*/ + + return ret; + } + + template< typename View > + void apply( const View& view ) + { + // The info structures are filled at this point. + + // Now it's time for some transformations. + + if( little_endian() ) + { + if( this->_info._bit_depth == 16 ) + { + // Swap bytes of 16 bit files to least significant byte first. + png_set_swap( _png_ptr ); + } + + if( this->_info._bit_depth < 8 ) + { + // swap bits of 1, 2, 4 bit packed pixel formats + png_set_packswap( _png_ptr ); + } + } + + if( this->_info._color_type == PNG_COLOR_TYPE_PALETTE ) + { + png_set_palette_to_rgb( _png_ptr ); + } + + if( this->_info._num_trans > 0 ) + { + png_set_tRNS_to_alpha( _png_ptr ); + } + + // Tell libpng to handle the gamma conversion for you. The final call + // is a good guess for PC generated images, but it should be configurable + // by the user at run time by the user. It is strongly suggested that + // your application support gamma correction. + if( this->_settings._apply_screen_gamma ) + { + // png_set_gamma will change the image data! + +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + png_set_gamma( _png_ptr + , this->_settings._screen_gamma + , this->_info._file_gamma + ); +#else + png_set_gamma( _png_ptr + , this->_settings._screen_gamma + , this->_info._file_gamma + ); +#endif // BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + } + + // Turn on interlace handling. REQUIRED if you are not using + // png_read_image(). To see how to handle interlacing passes, + // see the png_read_row() method below: + _number_passes = png_set_interlace_handling( _png_ptr ); + + + // The above transformation might have changed the bit_depth and color type. + png_read_update_info( _png_ptr + , _info_ptr + ); + + this->_info._bit_depth = png_get_bit_depth( _png_ptr + , _info_ptr + ); + + this->_info._num_channels = png_get_channels( _png_ptr + , _info_ptr + ); + + this->_info._color_type = png_get_color_type( _png_ptr + , _info_ptr + ); + + switch( this->_info._color_type ) + { + case PNG_COLOR_TYPE_GRAY: + { + switch( this->_info._bit_depth ) + { + case 1: read_rows< gray1_image_t::view_t::reference >( view ); break; + case 2: read_rows< gray2_image_t::view_t::reference >( view ); break; + case 4: read_rows< gray4_image_t::view_t::reference >( view ); break; + case 8: read_rows< gray8_pixel_t >( view ); break; + case 16: read_rows< gray16_pixel_t >( view ); break; + default: io_error( "png_reader::read_data(): unknown combination of color type and bit depth" ); + } + + break; + } + case PNG_COLOR_TYPE_GA: + { + #ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA + switch( this->_info._bit_depth ) + { + case 8: read_rows< gray_alpha8_pixel_t > ( view ); break; + case 16: read_rows< gray_alpha16_pixel_t >( view ); break; + default: io_error( "png_reader::read_data(): unknown combination of color type and bit depth" ); + } + #else + io_error( "gray_alpha isn't enabled. Use ENABLE_GRAY_ALPHA when building application." ); + #endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA + + + break; + } + case PNG_COLOR_TYPE_RGB: + { + switch( this->_info._bit_depth ) + { + case 8: read_rows< rgb8_pixel_t > ( view ); break; + case 16: read_rows< rgb16_pixel_t >( view ); break; + default: io_error( "png_reader::read_data(): unknown combination of color type and bit depth" ); + } + + break; + } + case PNG_COLOR_TYPE_RGBA: + { + switch( this->_info._bit_depth ) + { + case 8: read_rows< rgba8_pixel_t > ( view ); break; + case 16: read_rows< rgba16_pixel_t >( view ); break; + default: io_error( "png_reader_color_convert::read_data(): unknown combination of color type and bit depth" ); + } + + break; + } + default: io_error( "png_reader_color_convert::read_data(): unknown color type" ); + } + + // read rest of file, and get additional chunks in info_ptr + png_read_end( _png_ptr + , NULL + ); + } + + +private: + + template< typename ImagePixel + , typename View + > + void read_rows( const View& view ) + { + typedef row_buffer_helper_view< ImagePixel > row_buffer_helper_t; + + typedef typename row_buffer_helper_t::buffer_t buffer_t; + typedef typename row_buffer_helper_t::iterator_t it_t; + + typedef typename is_same< ConversionPolicy + , read_and_no_convert + >::type is_read_and_convert_t; + + io_error_if( !is_allowed< View >( this->_info + , is_read_and_convert_t() + ) + , "Image types aren't compatible." + ); + + std::size_t rowbytes = png_get_rowbytes( _png_ptr + , _info_ptr + ); + + row_buffer_helper_t buffer( rowbytes + , true + ); + + png_bytep row_ptr = (png_bytep)( &( buffer.data()[0])); + + for( std::size_t pass = 0; pass < _number_passes; pass++ ) + { + if( pass == _number_passes - 1 ) + { + // skip lines if necessary + for( std::ptrdiff_t y = 0; y < this->_settings._top_left.y; ++y ) + { + // Read the image using the "sparkle" effect. + png_read_rows( _png_ptr + , &row_ptr + , NULL + , 1 + ); + } + + for( std::ptrdiff_t y = 0 + ; y < this->_settings._dim.y + ; ++y + ) + { + // Read the image using the "sparkle" effect. + png_read_rows( _png_ptr + , &row_ptr + , NULL + , 1 + ); + + it_t first = buffer.begin() + this->_settings._top_left.x; + it_t last = first + this->_settings._dim.x; // one after last element + + this->_cc_policy.read( first + , last + , view.row_begin( y )); + } + + // Read the rest of the image. libpng needs that. + std::ptrdiff_t remaining_rows = static_cast< std::ptrdiff_t >( this->_info._height ) + - this->_settings._top_left.y + - this->_settings._dim.y; + for( std::ptrdiff_t y = 0 + ; y < remaining_rows + ; ++y + ) + { + // Read the image using the "sparkle" effect. + png_read_rows( _png_ptr + , &row_ptr + , NULL + , 1 + ); + } + } + else + { + for( int y = 0; y < view.height(); ++y ) + { + // Read the image using the "sparkle" effect. + png_read_rows( _png_ptr + , &row_ptr + , NULL + , 1 + ); + } + } + } + + } + + void init_reader() + { + // Create and initialize the png_struct with the desired error handler + // functions. If you want to use the default stderr and longjump method, + // you can supply NULL for the last three parameters. We also supply the + // the compiler header file version, so that we know if the application + // was compiled with a compatible version of the library. REQUIRED + _png_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING + , NULL // user_error_ptr + , NULL // user_error_fn + , NULL // user_warning_fn + ); + + io_error_if( _png_ptr == NULL + , "png_reader: fail to call png_create_write_struct()" + ); + + png_uint_32 user_chunk_data[4]; + user_chunk_data[0] = 0; + user_chunk_data[1] = 0; + user_chunk_data[2] = 0; + user_chunk_data[3] = 0; + png_set_read_user_chunk_fn( _png_ptr + , user_chunk_data + , png_io_base< Device >::read_user_chunk_callback + ); + + // Allocate/initialize the memory for image information. REQUIRED. + _info_ptr = png_create_info_struct( _png_ptr ); + + if( _info_ptr == NULL ) + { + png_destroy_read_struct( &_png_ptr + , NULL + , NULL + ); + + io_error( "png_reader: fail to call png_create_info_struct()" ); + } + + // Set error handling if you are using the setjmp/longjmp method (this is + // the normal method of doing things with libpng). REQUIRED unless you + // set up your own error handlers in the png_create_read_struct() earlier. + if( setjmp( png_jmpbuf( _png_ptr ))) + { + //free all of the memory associated with the png_ptr and info_ptr + png_destroy_read_struct( &_png_ptr + , &_info_ptr + , NULL + ); + + io_error( "png is invalid" ); + } + + png_set_read_fn( _png_ptr + , static_cast< png_voidp >( &this->_io_dev ) + , png_io_base< Device >::read_data + ); + + // Set up a callback function that will be + // called after each row has been read, which you can use to control + // a progress meter or the like. + png_set_read_status_fn( _png_ptr + , png_io_base< Device >::read_row_callback + ); + + // Set up a callback which implements user defined transformation. + // @todo + png_set_read_user_transform_fn( _png_ptr + , png_user_transform_ptr( NULL ) + ); + + png_set_keep_unknown_chunks( _png_ptr + , PNG_HANDLE_CHUNK_ALWAYS + , NULL + , 0 + ); + + + // Make sure we read the signature. + // @todo make it an option + png_set_sig_bytes( _png_ptr + , PNG_BYTES_TO_CHECK + ); + + // The call to png_read_info() gives us all of the information from the + // PNG file before the first IDAT (image data chunk). REQUIRED + png_read_info( _png_ptr + , _info_ptr + ); + } + +private: + + png_structp _png_ptr; + png_infop _info_ptr; + + std::size_t _number_passes; +}; + + +struct png_type_format_checker +{ + png_type_format_checker( png_bitdepth::type bit_depth + , png_color_type::type color_type + ) + : _bit_depth ( bit_depth ) + , _color_type( color_type ) + {} + + template< typename Image > + bool apply() + { + typedef is_read_supported< typename get_pixel_type< typename Image::view_t >::type + , png_tag + > is_supported_t; + + return is_supported_t::_bit_depth == _bit_depth + && is_supported_t::_color_type == _color_type; + } + +private: + + png_bitdepth::type _bit_depth; + png_color_type::type _color_type; +}; + +struct png_read_is_supported +{ + template< typename View > + struct apply : public is_read_supported< typename get_pixel_type< View >::type + , png_tag + > + {}; +}; + +template< typename Device + > +class dynamic_image_reader< Device + , png_tag + > + : public reader< Device + , png_tag + , detail::read_and_no_convert + > +{ + typedef reader< Device + , png_tag + , detail::read_and_no_convert + > parent_t; + +public: + + dynamic_image_reader( Device& device + , const image_read_settings< png_tag >& settings + ) + : parent_t( device + , settings + ) + {} + + template< typename Images > + void apply( any_image< Images >& images ) + { + png_type_format_checker format_checker( this->_info._bit_depth + , this->_info._color_type + ); + + if( !construct_matched( images + , format_checker + )) + { + io_error( "No matching image type between those of the given any_image and that of the file" ); + } + else + { + init_image( images + , this->_info + ); + + dynamic_io_fnobj< png_read_is_supported + , parent_t + > op( this ); + + apply_operation( view( images ) + , op + ); + } + } +}; + +} // namespace detail +} // namespace gil +} // namespace boost + + + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_PNG_IO_READ_HPP diff --git a/boost/gil/extension/io_new/formats/png/supported_types.hpp b/boost/gil/extension/io_new/formats/png/supported_types.hpp new file mode 100644 index 00000000..b0fc89bd --- /dev/null +++ b/boost/gil/extension/io_new/formats/png/supported_types.hpp @@ -0,0 +1,366 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNG_SUPPORTED_TYPES_HPP +#define BOOST_GIL_EXTENSION_IO_PNG_SUPPORTED_TYPES_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA +#include +#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA + +namespace boost { namespace gil { namespace detail { + +static const size_t PNG_BYTES_TO_CHECK = 4; + +// Read support +template< png_bitdepth::type BitDepth + , png_color_type::type ColorType + > +struct png_rw_support_base +{ + static const png_bitdepth::type _bit_depth = BitDepth; + static const png_color_type::type _color_type = ColorType; +}; + +template< typename Channel + , typename ColorSpace + > +struct png_read_support : read_support_false + , png_rw_support_base< 1 + , PNG_COLOR_TYPE_GRAY + > {}; + +template< typename BitField + , bool Mutable + > +struct png_read_support< packed_dynamic_channel_reference< BitField + , 1 + , Mutable + > + , gray_t + > : read_support_true + , png_rw_support_base< 1 + , PNG_COLOR_TYPE_GRAY + > {}; + +template< typename BitField + , bool Mutable + > +struct png_read_support< packed_dynamic_channel_reference< BitField + , 2 + , Mutable + > + , gray_t + > : read_support_true + , png_rw_support_base< 2 + , PNG_COLOR_TYPE_GRAY + > {}; + +template< typename BitField + , bool Mutable + > +struct png_read_support< packed_dynamic_channel_reference< BitField + , 4 + , Mutable + > + , gray_t + > : read_support_true + , png_rw_support_base< 4 + , PNG_COLOR_TYPE_GRAY + > {}; + +template<> +struct png_read_support< bits8 + , gray_t + > : read_support_true + , png_rw_support_base< 8 + , PNG_COLOR_TYPE_GRAY + > {}; + +#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA +template<> +struct png_read_support< bits8 + , gray_alpha_t + > : read_support_true + , png_rw_support_base< 8 + , PNG_COLOR_TYPE_GA + > {}; +#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA + +template<> +struct png_read_support< bits8 + , rgb_t + > : read_support_true + , png_rw_support_base< 8 + , PNG_COLOR_TYPE_RGB + > {}; + +template<> +struct png_read_support< bits8 + , rgba_t + > : read_support_true + , png_rw_support_base< 8 + , PNG_COLOR_TYPE_RGBA + > {}; + +template<> +struct png_read_support< bits16 + , gray_t + > : read_support_true + , png_rw_support_base< 16 + , PNG_COLOR_TYPE_GRAY + > {}; + +template<> +struct png_read_support< bits16 + , rgb_t + > : read_support_true + , png_rw_support_base< 16 + , PNG_COLOR_TYPE_RGB + > {}; + +template<> +struct png_read_support< bits16 + , rgba_t + > : read_support_true + , png_rw_support_base< 16 + , PNG_COLOR_TYPE_RGBA + > {}; + +#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA +template<> +struct png_read_support< bits16 + , gray_alpha_t + > : read_support_true + , png_rw_support_base< 16 + , PNG_COLOR_TYPE_GA + > {}; +#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA + +// Write support + +template< typename Channel + , typename ColorSpace + > +struct png_write_support : write_support_false + , png_rw_support_base< 1 + , PNG_COLOR_TYPE_GRAY + > {}; + +template< typename BitField + , bool Mutable + > +struct png_write_support< packed_dynamic_channel_reference< BitField + , 1 + , Mutable + > + , gray_t + > : write_support_true + , png_rw_support_base< 1 + , PNG_COLOR_TYPE_GRAY + > +{}; + +template< typename BitField + , bool Mutable + > +struct png_write_support< packed_dynamic_channel_reference< BitField + , 1 + , Mutable + > const + , gray_t + > : write_support_true + , png_rw_support_base< 1 + , PNG_COLOR_TYPE_GRAY + > +{}; + +template< typename BitField + , bool Mutable + > +struct png_write_support< packed_dynamic_channel_reference< BitField + , 2 + , Mutable + > + , gray_t + > : write_support_true + , png_rw_support_base< 2 + , PNG_COLOR_TYPE_GRAY + > +{}; + +template< typename BitField + , bool Mutable + > +struct png_write_support< packed_dynamic_channel_reference< BitField + , 2 + , Mutable + > const + , gray_t + > : write_support_true + , png_rw_support_base< 2 + , PNG_COLOR_TYPE_GRAY + > +{}; + +template< typename BitField + , bool Mutable + > +struct png_write_support< packed_dynamic_channel_reference< BitField + , 4 + , Mutable + > + , gray_t + > : write_support_true + , png_rw_support_base< 4 + , PNG_COLOR_TYPE_GRAY + > +{}; + +template< typename BitField + , bool Mutable + > +struct png_write_support< packed_dynamic_channel_reference< BitField + , 4 + , Mutable + > const + , gray_t + > : write_support_true + , png_rw_support_base< 4 + , PNG_COLOR_TYPE_GRAY + > +{}; + +template<> +struct png_write_support< bits8 + , gray_t + > : write_support_true + , png_rw_support_base< 8 + , PNG_COLOR_TYPE_GRAY + > +{}; + +#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA +template<> +struct png_write_support< bits8 + , gray_alpha_t + > : write_support_true + , png_rw_support_base< 8 + , PNG_COLOR_TYPE_GA + > +{}; +#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA + +template<> +struct png_write_support< bits8 + , rgb_t + > : write_support_true + , png_rw_support_base< 8 + , PNG_COLOR_TYPE_RGB + > +{}; + +template<> +struct png_write_support< bits8 + , rgba_t + > : write_support_true + , png_rw_support_base< 8 + , PNG_COLOR_TYPE_RGBA + > +{}; + +template<> +struct png_write_support< bits16 + , gray_t + > : write_support_true + , png_rw_support_base< 16 + , PNG_COLOR_TYPE_GRAY + > +{}; + +template<> +struct png_write_support< bits16 + , rgb_t + > : write_support_true + , png_rw_support_base< 16 + , PNG_COLOR_TYPE_RGB + > +{}; + +template<> +struct png_write_support< bits16 + , rgba_t + > : write_support_true + , png_rw_support_base< 16 + , PNG_COLOR_TYPE_RGBA + > +{}; + +#ifdef BOOST_GIL_IO_ENABLE_GRAY_ALPHA +template<> +struct png_write_support< bits16 + , gray_alpha_t + > : write_support_true + , png_rw_support_base< 16 + , PNG_COLOR_TYPE_GA + > +{}; +#endif // BOOST_GIL_IO_ENABLE_GRAY_ALPHA + + +} // namespace detail + +template< typename Pixel > +struct is_read_supported< Pixel + , png_tag + > + : mpl::bool_< detail::png_read_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + >::is_supported + > +{ + typedef detail::png_read_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + > parent_t; + + static const png_bitdepth::type _bit_depth = parent_t::_bit_depth; + static const png_color_type::type _color_type = parent_t::_color_type; +}; + +template< typename Pixel > +struct is_write_supported< Pixel + , png_tag + > + : mpl::bool_< detail::png_write_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + >::is_supported + > +{ + typedef detail::png_write_support< typename channel_type< Pixel >::type + , typename color_space_type< Pixel >::type + > parent_t; + + static const png_bitdepth::type _bit_depth = parent_t::_bit_depth; + static const png_color_type::type _color_type = parent_t::_color_type; +}; + +} // namespace gil +} // namespace boost + + +#endif // BOOST_GIL_EXTENSION_IO_PNG_SUPPORTED_TYPES_HPP diff --git a/boost/gil/extension/io_new/formats/png/write.hpp b/boost/gil/extension/io_new/formats/png/write.hpp new file mode 100644 index 00000000..2ec5276a --- /dev/null +++ b/boost/gil/extension/io_new/formats/png/write.hpp @@ -0,0 +1,521 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_PNG_IO_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_PNG_IO_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +extern "C" { +#include +} + +#include +#include +#include + +#include "base.hpp" +#include "supported_types.hpp" + +namespace boost { namespace gil { namespace detail { + +template +class writer< Device + , png_tag + > : png_io_base< Device > +{ + +public: + + writer( Device& io_dev ) + : png_io_base< Device >( io_dev ) + , _png_ptr ( NULL ) + , _info_ptr( NULL ) + { + // Create and initialize the png_struct with the desired error handler + // functions. If you want to use the default stderr and longjump method, + // you can supply NULL for the last three parameters. We also check that + // the library version is compatible with the one used at compile time, + // in case we are using dynamically linked libraries. REQUIRED. + _png_ptr = png_create_write_struct( PNG_LIBPNG_VER_STRING + , NULL // user_error_ptr + , NULL // user_error_fn + , NULL // user_warning_fn + ); + + io_error_if( _png_ptr == NULL + , "png_writer: fail to call png_create_write_struct()" + ); + + // Allocate/initialize the image information data. REQUIRED + _info_ptr = png_create_info_struct( _png_ptr ); + + if( _info_ptr == NULL ) + { + png_destroy_write_struct( &_png_ptr + , NULL + ); + + io_error( "png_writer: fail to call png_create_info_struct()" ); + } + + // Set error handling. REQUIRED if you aren't supplying your own + // error handling functions in the png_create_write_struct() call. + if( setjmp( png_jmpbuf( _png_ptr ))) + { + //free all of the memory associated with the png_ptr and info_ptr + png_destroy_write_struct( &_png_ptr + , &_info_ptr + ); + + io_error( "png_writer: fail to call setjmp()" ); + } + + this->init_io( _png_ptr ); + } + + ~writer() + { + png_destroy_write_struct( &_png_ptr + , &_info_ptr + ); + } + + template< typename View > + void apply( const View& view ) + { + apply( view, image_write_info< png_tag >() ); + } + + template + void apply( const View& view + , const image_write_info< png_tag >& info + ) + { + typedef png_write_support< typename channel_type < typename get_pixel_type< View >::type >::type + , typename color_space_type< View >::type + > png_rw_info_t; + + io_error_if( view.width() == 0 && view.height() == 0 + , "png format cannot handle empty views." + ); + + // Set the image information here. Width and height are up to 2^31, + // bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on + // the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY, + // PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB, + // or PNG_COLOR_TYPE_RGB_ALPHA. interlace is either PNG_INTERLACE_NONE or + // PNG_INTERLACE_ADAM7, and the compression_type and filter_type MUST + // currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE. REQUIRED + png_set_IHDR( _png_ptr + , _info_ptr + , static_cast< png_image_width::type >( view.width() ) + , static_cast< png_image_height::type >( view.height() ) + , static_cast< png_bitdepth::type >( png_rw_info_t::_bit_depth ) + , static_cast< png_color_type::type >( png_rw_info_t::_color_type ) + , info._interlace_method + , info._compression_method + , info._filter_method + ); + +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + if( info._valid_cie_colors ) + { + png_set_cHRM( _png_ptr + , _info_ptr + , info._white_x + , info._white_y + , info._red_x + , info._red_y + , info._green_x + , info._green_y + , info._blue_x + , info._blue_y + ); + } + + if( info._valid_file_gamma ) + { + png_set_gAMA( _png_ptr + , _info_ptr + , info._gamma + ); + } +#else + if( info._valid_cie_colors ) + { + png_set_cHRM_fixed( _png_ptr + , _info_ptr + , info._white_x + , info._white_y + , info._red_x + , info._red_y + , info._green_x + , info._green_y + , info._blue_x + , info._blue_y + ); + } + + if( info._valid_file_gamma ) + { + png_set_gAMA_fixed( _png_ptr + , _info_ptr + , info._file_gamma + ); + } +#endif // BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + + if( info._valid_icc_profile ) + { + png_set_iCCP( _png_ptr + , _info_ptr + , const_cast< png_charp >( info._icc_name.c_str() ) + , info._iccp_compression_type + , const_cast< png_charp >( info._profile.c_str() ) + , info._profile_length + ); + } + + if( info._valid_intent ) + { + png_set_sRGB( _png_ptr + , _info_ptr + , info._intent + ); + } + + if( info._valid_palette ) + { + png_set_PLTE( _png_ptr + , _info_ptr + , const_cast< png_colorp >( &info._palette.front() ) + , info._num_palette + ); + } + + if( info._valid_background ) + { + png_set_bKGD( _png_ptr + , _info_ptr + , const_cast< png_color_16p >( &info._background ) + ); + } + + if( info._valid_histogram ) + { + png_set_hIST( _png_ptr + , _info_ptr + , const_cast< png_uint_16p >( &info._histogram.front() ) + ); + } + + if( info._valid_offset ) + { + png_set_oFFs( _png_ptr + , _info_ptr + , info._offset_x + , info._offset_y + , info._off_unit_type + ); + } + + if( info._valid_pixel_calibration ) + { + std::vector< const char* > params( info._num_params ); + for( std::size_t i = 0; i < params.size(); ++i ) + { + params[i] = info._params[ i ].c_str(); + } + + png_set_pCAL( _png_ptr + , _info_ptr + , const_cast< png_charp >( info._purpose.c_str() ) + , info._X0 + , info._X1 + , info._cal_type + , info._num_params + , const_cast< png_charp >( info._units.c_str() ) + , const_cast< png_charpp >( ¶ms.front() ) + ); + } + + if( info._valid_resolution ) + { + png_set_pHYs( _png_ptr + , _info_ptr + , info._res_x + , info._res_y + , info._phy_unit_type + ); + } + + if( info._valid_significant_bits ) + { + png_set_sBIT( _png_ptr + , _info_ptr + , const_cast< png_color_8p >( &info._sig_bits ) + ); + } + +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + if( info._valid_scale_factors ) + { + png_set_sCAL( _png_ptr + , _info_ptr + , info._scale_unit + , info._scale_width + , info._scale_height + ); + } +#else +#ifdef BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTED + + if( info._valid_scale_factors ) + { + png_set_sCAL_s( _png_ptr + , _info_ptr + , _scale_unit + , const_cast< png_charp >( _scale_width.c_str() ) + , const_cast< png_charp >( _scale_height.c_str() ) + ); + } +#endif // BOOST_GIL_IO_PNG_FIXED_POINT_SUPPORTED +#endif // BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + + + if( info._valid_text ) + { + std::vector< png_text > texts( info._num_text ); + for( std::size_t i = 0; i < texts.size(); ++i ) + { + png_text pt; + pt.compression = info._text[i]._compression; + pt.key = const_cast< png_charp >( info._text[i]._key.c_str() ); + pt.text = const_cast< png_charp >( info._text[i]._text.c_str() ); + pt.text_length = info._text[i]._text.length(); + + texts[i] = pt; + } + + png_set_text( _png_ptr + , _info_ptr + , &texts.front() + , info._num_text + ); + } + + if( info._valid_modification_time ) + { + png_set_tIME( _png_ptr + , _info_ptr + , const_cast< png_timep >( &info._mod_time ) + ); + } + + if( info._valid_transparency_factors ) + { + int sample_max = ( 1 << info._bit_depth ); + + /* libpng doesn't reject a tRNS chunk with out-of-range samples */ + if( !( ( info._color_type == PNG_COLOR_TYPE_GRAY + && (int) info._trans_values[0].gray > sample_max + ) + || ( info._color_type == PNG_COLOR_TYPE_RGB + &&( (int) info._trans_values[0].red > sample_max + || (int) info._trans_values[0].green > sample_max + || (int) info._trans_values[0].blue > sample_max + ) + ) + ) + ) + { + //@todo Fix that once reading transparency values works +/* + png_set_tRNS( _png_ptr + , _info_ptr + , trans + , num_trans + , trans_values + ); +*/ + } + } + + png_write_info( _png_ptr + ,_info_ptr + ); + + write_view( view + , typename is_bit_aligned< View >::type() + ); + } + +private: + + template + void write_view( const View& view + , mpl::false_ // is bit aligned + ) + { + typedef typename get_pixel_type< View >::type pixel_t; + + typedef png_write_support< typename channel_type < pixel_t >::type + , typename color_space_type< pixel_t >::type + > png_rw_info; + + if( little_endian() ) + { + if( png_rw_info::_bit_depth == 16 ) + { + png_set_swap( _png_ptr ); + } + + if( png_rw_info::_bit_depth < 8 ) + { + png_set_packswap( _png_ptr ); + } + } + + row_buffer_helper_view< View > row_buffer( view.width() + , false + ); + + for( int y = 0; y != view.height(); ++ y) + { + std::copy( view.row_begin( y ) + , view.row_end ( y ) + , row_buffer.begin() + ); + + png_write_row( _png_ptr + , reinterpret_cast< png_bytep >( row_buffer.data() ) + ); + } + + png_write_end( _png_ptr + , _info_ptr + ); + } + + template + void write_view( const View& view + , mpl::true_ // is bit aligned + ) + { + typedef png_write_support< typename kth_semantic_element_type< typename View::value_type + , 0 + >::type + , typename color_space_type::type + > png_rw_info; + + if (little_endian() ) + { + if( png_rw_info::_bit_depth == 16 ) + { + png_set_swap( _png_ptr ); + } + + if( png_rw_info::_bit_depth < 8 ) + { + png_set_packswap( _png_ptr ); + } + } + + row_buffer_helper_view< View > row_buffer( view.width() + , false + ); + + for( int y = 0; y != view.height(); ++y ) + { + std::copy( view.row_begin( y ) + , view.row_end ( y ) + , row_buffer.begin() + ); + + png_write_row( _png_ptr + , reinterpret_cast< png_bytep >( row_buffer.data() ) + ); + } + + png_free_data( _png_ptr + , _info_ptr + , PNG_FREE_UNKN + , -1 + ); + + png_write_end( _png_ptr + , _info_ptr + ); + } + + void init_io( png_structp png_ptr ) + { + png_set_write_fn( png_ptr + , static_cast< void* > ( &this->_io_dev ) + , static_cast< png_rw_ptr > ( &png_io_base::write_data ) + , static_cast< png_flush_ptr >( &png_io_base::flush ) + ); + } + + png_structp _png_ptr; + png_infop _info_ptr; +}; + +struct png_write_is_supported +{ + template< typename View > + struct apply + : public is_write_supported< typename get_pixel_type< View >::type + , png_tag + > + {}; +}; + +template< typename Device > +class dynamic_image_writer< Device + , png_tag + > + : public writer< Device + , png_tag + > +{ + typedef writer< Device + , png_tag + > parent_t; + +public: + + dynamic_image_writer( Device& file ) + : parent_t( file ) + {} + + template< typename Views > + void apply( const any_image_view< Views >& views ) + { + dynamic_io_fnobj< png_write_is_supported + , parent_t + > op( this ); + + apply_operation( views, op ); + } +}; + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_PNG_IO_WRITE_HPP diff --git a/boost/gil/extension/io_new/formats/pnm/is_allowed.hpp b/boost/gil/extension/io_new/formats/pnm/is_allowed.hpp new file mode 100644 index 00000000..42a9f171 --- /dev/null +++ b/boost/gil/extension/io_new/formats/pnm/is_allowed.hpp @@ -0,0 +1,60 @@ +/* + Copyright 2009 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNM_IO_IS_ALLOWED_HPP +#define BOOST_GIL_EXTENSION_IO_PNM_IO_IS_ALLOWED_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +namespace boost { namespace gil { namespace detail { + +template< typename View > +bool is_allowed( const image_read_info< pnm_tag >& info + , mpl::true_ // is read_and_no_convert + ) +{ + pnm_image_type::type asc_type = is_read_supported< typename get_pixel_type< View >::type + , pnm_tag + >::_asc_type; + + pnm_image_type::type bin_type = is_read_supported< typename get_pixel_type< View >::type + , pnm_tag + >::_bin_type; + if( info._type == pnm_image_type::mono_asc_t::value ) + { + // ascii mono images are read gray8_image_t + return ( asc_type == pnm_image_type::gray_asc_t::value ); + } + + + return ( asc_type == info._type + || bin_type == info._type + ); +} + +template< typename View > +bool is_allowed( const image_read_info< pnm_tag >& /* info */ + , mpl::false_ // is read_and_convert + ) +{ + return true; +} + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_PNM_IO_IS_ALLOWED_HPP diff --git a/boost/gil/extension/io_new/formats/pnm/read.hpp b/boost/gil/extension/io_new/formats/pnm/read.hpp new file mode 100644 index 00000000..044b8db5 --- /dev/null +++ b/boost/gil/extension/io_new/formats/pnm/read.hpp @@ -0,0 +1,498 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNM_IO_READ_HPP +#define BOOST_GIL_EXTENSION_IO_PNM_IO_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "is_allowed.hpp" + +namespace boost { namespace gil { namespace detail { + +template< typename View, typename T > +struct calc_pitch {}; + +template< typename View > +struct calc_pitch< View, mpl::false_ > +{ + static uint32_t do_it( uint32_t width ) { return width * num_channels< View >::value; } +}; + +template< typename View > +struct calc_pitch< View, mpl::true_ > +{ + static uint32_t do_it( uint32_t width ) { return ( width + 7 ) >> 3; } +}; + + +template< typename Device + , typename ConversionPolicy + > +class reader< Device + , pnm_tag + , ConversionPolicy + > + : public reader_base< pnm_tag + , ConversionPolicy + > +{ +private: + + typedef typename ConversionPolicy::color_converter_type cc_t; + +public: + reader( Device& device + , const image_read_settings< pnm_tag >& settings + ) + : reader_base< pnm_tag + , ConversionPolicy >( settings ) + , _io_dev( device ) + {} + + reader( Device& device + , const cc_t& cc + , const image_read_settings< pnm_tag >& settings + ) + : reader_base< pnm_tag + , ConversionPolicy >( cc + , settings + ) + , _io_dev( device ) + {} + + image_read_info get_info() + { + image_read_info ret; + + // read signature + io_error_if( read_char() != 'P', "Invalid PNM signature" ); + + ret._type = read_char() - '0'; + + io_error_if( ret._type < pnm_image_type::mono_asc_t::value || ret._type > pnm_image_type::color_bin_t::value + , "Invalid PNM file (supports P1 to P6)" + ); + + ret._width = read_int(); + ret._height = read_int(); + + if( ret._type == pnm_image_type::mono_asc_t::value || ret._type == pnm_image_type::mono_bin_t::value ) + { + ret._max_value = 1; + } + else + { + ret._max_value = read_int(); + + io_error_if( ret._max_value > 255 + , "Unsupported PNM format (supports maximum value 255)" + ); + } + + return ret; + } + + template + void apply( const View& view ) + { + + typedef typename is_same< ConversionPolicy + , read_and_no_convert + >::type is_read_and_convert_t; + + io_error_if( !is_allowed< View >( this->_info + , is_read_and_convert_t() + ) + , "Image types aren't compatible." + ); + + switch( this->_info._type ) + { + // reading mono text is reading grayscale but with only two values + case pnm_image_type::mono_asc_t::value: { read_text_data< gray8_view_t >( view ); break; } + case pnm_image_type::gray_asc_t::value: { read_text_data< gray8_view_t >( view ); break; } + case pnm_image_type::color_asc_t::value: { read_text_data< rgb8_view_t >( view ); break; } + + case pnm_image_type::mono_bin_t::value: { read_bin_data< gray1_image_t::view_t >( view ); break; } + case pnm_image_type::gray_bin_t::value: { read_bin_data< gray8_view_t >( view ); break; } + case pnm_image_type::color_bin_t::value: { read_bin_data< rgb8_view_t >( view ); break; } + } + } + +private: + + template< typename View_Src + , typename View_Dst + > + void read_text_data( const View_Dst& dst ) + { + typedef typename View_Dst::y_coord_t y_t; + + uint32_t pitch = this->_info._width * num_channels< View_Src >::value; + + byte_vector_t row( pitch ); + + //Skip scanlines if necessary. + for( int y = 0; y < this->_settings._top_left.y; ++y ) + { + read_text_row< View_Src >( dst, row, pitch, y, false ); + } + + for( y_t y = 0; y < dst.height(); ++y ) + { + read_text_row< View_Src >( dst, row, pitch, y, true ); + } + } + + template< typename View_Src + , typename View_Dst + > + void read_text_row( const View_Dst& dst + , byte_vector_t& row + , uint32_t pitch + , typename View_Dst::y_coord_t y + , bool process + ) + { + static char buf[16]; + + View_Src src = interleaved_view( this->_info._width + , 1 + , (typename View_Src::value_type*) &row.front() + , pitch + ); + + for( uint32_t x = 0; x < pitch; ++x ) + { + for( uint32_t k = 0; ; ) + { + int ch = _io_dev.getc_unchecked(); + + if( isdigit( ch )) + { + buf[ k++ ] = static_cast< char >( ch ); + } + else if( k ) + { + buf[ k ] = 0; + break; + } + else if( ch == EOF || !isspace( ch )) + { + return; + } + } + + if( process ) + { + int value = atoi( buf ); + + if( this->_info._max_value == 1 ) + { + typedef typename channel_type< typename get_pixel_type< View_Dst >::type >::type channel_t; + + // for pnm format 0 is white + row[x] = ( value != 0 ) + ? typename channel_traits< channel_t >::value_type( 0 ) + : channel_traits< channel_t >::max_value(); + } + else + { + row[x] = static_cast< byte_t >( value ); + } + } + } + + if( process ) + { + // We are reading a gray1_image like a gray8_image but the two pixel_t + // aren't compatible. Though, read_and_no_convert::read(...) wont work. + copy_data< View_Dst + , View_Src >( dst + , src + , y + , typename is_same< View_Dst + , gray1_image_t::view_t + >::type() + ); + } + } + + template< typename View_Dst + , typename View_Src + > + void copy_data( const View_Dst& dst + , const View_Src& src + , typename View_Dst::y_coord_t y + , mpl::true_ // is gray1_view + ) + { + if( this->_info._max_value == 1 ) + { + typename View_Dst::x_iterator it = dst.row_begin( y ); + + for( typename View_Dst::x_coord_t x = 0 + ; x < dst.width() + ; ++x + ) + { + it[x] = src[x]; + } + } + else + { + copy_data( dst + , src + , y + , mpl::false_() + ); + } + } + + template< typename View_Dst + , typename View_Src + > + void copy_data( const View_Dst& view + , const View_Src& src + , typename View_Dst::y_coord_t y + , mpl::false_ // is gray1_view + ) + { + typename View_Src::x_iterator beg = src.row_begin( 0 ) + this->_settings._top_left.x; + typename View_Src::x_iterator end = beg + this->_settings._dim.x; + + this->_cc_policy.read( beg + , end + , view.row_begin( y ) + ); + } + + + template< typename View_Src + , typename View_Dst + > + void read_bin_data( const View_Dst& view ) + { + typedef typename View_Dst::y_coord_t y_t; + typedef typename is_bit_aligned< + typename View_Src::value_type >::type is_bit_aligned_t; + + uint32_t pitch = calc_pitch< View_Src, is_bit_aligned_t >::do_it( this->_info._width ); + + typedef row_buffer_helper_view< View_Src > rh_t; + rh_t rh( pitch, true ); + + typename rh_t::iterator_t beg = rh.begin() + this->_settings._top_left.x; + typename rh_t::iterator_t end = beg + this->_settings._dim.x; + + // For bit_aligned images we need to negate all bytes in the row_buffer + // to make sure that 0 is black and 255 is white. + negate_bits< typename rh_t::buffer_t + , is_bit_aligned_t + > neg; + + swap_half_bytes< typename rh_t::buffer_t + , is_bit_aligned_t + > swhb; + + //Skip scanlines if necessary. + for( y_t y = 0; y < this->_settings._top_left.y; ++y ) + { + _io_dev.read( reinterpret_cast< byte_t* >( rh.data() ) + , pitch + ); + } + + for( y_t y = 0; y < view.height(); ++y ) + { + _io_dev.read( reinterpret_cast< byte_t* >( rh.data() ) + , pitch + ); + + neg( rh.buffer() ); + swhb( rh.buffer() ); + + this->_cc_policy.read( beg + , end + , view.row_begin( y ) + ); + } + } + +private: + + // Read a character and skip a comment if necessary. + char read_char() + { + char ch; + + if(( ch = _io_dev.getc() ) == '#' ) + { + // skip comment to EOL + do + { + ch = _io_dev.getc(); + } + while (ch != '\n' && ch != '\r'); + } + + return ch; + } + + unsigned int read_int() + { + char ch; + + // skip whitespaces, tabs, and new lines + do + { + ch = read_char(); + } + while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r'); + + if( ch < '0' || ch > '9' ) + { + io_error( "Unexpected characters reading decimal digits" ); + } + + unsigned val = 0; + + do + { + unsigned dig = ch - '0'; + + if( val > INT_MAX / 10 - dig ) + { + io_error( "Integer too large" ); + } + + val = val * 10 + dig; + + ch = read_char(); + } + while( '0' <= ch && ch <= '9' ); + + return val; + } + +private: + + Device& _io_dev; +}; + +struct pnm_type_format_checker +{ + pnm_type_format_checker( pnm_image_type::type type ) + : _type( type ) + {} + + template< typename Image > + bool apply() + { + typedef is_read_supported< typename get_pixel_type< typename Image::view_t >::type + , pnm_tag + > is_supported_t; + + return is_supported_t::_asc_type == _type + || is_supported_t::_bin_type == _type; + } + +private: + + pnm_image_type::type _type; +}; + +struct pnm_read_is_supported +{ + template< typename View > + struct apply : public is_read_supported< typename get_pixel_type< View >::type + , pnm_tag + > + {}; +}; + +template< typename Device + > +class dynamic_image_reader< Device + , pnm_tag + > + : public reader< Device + , pnm_tag + , detail::read_and_no_convert + > +{ + typedef reader< Device + , pnm_tag + , detail::read_and_no_convert + > parent_t; + +public: + + dynamic_image_reader( Device& device + , const image_read_settings< pnm_tag >& settings + ) + : parent_t( device + , settings + ) + {} + + template< typename Images > + void apply( any_image< Images >& images ) + { + pnm_type_format_checker format_checker( this->_info._type ); + + if( !construct_matched( images + , format_checker + )) + { + io_error( "No matching image type between those of the given any_image and that of the file" ); + } + else + { + init_image( images + , this->_info + ); + + dynamic_io_fnobj< pnm_read_is_supported + , parent_t + > op( this ); + + apply_operation( view( images ) + , op + ); + } + } +}; + +} // detail +} // gil +} // boost + +#endif // BOOST_GIL_EXTENSION_IO_PNM_IO_READ_HPP diff --git a/boost/gil/extension/io_new/formats/pnm/supported_types.hpp b/boost/gil/extension/io_new/formats/pnm/supported_types.hpp new file mode 100644 index 00000000..d7915946 --- /dev/null +++ b/boost/gil/extension/io_new/formats/pnm/supported_types.hpp @@ -0,0 +1,146 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNM_SUPPORTED_TYPES_HPP +#define BOOST_GIL_EXTENSION_IO_PNM_SUPPORTED_TYPES_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include +#include + +namespace boost { namespace gil { namespace detail { + +// Read Support + +template< pnm_image_type::type ASCII_Type + , pnm_image_type::type Binary_Type + > +struct pnm_rw_support_base +{ + static const pnm_image_type::type _asc_type = ASCII_Type; + static const pnm_image_type::type _bin_type = Binary_Type; +}; + +template< typename Channel + , typename ColorSpace + > +struct pnm_read_support : read_support_false + , pnm_rw_support_base< 0 + , 0 + > {}; + +template< typename BitField, bool Mutable > +struct pnm_read_support< packed_dynamic_channel_reference< BitField + , 1 + , Mutable + > + , gray_t + > : read_support_true + , pnm_rw_support_base< pnm_image_type::mono_asc_t::value + , pnm_image_type::mono_bin_t::value + > {}; + +template<> +struct pnm_read_support< bits8 + , gray_t + > : read_support_true + , pnm_rw_support_base< pnm_image_type::gray_asc_t::value + , pnm_image_type::gray_bin_t::value + > {}; + + +template<> +struct pnm_read_support< bits8 + , rgb_t + > : read_support_true + , pnm_rw_support_base< pnm_image_type::color_asc_t::value + , pnm_image_type::color_bin_t::value + > {}; + +// Write support + +template< typename Channel + , typename ColorSpace + > +struct pnm_write_support : write_support_false +{}; + +template< typename BitField, bool Mutable > +struct pnm_write_support< packed_dynamic_channel_reference< BitField + , 1 + , Mutable + > + , gray_t + > : write_support_true + , pnm_rw_support_base< pnm_image_type::mono_asc_t::value + , pnm_image_type::mono_bin_t::value + > {}; + + +template<> +struct pnm_write_support< bits8 + , gray_t + > : write_support_true + , pnm_rw_support_base< pnm_image_type::gray_asc_t::value + , pnm_image_type::gray_bin_t::value + > {}; + + +template<> +struct pnm_write_support< bits8 + , rgb_t + > : write_support_true + , pnm_rw_support_base< pnm_image_type::color_asc_t::value + , pnm_image_type::color_bin_t::value + > {}; + +} // namespace detail + +template< typename Pixel > +struct is_read_supported< Pixel + , pnm_tag + > + : mpl::bool_< detail::pnm_read_support< typename channel_type < Pixel >::type + , typename color_space_type< Pixel >::type + >::is_supported + > +{ + typedef detail::pnm_read_support< typename channel_type < Pixel >::type + , typename color_space_type< Pixel >::type + > parent_t; + + static const pnm_image_type::type _asc_type = parent_t::_asc_type; + static const pnm_image_type::type _bin_type = parent_t::_bin_type; +}; + +template< typename Pixel > +struct is_write_supported< Pixel + , pnm_tag + > + : mpl::bool_< detail::pnm_write_support< typename channel_type < Pixel >::type + , typename color_space_type< Pixel >::type + >::is_supported + > {}; + +} // namespace gil +} // namespace boost + + +#endif // BOOST_GIL_EXTENSION_IO_PNM_SUPPORTED_TYPES_HPP diff --git a/boost/gil/extension/io_new/formats/pnm/write.hpp b/boost/gil/extension/io_new/formats/pnm/write.hpp new file mode 100644 index 00000000..2e997a67 --- /dev/null +++ b/boost/gil/extension/io_new/formats/pnm/write.hpp @@ -0,0 +1,242 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNM_IO_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_PNM_IO_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include + +#include + +#include +#include + +namespace boost { namespace gil { namespace detail { + +template< typename Device > +class writer< Device + , pnm_tag + > +{ + typedef image_write_info< pnm_tag > info_t; + +public: + + writer( Device & file ) + : _out( file ) + { + } + + ~writer() + { + } + + template + void apply( const View& view ) + { + info_t info; + + apply( view + , info ); + } + + template + void apply( const View& view + , const info_t& /* info */ + ) + { + typedef typename get_pixel_type< View >::type pixel_t; + + std::size_t width = view.width(); + std::size_t height = view.height(); + + std::size_t chn = num_channels< View >::value; + std::size_t pitch = chn * width; + + unsigned int type; + if( num_channels< View >::value == 1 ) + { + if( is_bit_aligned< pixel_t >::value ) + { + type = pnm_image_type::mono_bin_t::value; + } + else + { + type = pnm_image_type::gray_bin_t::value; + } + } + else + { + type = pnm_image_type::color_bin_t::value; + } + + // write header + + // Add a white space at each string so read_int() can decide when a numbers ends. + + std::string str( "P" ); + str += lexical_cast< std::string >( type ) + std::string( " " ); + _out.print_line( str ); + + str.clear(); + str += lexical_cast< std::string >( width ) + std::string( " " ); + _out.print_line( str ); + + str.clear(); + str += lexical_cast< std::string >( height ) + std::string( " " ); + _out.print_line( str ); + + if( type != pnm_image_type::mono_bin_t::value ) + { + _out.print_line( "255 "); + } + + // write data + write_data( view + , pitch + , typename is_bit_aligned< pixel_t >::type() + ); + } + + template< typename View > + void write_data( const View& src + , std::size_t pitch + , const mpl::true_& // bit_aligned + ) + { + BOOST_STATIC_ASSERT(( is_same< View + , typename gray1_image_t::view_t + >::value + )); + + byte_vector_t row( pitch / 8 ); + + typedef typename View::x_iterator x_it_t; + x_it_t row_it = x_it_t( &( *row.begin() )); + + negate_bits< byte_vector_t + , mpl::true_ + > neg; + + mirror_bits< byte_vector_t + , mpl::true_ + > mirror; + + + for( typename View::y_coord_t y = 0; y < src.height(); ++y ) + { + std::copy( src.row_begin( y ) + , src.row_end( y ) + , row_it + ); + + mirror( row ); + neg ( row ); + + _out.write( &row.front() + , pitch / 8 + ); + } + } + + template< typename View > + void write_data( const View& src + , std::size_t pitch + , const mpl::false_& // bit_aligned + ) + { + byte_vector_t buf( pitch ); + + typedef typename View::value_type pixel_t; + typedef typename view_type_from_pixel< pixel_t >::type view_t; + + view_t row = interleaved_view( src.width() + , 1 + , reinterpret_cast< pixel_t* >( &buf.front() ) + , pitch + ); + + for( typename View::y_coord_t y = 0 + ; y < src.height() + ; ++y + ) + { + copy_pixels( subimage_view( src + , 0 + , (int) y + , (int) src.width() + , 1 + ) + , row + ); + + _out.write( &buf.front(), pitch ); + } + } + +private: + + Device& _out; +}; + +struct pnm_write_is_supported +{ + template< typename View > + struct apply + : public is_write_supported< typename get_pixel_type< View >::type + , pnm_tag + > + {}; +}; + +template< typename Device > +class dynamic_image_writer< Device + , pnm_tag + > + : public writer< Device + , pnm_tag + > +{ + typedef writer< Device + , pnm_tag + > parent_t; + +public: + + dynamic_image_writer( Device& file ) + : parent_t( file ) + {} + + template< typename Views > + void apply( const any_image_view< Views >& views ) + { + dynamic_io_fnobj< pnm_write_is_supported + , parent_t + > op( this ); + + apply_operation( views, op ); + } +}; + +} // detail +} // gil +} // boost + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_IO_WRITE_HPP diff --git a/boost/gil/extension/io_new/formats/tiff/device.hpp b/boost/gil/extension/io_new/formats/tiff/device.hpp new file mode 100644 index 00000000..5b454bc1 --- /dev/null +++ b/boost/gil/extension/io_new/formats/tiff/device.hpp @@ -0,0 +1,360 @@ +/* + Copyright 2007-2008 Andreas Pokorny, Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_DETAIL_TIFF_IO_DEVICE_HPP +#define BOOST_GIL_EXTENSION_IO_DETAIL_TIFF_IO_DEVICE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Andreas Pokorny, Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +extern "C" { +#include "tiff.h" +#include "tiffio.h" +} + +#include "tiffio.hxx" + +#include +#include + +#include +#include + +namespace boost { namespace gil { namespace detail { + +class tiff_device_base +{ +public: + + tiff_device_base() + {} + + tiff_device_base( TIFF* tiff_file ) + : _tiff_file( tiff_file + , TIFFClose ) + {} + + + template + bool get_property( typename Property::type& value ) + { + if( TIFFGetFieldDefaulted( _tiff_file.get() + , Property::tag + , &value ) == 1 ) + { + return true; + } + + return false; + } + + + template + inline + bool set_property( const typename Property::type& value ) + { + if( TIFFSetField( _tiff_file.get() + , Property::tag + , value ) == 1 ) + { + return true; + } + + return false; + } + + // TIFFIsByteSwapped returns a non-zero value if the image data was in a different + // byte-order than the host machine. Zero is returned if the TIFF file and local + // host byte-orders are the same. + bool are_bytes_swapped() + { + return ( TIFFIsByteSwapped( _tiff_file.get() )) ? true : false; + } + + bool is_tiled() const + { + return ( TIFFIsTiled( _tiff_file.get() )) ? true : false; + } + + unsigned int get_default_strip_size() + { + return TIFFDefaultStripSize( _tiff_file.get() + , 0 ); + } + + std::size_t get_scanline_size() + { + return TIFFScanlineSize( _tiff_file.get() ); + } + + std::size_t get_tile_size() + { + return TIFFTileSize( _tiff_file.get() ); + } + + + int get_field_defaulted( uint16_t*& red + , uint16_t*& green + , uint16_t*& blue + ) + { + return TIFFGetFieldDefaulted( _tiff_file.get() + , TIFFTAG_COLORMAP + , &red + , &green + , &blue + ); + } + + template< typename Buffer > + void read_scanline( Buffer& buffer + , std::ptrdiff_t row + , tsample_t plane + ) + { + io_error_if( TIFFReadScanline( _tiff_file.get() + , reinterpret_cast< tdata_t >( &buffer.front() ) + , (uint32) row + , plane ) == -1 + , "Read error." + ); + } + + template< typename Buffer > + void read_tile( Buffer& buffer + , std::ptrdiff_t x + , std::ptrdiff_t y + , std::ptrdiff_t z + , tsample_t plane + ) + { + if( TIFFReadTile( _tiff_file.get() + , reinterpret_cast< tdata_t >( &buffer.front() ) + , (uint32) x + , (uint32) y + , (uint32) z + , plane + ) == -1 ) + { + std::ostringstream oss; + oss << "Read tile error (" << x << "," << y << "," << z << "," << plane << ")."; + io_error(oss.str()); + } + } + + template< typename Buffer > + void write_scaline( Buffer& buffer + , uint32 row + , tsample_t plane + ) + { + io_error_if( TIFFWriteScanline( _tiff_file.get() + , &buffer.front() + , row + , plane + ) == -1 + , "Write error" + ); + } + + template< typename Buffer > + void write_tile( Buffer& buffer + , uint32 x + , uint32 y + , uint32 z + , tsample_t plane + ) + { + if( TIFFWriteTile( _tiff_file.get() + , &buffer.front() + , x + , y + , z + , plane + ) == -1 ) + { + std::ostringstream oss; + oss << "Write tile error (" << x << "," << y << "," << z << "," << plane << ")."; + io_error(oss.str()); + } + } + + void set_directory( tdir_t directory ) + { + io_error_if( TIFFSetDirectory( _tiff_file.get() + , directory + ) != 1 + , "Failing to set directory" + ); + } + + // return false if the given tile width or height is not TIFF compliant (multiple of 16) or larger than image size, true otherwise + bool check_tile_size( tiff_tile_width::type& width + , tiff_tile_length::type& height + + ) + { + bool result = true; + uint32 tw = static_cast< uint32 >( width ); + uint32 th = static_cast< uint32 >( height ); + + TIFFDefaultTileSize( _tiff_file.get() + , &tw + , &th + ); + + if(width==0 || width%16!=0) + { + width = tw; + result = false; + } + if(height==0 || height%16!=0) + { + height = th; + result = false; + } + return result; + } + +protected: + + typedef shared_ptr tiff_file_t; + tiff_file_t _tiff_file; + +}; + +/*! + * + * file_stream_device specialization for tiff images, which are based on TIFF*. + */ +template<> +class file_stream_device< tiff_tag > : public tiff_device_base +{ +public: + + struct read_tag {}; + struct write_tag {}; + + file_stream_device( std::string const& file_name, read_tag ) + { + TIFF* tiff; + + io_error_if( ( tiff = TIFFOpen( file_name.c_str(), "r" )) == NULL + , "file_stream_device: failed to open file" ); + + _tiff_file = tiff_file_t( tiff, TIFFClose ); + } + + file_stream_device( std::string const& file_name, write_tag ) + { + TIFF* tiff; + + io_error_if( ( tiff = TIFFOpen( file_name.c_str(), "w" )) == NULL + , "file_stream_device: failed to open file" ); + + _tiff_file = tiff_file_t( tiff, TIFFClose ); + } + + file_stream_device( TIFF* tiff_file ) + : tiff_device_base( tiff_file ) + {} +}; + +/*! + * + * ostream_device specialization for tiff images. + */ +template<> +class ostream_device< tiff_tag > : public tiff_device_base +{ +public: + ostream_device( std::ostream & out ) + : _out( out ) + { + TIFF* tiff; + + io_error_if( ( tiff = TIFFStreamOpen( "" + , &_out + ) + ) == NULL + , "ostream_device: failed to stream" + ); + + _tiff_file = tiff_file_t( tiff, TIFFClose ); + } + +private: + + std::ostream& _out; +}; + +/*! + * + * ostream_device specialization for tiff images. + */ +template<> +class istream_device< tiff_tag > : public tiff_device_base +{ +public: + istream_device( std::istream & in ) + : _in( in ) + { + TIFF* tiff; + + io_error_if( ( tiff = TIFFStreamOpen( "" + , &_in + ) + ) == NULL + , "istream_device: failed to stream" + ); + + _tiff_file = tiff_file_t( tiff, TIFFClose ); + } + +private: + + std::istream& _in; +}; + +/* +template< typename T, typename D > +struct is_adaptable_input_device< tiff_tag, T, D > : mpl::false_{}; +*/ + +template< typename FormatTag > +struct is_adaptable_input_device< FormatTag + , TIFF* + , void + > + : mpl::true_ +{ + typedef file_stream_device< FormatTag > device_type; +}; + +template< typename FormatTag > +struct is_adaptable_output_device< FormatTag + , TIFF* + , void + > + : mpl::true_ +{ + typedef file_stream_device< FormatTag > device_type; +}; + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_DETAIL_TIFF_IO_DEVICE_HPP diff --git a/boost/gil/extension/io_new/formats/tiff/is_allowed.hpp b/boost/gil/extension/io_new/formats/tiff/is_allowed.hpp new file mode 100644 index 00000000..1e78cdd1 --- /dev/null +++ b/boost/gil/extension/io_new/formats/tiff/is_allowed.hpp @@ -0,0 +1,174 @@ +/* + Copyright 2008 Christian Henning, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_IO_IS_ALLOWED_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_IO_IS_ALLOWED_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include + +namespace boost { namespace gil { namespace detail { + +typedef std::vector< tiff_bits_per_sample::type > channel_sizes_t; + +template< typename Channel > +int format_value( mpl::true_ ) // is_bit_aligned +{ + return SAMPLEFORMAT_UINT; +} + +template< typename Channel > +int format_value( mpl::false_ ) // is_bit_aligned +{ + if( is_unsigned< Channel >::value ) + { + return SAMPLEFORMAT_UINT; + } + if( is_signed< Channel >::value ) + { + return SAMPLEFORMAT_INT; + } + else if( is_floating_point< Channel >::value ) + { + return SAMPLEFORMAT_IEEEFP; + } + + io_error( "Unkown channel format." ); +} + +// The following two functions look the same but are different since one is using +// a pixel_t as template parameter whereas the other is using reference_t. +template< typename View > +bool compare_channel_sizes( const channel_sizes_t& channel_sizes // in bits + , mpl::false_ // is_bit_aligned + , mpl::true_ // is_homogeneous + ) +{ + typedef typename View::value_type pixel_t; + typedef typename channel_traits< + typename element_type< pixel_t >::type >::value_type channel_t; + + unsigned int s = detail::unsigned_integral_num_bits< channel_t >::value; + + return ( s == channel_sizes[0] ); +} + + +template< typename View > +bool compare_channel_sizes( const channel_sizes_t& channel_sizes // in bits + , mpl::true_ // is_bit_aligned + , mpl::true_ // is_homogeneous + ) +{ + typedef typename View::reference ref_t; + + typedef typename channel_traits< typename element_type< ref_t >::type >::value_type channel_t; + channel_t c; + + unsigned int s = detail::unsigned_integral_num_bits< channel_t >::value; + + return ( s == channel_sizes[0] ); +} + +struct compare_channel_sizes_fn +{ + compare_channel_sizes_fn( uint16_t* a ) + : _a( a ) + , _b( true ) + {} + + template< typename ChannelSize > + void operator()( ChannelSize x) + { + if( x != *_a++ ) + { + _b = false; + } + } + + uint16_t* _a; + bool _b; +}; + +template< typename T > +struct channel_sizes_type {}; + +template< typename B, typename C, typename L, bool M > +struct channel_sizes_type< bit_aligned_pixel_reference< B, C, L, M > > { typedef C type; }; + +template< typename B, typename C, typename L, bool M > +struct channel_sizes_type< const bit_aligned_pixel_reference< B, C, L, M > > { typedef C type; }; + +template< typename View > +bool compare_channel_sizes( channel_sizes_t& channel_sizes // in bits + , mpl::true_ // is_bit_aligned + , mpl::false_ // is_homogeneous + ) +{ + // loop through all channels and compare + + typedef typename View::reference ref_t; + typedef typename channel_sizes_type< ref_t >::type cs_t; + + compare_channel_sizes_fn fn( &channel_sizes.front() ); + mpl::for_each< cs_t >( fn ); + + return fn._b; +} + +template< typename View > +bool is_allowed( const image_read_info< tiff_tag >& info + , mpl::true_ // is read_and_no_convert + ) +{ + channel_sizes_t channel_sizes( info._samples_per_pixel + , info._bits_per_sample + ); + + typedef typename get_pixel_type< View >::type pixel_t; + typedef typename channel_traits< + typename element_type< pixel_t >::type >::value_type channel_t; + + typedef typename num_channels< pixel_t >::value_type num_channel_t; + + const num_channel_t dst_samples_per_pixel = num_channels< pixel_t >::value; + const num_channel_t dst_sample_format = format_value< channel_t >( typename is_bit_aligned< pixel_t >::type() ); + + return ( dst_samples_per_pixel == info._samples_per_pixel + && compare_channel_sizes< View >( channel_sizes + , typename is_bit_aligned< pixel_t >::type() + , typename is_homogeneous< pixel_t >::type() + ) + && dst_sample_format == info._sample_format + ); +} + +template< typename View > +bool is_allowed( const image_read_info< tiff_tag >& /* info */ + , mpl::false_ // is read_and_no_convert + ) +{ + return true; +} + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_IO_IS_ALLOWED_HPP diff --git a/boost/gil/extension/io_new/formats/tiff/log.hpp b/boost/gil/extension/io_new/formats/tiff/log.hpp new file mode 100644 index 00000000..9e4ae264 --- /dev/null +++ b/boost/gil/extension/io_new/formats/tiff/log.hpp @@ -0,0 +1,66 @@ +/* + Copyright 2009 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_IO_LOG_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_IO_LOG_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2009 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +extern "C" { +#include "tiffio.h" +} + +#include + +namespace boost { namespace gil { + +class console_log +{ +public: + + console_log() + { + TIFFSetErrorHandler ( console_log::error ); + TIFFSetWarningHandler( console_log::warning ); + } + +private: + + static void error( const char* /* module */ + , const char* fmt + , va_list ap + ) + { + char buf[1000]; + sprintf(buf, fmt, ap); + std::cout << "error: " << buf << std::endl; + } + + static void warning( char const* /* module */ + , char const* fmt + , va_list ap + ) + { + char buf[1000]; + sprintf(buf, fmt, ap); + std::cout << "warning: " << fmt << std::endl; + } +}; + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_IO_LOG_HPP diff --git a/boost/gil/extension/io_new/formats/tiff/read.hpp b/boost/gil/extension/io_new/formats/tiff/read.hpp new file mode 100644 index 00000000..de3f0326 --- /dev/null +++ b/boost/gil/extension/io_new/formats/tiff/read.hpp @@ -0,0 +1,782 @@ +/* + Copyright 2007-2008 Christian Henning, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_IO_READ_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_IO_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +extern "C" { +#include "tiff.h" +#include "tiffio.h" +} + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "device.hpp" +#include "is_allowed.hpp" + + +namespace boost { namespace gil { namespace detail { + +template < int K > +struct plane_recursion +{ + template< typename View + , typename Device + , typename ConversionPolicy + > + static + void read_plane( const View& dst_view + , reader< Device + , tiff_tag + , ConversionPolicy >* p + ) + { + typedef typename kth_channel_view_type< K, View >::type plane_t; + plane_t plane = kth_channel_view( dst_view ); + + p->template read_data< row_buffer_helper_view< plane_t > >( plane, K ); + + plane_recursion< K - 1 >::read_plane( dst_view, p ); + } +}; + +template <> +struct plane_recursion< -1 > +{ + template< typename View + , typename Device + , typename ConversionPolicy + > + static + void read_plane( const View& /* dst_view */ + , reader< Device + , tiff_tag + , ConversionPolicy + >* /* p */ + ) + {} +}; + +template< typename Device + , typename ConversionPolicy + > +class reader< Device + , tiff_tag + , ConversionPolicy + > + : public reader_base< tiff_tag + , ConversionPolicy > +{ +public: + + reader( Device& device + , const image_read_settings< tiff_tag >& settings + ) + : reader_base< tiff_tag + , ConversionPolicy + >( settings ) + , _io_dev( device ) + { + init_multipage_read( settings ); + } + + reader( Device& device + , const typename ConversionPolicy::color_converter_type& cc + , const image_read_settings< tiff_tag >& settings + ) + : reader_base< tiff_tag + , ConversionPolicy + >( cc + , settings + ) + , _io_dev( device ) + { + init_multipage_read( settings ); + } + + image_read_info get_info() const + { + image_read_info info; + + io_error_if( _io_dev.template get_property ( info._width ) == false + , "cannot read tiff tag." ); + io_error_if( _io_dev.template get_property ( info._height ) == false + , "cannot read tiff tag." ); + io_error_if( _io_dev.template get_property ( info._compression ) == false + , "cannot read tiff tag." ); + io_error_if( _io_dev.template get_property ( info._samples_per_pixel ) == false + , "cannot read tiff tag." ); + io_error_if( _io_dev.template get_property ( info._bits_per_sample ) == false + , "cannot read tiff tag." ); + io_error_if( _io_dev.template get_property ( info._sample_format ) == false + , "cannot read tiff tag." ); + io_error_if( _io_dev.template get_property ( info._planar_configuration ) == false + , "cannot read tiff tag." ); + io_error_if( _io_dev.template get_property( info._photometric_interpretation ) == false + , "cannot read tiff tag." ); + + info._is_tiled = false; + + // Tile tags + if( _io_dev.is_tiled() ) + { + info._is_tiled = true; + + io_error_if( !_io_dev.template get_property< tiff_tile_width >( info._tile_width ) + , "cannot read tiff_tile_width tag." ); + io_error_if( !_io_dev.template get_property< tiff_tile_length >( info._tile_length ) + , "cannot read tiff_tile_length tag." ); + } + + return info; + } + + // only works for homogeneous image types + template< typename View > + void apply( View& dst_view ) + { + if( this->_info._photometric_interpretation == PHOTOMETRIC_PALETTE ) + { + // Steps: + // 1. Read indices. It's an array of grayX_pixel_t. + // 2. Read palette. It's an array of rgb16_pixel_t. + // 3. ??? Create virtual image or transform the two arrays + // into a rgb16_image_t object. The latter might + // be a good first solution. + + switch( this->_info._bits_per_sample ) + { + case 1: { read_palette_image< gray1_image_t >( dst_view ); break; } + case 2: { read_palette_image< gray2_image_t >( dst_view ); break; } + case 4: { read_palette_image< gray4_image_t >( dst_view ); break; } + case 8: { read_palette_image< gray8_image_t >( dst_view ); break; } + case 16: { read_palette_image< gray16_image_t >( dst_view ); break; } + + default: { io_error( "Not supported palette " ); } + } + + return; + + } + else + { + // In case we only read the image the user's type and + // the tiff type need to compatible. Which means: + // color_spaces_are_compatible && channels_are_pairwise_compatible + + typedef typename is_same< ConversionPolicy + , read_and_no_convert + >::type is_read_only; + + io_error_if( !is_allowed< View >( this->_info + , is_read_only() + ) + , "Image types aren't compatible." + ); + + if( this->_info._planar_configuration == PLANARCONFIG_SEPARATE ) + { + plane_recursion< num_channels< View >::value - 1 >::read_plane( dst_view + , this + ); + } + else if( this->_info._planar_configuration == PLANARCONFIG_CONTIG ) + { + if( is_read_only::value == false ) + { + // the read_data function needs to know what gil type the source image is + // to have the default color converter function correctly + + switch( this->_info._photometric_interpretation ) + { + case PHOTOMETRIC_MINISWHITE: + case PHOTOMETRIC_MINISBLACK: + { + switch( this->_info._bits_per_sample ) + { + case 1: { read_data< row_buffer_helper_view< gray1_image_t::view_t > >( dst_view, 0 ); break; } + case 2: { read_data< row_buffer_helper_view< gray2_image_t::view_t > >( dst_view, 0 ); break; } + case 4: { read_data< row_buffer_helper_view< gray4_image_t::view_t > >( dst_view, 0 ); break; } + case 8: { read_data< row_buffer_helper_view< gray8_view_t > >( dst_view, 0 ); break; } + case 16: { read_data< row_buffer_helper_view< gray16_view_t > >( dst_view, 0 ); break; } + case 32: { read_data< row_buffer_helper_view< gray32_view_t > >( dst_view, 0 ); break; } + } + + break; + } + + case PHOTOMETRIC_RGB: + { + switch( this->_info._bits_per_sample ) + { + case 8: { read_data< row_buffer_helper_view< rgb8_view_t > >( dst_view, 0 ); break; } + case 16: { read_data< row_buffer_helper_view< rgb16_view_t > >( dst_view, 0 ); break; } + case 32: { read_data< row_buffer_helper_view< rgb32_view_t > >( dst_view, 0 ); break; } + } + + break; + } + + case PHOTOMETRIC_SEPARATED: // CYMK + { + switch( this->_info._bits_per_sample ) + { + case 8: { read_data< row_buffer_helper_view< cmyk8_view_t > >( dst_view, 0 ); break; } + case 16: { read_data< row_buffer_helper_view< cmyk16_view_t > >( dst_view, 0 ); break; } + case 32: { read_data< row_buffer_helper_view< cmyk32_view_t > >( dst_view, 0 ); break; } + } + + break; + } + + default: { io_error( "Not supported colorspace " ); } + } + } + else + { + read_data< row_buffer_helper_view< View > >( dst_view, 0 ); + } + } + else + { + io_error( "Wrong planar configuration setting." ); + } + } + } + +private: + + void init_multipage_read( const image_read_settings< tiff_tag >& settings ) + { + if( settings._directory > 0 ) + { + _io_dev.set_directory( settings._directory ); + } + } + + template< typename PaletteImage + , typename View + > + void read_palette_image( const View& dst_view ) + { + PaletteImage indices( this->_info._width - this->_settings._top_left.x + , this->_info._height - this->_settings._top_left.y ); + + // read the palette first + read_data< row_buffer_helper_view< typename PaletteImage::view_t > >( view( indices ), 0 ); + + read_palette_image( dst_view + , view( indices ) + , typename is_same< View, rgb16_view_t >::type() ); + } + + template< typename View + , typename Indices_View + > + void read_palette_image( const View& dst_view + , const Indices_View& indices_view + , mpl::true_ // is View rgb16_view_t + ) + { + tiff_color_map::red_t red = NULL; + tiff_color_map::green_t green = NULL; + tiff_color_map::blue_t blue = NULL; + + _io_dev.get_field_defaulted( red, green, blue ); + + typedef typename channel_traits< + typename element_type< + typename Indices_View::value_type >::type >::value_type channel_t; + + int num_colors = channel_traits< channel_t >::max_value(); + + rgb16_planar_view_t palette = planar_rgb_view( num_colors + , 1 + , red + , green + , blue + , sizeof( bits16 ) * num_colors ); + + typename rgb16_planar_view_t::x_iterator palette_it = palette.row_begin( 0 ); + + for( typename rgb16_view_t::y_coord_t y = 0; y < dst_view.height(); ++y ) + { + typename rgb16_view_t::x_iterator it = dst_view.row_begin( y ); + typename rgb16_view_t::x_iterator end = dst_view.row_end( y ); + + typename Indices_View::x_iterator indices_it = indices_view.row_begin( y ); + + for( ; it != end; ++it, ++indices_it ) + { + bits16 i = gil::at_c<0>( *indices_it ); + + *it = palette[i]; + } + } + } + + template< typename View + , typename Indices_View + > + inline + void read_palette_image( const View& /* dst_view */ + , const Indices_View& /* indices_view */ + , mpl::false_ // is View rgb16_view_t + ) + { + io_error( "User supplied image type must be rgb16_image_t." ); + } + + template< typename Buffer > + void skip_over_rows( Buffer& buffer + , int plane + ) + { + if( this->_info._compression != COMPRESSION_NONE ) + { + // Skipping over rows is not possible for compressed images( no random access ). See man + // page ( diagnostics section ) for more information. + for( std::ptrdiff_t row = 0; row < this->_settings._top_left.y; ++row ) + { + _io_dev.read_scanline( buffer + , row + , static_cast< tsample_t >( plane )); + } + } + } + + template< typename Buffer + , typename View + > + void read_data( const View& dst_view + , int plane ) + { + if( _io_dev.is_tiled() ) + { + read_tiled_data< Buffer >( dst_view, 0 ); + } + else + { + read_stripped_data< Buffer >( dst_view, 0 ); + } + } + + + template< typename Buffer + , typename View + > + void read_tiled_data( const View& dst_view + , int plane + ) + { + if( dst_view.width() != this->_info._width + || dst_view.height() != this->_info._height + ) + { + // read a subimage + read_tiled_data_subimage< Buffer >( dst_view, plane ); + } + else + { + // read full image + read_tiled_data_full< Buffer >( dst_view, plane ); + } + } + + template< typename Buffer + , typename View + > + void read_tiled_data_subimage( const View& dst_view + , int plane + ) + { + ///@todo: why is + /// typedef Buffer row_buffer_helper_t; + /// not working? I get compiler error with MSVC10. + /// read_stripped_data IS working. + typedef row_buffer_helper_view< View > row_buffer_helper_t; + + typedef typename row_buffer_helper_t::buffer_t buffer_t; + typedef typename row_buffer_helper_t::iterator_t it_t; + + tiff_image_width::type image_width = this->_info._width; + tiff_image_height::type image_height = this->_info._height; + + tiff_tile_width::type tile_width = this->_info._tile_width; + tiff_tile_length::type tile_height = this->_info._tile_length; + + std::ptrdiff_t subimage_x = this->_settings._top_left.x; + std::ptrdiff_t subimage_y = this->_settings._top_left.y; + + std::ptrdiff_t subimage_width = this->_settings._dim.x; + std::ptrdiff_t subimage_height = this->_settings._dim.y; + + row_buffer_helper_t row_buffer_helper( _io_dev.get_tile_size(), true ); + + mirror_bits< buffer_t + , typename is_bit_aligned< typename View::value_type >::type + > mirror_bits( _io_dev.are_bytes_swapped() ); + + for( unsigned int y = 0; y < image_height; y += tile_height ) + { + for( unsigned int x = 0; x < image_width; x += tile_width ) + { + uint32_t current_tile_width = ( x + tile_width < image_width ) ? tile_width : image_width - x; + uint32_t current_tile_length = ( y + tile_height < image_height ) ? tile_height : image_height - y; + + _io_dev.read_tile( row_buffer_helper.buffer() + , x + , y + , 0 + , static_cast< tsample_t >( plane ) + ); + + mirror_bits( row_buffer_helper.buffer() ); + + // these are all whole image coordinates + point_t tile_top_left ( x, y ); + point_t tile_lower_right( x + current_tile_width - 1, y + current_tile_length - 1 ); + + point_t view_top_left ( subimage_x, subimage_y ); + point_t view_lower_right( subimage_x + subimage_width - 1 + , subimage_y + subimage_height - 1 ); + + if( tile_top_left.x > view_lower_right.x + || tile_top_left.y > view_lower_right.y + || tile_lower_right.x < view_top_left.x + || tile_lower_right.y < view_top_left.y + ) + { + // current tile and dst_view do not overlap + continue; + } + else + { + // dst_view is overlapping the current tile + + // next is to define the portion in the tile that needs to be copied + + // get the whole image coordinates + std::ptrdiff_t img_x0 = ( tile_top_left.x >= view_top_left.x ) ? tile_top_left.x : view_top_left.x; + std::ptrdiff_t img_y0 = ( tile_top_left.y >= view_top_left.y ) ? tile_top_left.y : view_top_left.y; + + std::ptrdiff_t img_x1 = ( tile_lower_right.x <= view_lower_right.x ) ? tile_lower_right.x : view_lower_right.x; + std::ptrdiff_t img_y1 = ( tile_lower_right.y <= view_lower_right.y ) ? tile_lower_right.y : view_lower_right.y; + + // convert to tile coordinates + std::ptrdiff_t tile_x0 = img_x0 - x; + std::ptrdiff_t tile_y0 = img_y0 - y; + std::ptrdiff_t tile_x1 = img_x1 - x; + std::ptrdiff_t tile_y1 = img_y1 - y; + + assert( tile_x0 >= 0 && tile_y0 >= 0 && tile_x1 >= 0 && tile_y1 >= 0 ); + assert( tile_x0 <= img_x1 && tile_y0 <= img_y1 ); + assert( tile_x0 < tile_width && tile_y0 < tile_height && tile_x1 < tile_width && tile_y1 < tile_height ); + + std::ptrdiff_t tile_subimage_view_width = tile_x1 - tile_x0 + 1; + std::ptrdiff_t tile_subimage_view_height = tile_y1 - tile_y0 + 1; + + // convert to dst_view coordinates + std::ptrdiff_t dst_x0 = img_x0 - subimage_x; + std::ptrdiff_t dst_y0 = img_y0 - subimage_y; + assert( dst_x0 >= 0 && dst_y0 >= 0 ); + + View dst_subimage_view = subimage_view( dst_view + , (int) dst_x0 + , (int) dst_y0 + , (int) tile_subimage_view_width + , (int) tile_subimage_view_height + ); + + // the row_buffer is a 1D array which represents a 2D image. We cannot + // use interleaved_view here, since row_buffer could be bit_aligned. + // Interleaved_view's fourth parameter "rowsize_in_bytes" doesn't work + // for bit_aligned pixels. + + for( std::ptrdiff_t dst_row = 0; dst_row < dst_subimage_view.height(); ++dst_row ) + { + std::ptrdiff_t tile_row = dst_row + tile_y0; + + // jump to the beginning of the current tile row + it_t begin = row_buffer_helper.begin() + tile_row * tile_width; + + begin += tile_x0; + it_t end = begin + dst_subimage_view.width(); + + this->_cc_policy.read( begin + , end + , dst_subimage_view.row_begin( dst_row ) + ); + } //for + } + } // for + } // for + } + + template< typename Buffer + , typename View + > + void read_tiled_data_full( const View& dst_view + , int plane + ) + { + ///@todo: why is + /// typedef Buffer row_buffer_helper_t; + /// not working? I get compiler error with MSVC10. + /// read_stripped_data IS working. + typedef row_buffer_helper_view< View > row_buffer_helper_t; + + typedef typename row_buffer_helper_t::buffer_t buffer_t; + typedef typename row_buffer_helper_t::iterator_t it_t; + + tiff_image_width::type image_width = this->_info._width; + tiff_image_height::type image_height = this->_info._height; + + tiff_tile_width::type tile_width = this->_info._tile_width; + tiff_tile_length::type tile_height = this->_info._tile_length; + + row_buffer_helper_t row_buffer_helper( _io_dev.get_tile_size(), true ); + + mirror_bits< buffer_t + , typename is_bit_aligned< typename View::value_type >::type + > mirror_bits( _io_dev.are_bytes_swapped() ); + + for( unsigned int y = 0; y < image_height; y += tile_height ) + { + for( unsigned int x = 0; x < image_width; x += tile_width ) + { + uint32_t current_tile_width = ( x + tile_width < image_width ) ? tile_width : image_width - x; + uint32_t current_tile_length = ( y + tile_height < image_height ) ? tile_height : image_height - y; + + _io_dev.read_tile( row_buffer_helper.buffer() + , x + , y + , 0 + , static_cast< tsample_t >( plane ) + ); + + mirror_bits( row_buffer_helper.buffer() ); + + View dst_subimage_view = subimage_view( dst_view + , x + , y + , current_tile_width + , current_tile_length + ); + + // the row_buffer is a 1D array which represents a 2D image. We cannot + // use interleaved_view here, since row_buffer could be bit_aligned. + // Interleaved_view's fourth parameter "rowsize_in_bytes" doesn't work + // for bit_aligned pixels. + + for( int row = 0; row < dst_subimage_view.height(); ++row ) + { + it_t begin = row_buffer_helper.begin() + row * tile_width; + it_t end = begin + dst_subimage_view.width(); + + this->_cc_policy.read( begin + , end + , dst_subimage_view.row_begin( row ) + ); + } //for + } // for + } // for + } + + template< typename Buffer + , typename View + > + void read_stripped_data( const View& dst_view + , int plane ) + { + typedef typename is_bit_aligned< typename View::value_type >::type is_view_bit_aligned_t; + + //typedef row_buffer_helper_view< View > row_buffer_helper_t; + typedef Buffer row_buffer_helper_t; + + typedef typename row_buffer_helper_t::buffer_t buffer_t; + typedef typename row_buffer_helper_t::iterator_t it_t; + + std::size_t size_to_allocate = buffer_size< typename View::value_type >( dst_view.width() + , is_view_bit_aligned_t() ); + row_buffer_helper_t row_buffer_helper( size_to_allocate, true ); + + it_t begin = row_buffer_helper.begin(); + + it_t first = begin + this->_settings._top_left.x; + it_t last = first + this->_settings._dim.x; // one after last element + + // I don't think tiff allows for random access of row, that's why we need + // to read and discard rows when reading subimages. + skip_over_rows( row_buffer_helper.buffer() + , plane + ); + + mirror_bits< buffer_t + , typename is_bit_aligned< View >::type + > mirror_bits( _io_dev.are_bytes_swapped() ); + + std::ptrdiff_t row = this->_settings._top_left.y; + std::ptrdiff_t row_end = row + this->_settings._dim.y; + std::ptrdiff_t dst_row = 0; + + for( + ; row < row_end + ; ++row, ++dst_row + ) + { + _io_dev.read_scanline( row_buffer_helper.buffer() + , row + , static_cast< tsample_t >( plane ) + ); + + mirror_bits( row_buffer_helper.buffer() ); + + this->_cc_policy.read( first + , last + , dst_view.row_begin( dst_row )); + } + } + + template< typename Pixel > + std::size_t buffer_size( std::size_t width + , mpl::false_ // is_bit_aligned + ) + { + std::size_t scanline_size_in_bytes = _io_dev.get_scanline_size(); + + std::size_t element_size = sizeof( Pixel ); + + return std::max( width + , (( scanline_size_in_bytes + element_size - 1 ) / element_size )); + } + + template< typename Pixel > + std::size_t buffer_size( std::size_t /* width */ + , mpl::true_ // is_bit_aligned + ) + { + return _io_dev.get_scanline_size(); + } + +private: + + Device& _io_dev; + + template < int K > friend struct plane_recursion; +}; + +struct tiff_type_format_checker +{ + tiff_type_format_checker( const image_read_info< tiff_tag >& info ) + : _info( info ) + {} + + template< typename Image > + bool apply() + { + typedef typename Image::view_t view_t; + + return is_allowed< view_t >( _info + , mpl::true_() + ); + } + +private: + + const image_read_info< tiff_tag >& _info; +}; + +struct tiff_read_is_supported +{ + template< typename View > + struct apply : public is_read_supported< typename get_pixel_type< View >::type + , tiff_tag + > + {}; +}; + +template< typename Device + > +class dynamic_image_reader< Device + , tiff_tag + > + : public reader< Device + , tiff_tag + , detail::read_and_no_convert + > +{ + typedef reader< Device + , tiff_tag + , detail::read_and_no_convert + > parent_t; + +public: + + dynamic_image_reader( Device& device + , const image_read_settings< tiff_tag >& settings + ) + : parent_t( device + , settings + ) + {} + + template< typename Images > + void apply( any_image< Images >& images ) + { + tiff_type_format_checker format_checker( this->_info ); + + if( !construct_matched( images + , format_checker + )) + { + io_error( "No matching image type between those of the given any_image and that of the file" ); + } + else + { + init_image( images + , this->_info + ); + + dynamic_io_fnobj< tiff_read_is_supported + , parent_t + > op( this ); + + apply_operation( view( images ) + , op + ); + } + } +}; + + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_IO_READ_HPP diff --git a/boost/gil/extension/io_new/formats/tiff/supported_types.hpp b/boost/gil/extension/io_new/formats/tiff/supported_types.hpp new file mode 100644 index 00000000..5f263af7 --- /dev/null +++ b/boost/gil/extension/io_new/formats/tiff/supported_types.hpp @@ -0,0 +1,62 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_IO_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_IO_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include +#include + +namespace boost{ namespace gil { + +namespace detail { + +// Read support + +// TIFF virtually supports everything +struct tiff_read_support : read_support_true +{}; + + +// Write support + +struct tiff_write_support : write_support_true +{}; + +} // namespace detail + +template< typename Pixel > +struct is_read_supported< Pixel + , tiff_tag + > + : mpl::bool_< detail::tiff_read_support::is_supported > {}; + +template< typename Pixel > +struct is_write_supported< Pixel + , tiff_tag + > + : mpl::bool_< detail::tiff_write_support::is_supported > +{}; + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_IO_HPP diff --git a/boost/gil/extension/io_new/formats/tiff/write.hpp b/boost/gil/extension/io_new/formats/tiff/write.hpp new file mode 100644 index 00000000..fac12f9d --- /dev/null +++ b/boost/gil/extension/io_new/formats/tiff/write.hpp @@ -0,0 +1,422 @@ +/* + Copyright 2007-2008 Christian Henning, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_IO_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_IO_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +extern "C" { +#include "tiff.h" +#include "tiffio.h" +} + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "device.hpp" + +namespace boost { namespace gil { namespace detail { + +template +struct my_interleaved_pixel_iterator_type_from_pixel_reference +{ +private: + typedef typename remove_reference< PixelReference >::type::value_type pixel_t; +public: + typedef typename iterator_type_from_pixel< pixel_t + , false + , false + , true + >::type type; +}; + + +template< typename Channel + , typename Layout + , bool Mutable + > +struct my_interleaved_pixel_iterator_type_from_pixel_reference< const bit_aligned_pixel_reference< byte_t + , Channel + , Layout + , Mutable + > + > + : public iterator_type_from_pixel< const bit_aligned_pixel_reference< uint8_t + , Channel + , Layout + , Mutable + > + ,false + ,false + ,true + > {}; + + + + + +template < typename Channel > struct sample_format : public mpl::int_ {}; +template<> struct sample_format : public mpl::int_ {}; +template<> struct sample_format : public mpl::int_ {}; +template<> struct sample_format : public mpl::int_ {}; +template<> struct sample_format : public mpl::int_ {}; +template<> struct sample_format : public mpl::int_ {}; +template<> struct sample_format : public mpl::int_ {}; +template<> struct sample_format : public mpl::int_ {}; +template<> struct sample_format : public mpl::int_ {}; + +template struct photometric_interpretation {}; +template<> struct photometric_interpretation< gray_t > : public mpl::int_< PHOTOMETRIC_MINISBLACK > {}; +template<> struct photometric_interpretation< rgb_t > : public mpl::int_< PHOTOMETRIC_RGB > {}; +template<> struct photometric_interpretation< rgba_t > : public mpl::int_< PHOTOMETRIC_RGB > {}; +template<> struct photometric_interpretation< cmyk_t > : public mpl::int_< PHOTOMETRIC_SEPARATED > {}; + +template < typename Device, typename Log > +class writer< Device + , tiff_tag + , Log + > +{ +public: + + typedef image_write_info info_t; + + writer( Device& dev ) + : _io_dev( dev ) {} + + template + void apply( const View& view ) + { + typedef typename color_space_type::type color_space_t; + + info_t info; + + // write photometric interpretion - Warning: This value is rather subjective. + // The user should better set this value itself. There is no way to decide if + // a image is PHOTOMETRIC_MINISWHITE or PHOTOMETRIC_MINISBLACK. This writer + // will assume PHOTOMETRIC_MINISBLACK for gray_t images and PHOTOMETRIC_RGB + // for rgb_t images. + info._photometric_interpretation = photometric_interpretation< color_space_t >::value; + + write_view( view + , info ); + } + + template + void apply( const View& view + , const info_t& info ) + { + write_view( view + , info ); + } + +private: + + template< typename View > + void write_view( const View& src_view + , const info_t& info + ) + { + typedef typename View::value_type pixel_t; + + // get the type of the first channel (heterogeneous pixels might be broken for now!) + typedef typename channel_traits< typename element_type< pixel_t >::type >::value_type channel_t; + + // write dimensions + tiff_image_width::type width = (tiff_image_width::type) src_view.width(); + tiff_image_height::type height = (tiff_image_height::type) src_view.height(); + + _io_dev.template set_property< tiff_image_width >( width ); + _io_dev.template set_property< tiff_image_height >( height ); + + // write planar configuration + if( is_bit_aligned< View >::value == false ) + { + _io_dev.template set_property( info._planar_configuration ); + } + + // write samples per pixel + tiff_samples_per_pixel::type samples_per_pixel = num_channels< pixel_t >::value; + _io_dev.template set_property( samples_per_pixel ); + + // write bits per sample + // @todo: Settings this value usually requires to write for each sample the bit + // value seperately in case they are different, like rgb556. + tiff_bits_per_sample::type bits_per_sample = unsigned_integral_num_bits::value; + _io_dev.template set_property( bits_per_sample ); + + // write sample format + tiff_sample_format::type sampl_format = sample_format< channel_t >::type::value; + _io_dev.template set_property( sampl_format ); + + // write photometric format + _io_dev.template set_property( info._photometric_interpretation ); + + // write compression + _io_dev.template set_property( info._compression ); + + // write orientation + _io_dev.template set_property( info._orientation ); + + // write rows per strip + _io_dev.template set_property( _io_dev.get_default_strip_size() ); + + if(!info._is_tiled) + { + write_data( src_view + , info + , (src_view.width() * samples_per_pixel * bits_per_sample + 7) / 8 + , typename is_bit_aligned< pixel_t >::type() + ); + } + else + { + tiff_tile_width::type tw = info._tile_width; + tiff_tile_length::type th = info._tile_length; + + if(!_io_dev.check_tile_size( tw, th )) + { + io_error( "Tile sizes need to be multiples of 16." ); + } + + // tile related tags + _io_dev.template set_property ( tw ); + _io_dev.template set_property( th ); + + write_tiled_data( src_view + , tw + , th + , typename is_bit_aligned< pixel_t >::type() + ); + } + } + + template< typename View > + void write_data( const View& src_view + , const info_t& /* info */ + , std::size_t row_size_in_bytes + , const mpl::true_& // bit_aligned + ) + { + byte_vector_t row( row_size_in_bytes ); + + typedef typename View::x_iterator x_it_t; + x_it_t row_it = x_it_t( &(*row.begin())); + + for( typename View::y_coord_t y = 0; y < src_view.height(); ++y ) + { + std::copy( src_view.row_begin( y ) + , src_view.row_end( y ) + , row_it + ); + + _io_dev.write_scaline( row + , (uint32) y + , 0 + ); + + // @todo: do optional bit swapping here if you need to... + } + } + + template< typename View > + void write_tiled_data( const View& src_view + , tiff_tile_width::type tw + , tiff_tile_length::type th + , const mpl::true_& // bit_aligned + ) + { + byte_vector_t row( _io_dev.get_tile_size() ); + + typedef typename View::x_iterator x_it_t; + x_it_t row_it = x_it_t( &(*row.begin())); + + internal_write_tiled_data(src_view, tw, th, row, row_it); + } + + template< typename View > + void write_data( const View& src_view + , const info_t& info + , std::size_t row_size_in_bytes + , const mpl::false_& // bit_aligned + ) + { + byte_vector_t row( row_size_in_bytes ); + + typedef typename my_interleaved_pixel_iterator_type_from_pixel_reference< typename View::reference + >::type x_iterator; + + x_iterator row_it = x_iterator( &(*row.begin())); + + for( typename View::y_coord_t y = 0; y < src_view.height(); ++y ) + { + std::copy( src_view.row_begin( y ) + , src_view.row_end( y ) + , row_it + ); + + _io_dev.write_scaline( row + , (uint32) y + , 0 + ); + + // @todo: do optional bit swapping here if you need to... + } + } + + template< typename View > + void write_tiled_data( const View& src_view + , tiff_tile_width::type tw + , tiff_tile_length::type th + , const mpl::false_& // bit_aligned + ) + { + byte_vector_t row( _io_dev.get_tile_size() ); + + typedef typename my_interleaved_pixel_iterator_type_from_pixel_reference< typename View::reference + >::type x_iterator; + x_iterator row_it = x_iterator( &(*row.begin())); + + internal_write_tiled_data(src_view, tw, th, row, row_it); + } + + template< typename View, + typename IteratorType > + void internal_write_tiled_data( const View& src_view + , tiff_tile_width::type tw + , tiff_tile_length::type th + , byte_vector_t& row + , IteratorType it + ) + { + std::ptrdiff_t i = 0, j = 0; + View tile_subimage_view; + while( i < src_view.height() ) + { + while( j < src_view.width() ) + { + if( j + tw < src_view.width() && i + th < src_view.height() ) + { + // a tile is fully included in the image: just copy values + tile_subimage_view = subimage_view( src_view + , static_cast< int >( j ) + , static_cast< int >( i ) + , static_cast< int >( tw ) + , static_cast< int >( th ) + ); + + std::copy( tile_subimage_view.begin() + , tile_subimage_view.end() + , it + ); + } + else + { + std::ptrdiff_t width = src_view.width(); + std::ptrdiff_t height = src_view.height(); + + std::ptrdiff_t current_tile_width = ( j + tw < width ) ? tw : width - j; + std::ptrdiff_t current_tile_length = ( i + th < height) ? th : height - i; + + tile_subimage_view = subimage_view( src_view + , static_cast< int >( j ) + , static_cast< int >( i ) + , static_cast< int >( current_tile_width ) + , static_cast< int >( current_tile_length ) + ); + + for( typename View::y_coord_t y = 0; y < tile_subimage_view.height(); ++y ) + { + std::copy( tile_subimage_view.row_begin( y ) + , tile_subimage_view.row_end( y ) + , it + ); + std::advance(it, tw); + } + + it = IteratorType( &(*row.begin())); + } + + _io_dev.write_tile( row + , static_cast< uint32 >( j ) + , static_cast< uint32 >( i ) + , 0 + , 0 + ); + j += tw; + } + j = 0; + i += th; + } + // @todo: do optional bit swapping here if you need to... + } + + Device& _io_dev; +}; + +struct tiff_write_is_supported +{ + template< typename View > + struct apply + : public is_write_supported< typename get_pixel_type< View >::type + , tiff_tag + > + {}; +}; + +template< typename Device > +class dynamic_image_writer< Device + , tiff_tag + > + : public writer< Device + , tiff_tag + > +{ + typedef writer< Device + , tiff_tag + > parent_t; + +public: + + dynamic_image_writer( Device& file ) + : parent_t( file ) + {} + + template< typename Views > + void apply( const any_image_view< Views >& views ) + { + dynamic_io_fnobj< tiff_write_is_supported + , parent_t + > op( this ); + + apply_operation( views, op ); + } +}; + +} // namespace detail +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_IO_WRITE_HPP diff --git a/boost/gil/extension/io_new/jpeg_all.hpp b/boost/gil/extension/io_new/jpeg_all.hpp new file mode 100644 index 00000000..7886defe --- /dev/null +++ b/boost/gil/extension/io_new/jpeg_all.hpp @@ -0,0 +1,25 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_JPEG_ALL_HPP +#define BOOST_GIL_EXTENSION_IO_JPEG_ALL_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "jpeg_read.hpp" +#include "jpeg_write.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_ALL_HPP diff --git a/boost/gil/extension/io_new/jpeg_io_old.hpp b/boost/gil/extension/io_new/jpeg_io_old.hpp new file mode 100644 index 00000000..1a1da402 --- /dev/null +++ b/boost/gil/extension/io_new/jpeg_io_old.hpp @@ -0,0 +1,178 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_JPEG_IO_OLD_HPP +#define BOOST_GIL_EXTENSION_IO_JPEG_IO_OLD_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "jpeg_all.hpp" + +namespace boost { namespace gil { + +/// \ingroup JPEG_IO +/// \brief Returns the width and height of the JPEG file at the specified location. +/// Throws std::ios_base::failure if the location does not correspond to a valid JPEG file +template< typename String > +inline +point2< std::ptrdiff_t > jpeg_read_dimensions( const String& filename ) +{ + image_read_info< jpeg_tag > info = read_image_info( filename + , jpeg_tag() + ); + + return point2< std::ptrdiff_t >( info._width + , info._height + ); +} + + +/// \ingroup JPEG_IO +/// \brief Loads the image specified by the given jpeg image file name into the given view. +/// Triggers a compile assert if the view color space and channel depth are not supported by the JPEG library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not +/// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void jpeg_read_view( const String& filename + , const View& view + ) +{ + read_view( filename + , view + , jpeg_tag() + ); +} + +/// \ingroup JPEG_IO +/// \brief Allocates a new image whose dimensions are determined by the given jpeg image file, and loads the pixels into it. +/// Triggers a compile assert if the image color space or channel depth are not supported by the JPEG library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its color space or channel depth are not +/// compatible with the ones specified by Image +template< typename String + , typename Image + > +inline +void jpeg_read_image( const String& filename + , Image& img + ) +{ + read_image( filename + , img + , jpeg_tag() + ); +} + +/// \ingroup JPEG_IO +/// \brief Loads and color-converts the image specified by the given jpeg image file name into the given view. +/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + , typename CC + > +inline +void jpeg_read_and_convert_view( const String& filename + , const View& view + , CC cc + ) +{ + read_and_convert_view( filename + , view + , cc + , jpeg_tag() + ); +} + +/// \ingroup JPEG_IO +/// \brief Loads and color-converts the image specified by the given jpeg image file name into the given view. +/// Throws std::ios_base::failure if the file is not a valid JPEG file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void jpeg_read_and_convert_view( const String& filename + , const View& view + ) +{ + read_and_convert_view( filename + , view + , jpeg_tag() + ); +} + +/// \ingroup JPEG_IO +/// \brief Allocates a new image whose dimensions are determined by the given jpeg image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid JPEG file +template< typename String + , typename Image + , typename CC + > +inline +void jpeg_read_and_convert_image( const String& filename + , Image& img + , CC cc + ) +{ + read_and_convert_image( filename + , img + , cc + , jpeg_tag() + ); +} + +/// \ingroup JPEG_IO +/// \brief Allocates a new image whose dimensions are determined by the given jpeg image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid JPEG file +template< typename String + , typename Image + > +inline +void jpeg_read_and_convert_image( const String filename + , Image& img + ) +{ + read_and_convert_image( filename + , img + , jpeg_tag() + ); +} + + +/// \ingroup JPEG_IO +/// \brief Saves the view to a jpeg file specified by the given jpeg image file name. +/// Triggers a compile assert if the view color space and channel depth are not supported by the JPEG library or by the I/O extension. +/// Throws std::ios_base::failure if it fails to create the file. +template< typename String + , typename View + > +inline +void jpeg_write_view( const String& filename + , const View& view + , int quality = jpeg_quality::default_value + ) +{ + write_view( filename + , view + , image_write_info< jpeg_tag >( quality ) + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_IO_OLD_HPP diff --git a/boost/gil/extension/io_new/jpeg_read.hpp b/boost/gil/extension/io_new/jpeg_read.hpp new file mode 100644 index 00000000..663a1640 --- /dev/null +++ b/boost/gil/extension/io_new/jpeg_read.hpp @@ -0,0 +1,32 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_JPEG_READ_HPP +#define BOOST_GIL_EXTENSION_IO_JPEG_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "jpeg_tags.hpp" +#include "formats/jpeg/supported_types.hpp" +#include "formats/jpeg/read.hpp" + +#include "detail/read_image.hpp" +#include "detail/read_view.hpp" +#include "detail/read_image_info.hpp" +#include "detail/read_and_convert_image.hpp" +#include "detail/read_and_convert_view.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_READ_HPP diff --git a/boost/gil/extension/io_new/jpeg_tags.hpp b/boost/gil/extension/io_new/jpeg_tags.hpp new file mode 100644 index 00000000..85fdffa3 --- /dev/null +++ b/boost/gil/extension/io_new/jpeg_tags.hpp @@ -0,0 +1,147 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_JPEG_TAGS_HPP +#define BOOST_GIL_EXTENSION_IO_JPEG_TAGS_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief All supported jpeg tags by the gil io extension. +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +extern "C" { +#include +} + +#include "detail/base.hpp" + +namespace boost { namespace gil { + +/// Defines jpeg tag. +struct jpeg_tag : format_tag {}; + +/// see http://en.wikipedia.org/wiki/JPEG for reference + +/// Defines type for image width property. +struct jpeg_image_width : property_base< JDIMENSION > {}; + +/// Defines type for image height property. +struct jpeg_image_height : property_base< JDIMENSION > {}; + +/// Defines type for number of components property. +struct jpeg_num_components : property_base< int > {}; + +/// Defines type for color space property. +struct jpeg_color_space : property_base< J_COLOR_SPACE > {}; + +/// Defines type for jpeg quality property. +struct jpeg_quality : property_base< int > +{ + static const type default_value = 100; +}; + +/// Defines type for data precision property. +struct jpeg_data_precision : property_base< int > {}; + +/// Defines type for dct ( discrete cosine transformation ) method property. +struct jpeg_dct_method : property_base< J_DCT_METHOD > +{ + static const type slow = JDCT_ISLOW; + static const type fast = JDCT_IFAST; + static const type floating_pt = JDCT_FLOAT; + static const type fastest = JDCT_FASTEST; + + static const type default_value = slow; +}; + +/// Read information for jpeg images. +/// +/// The structure is returned when using read_image_info. +template<> +struct image_read_info< jpeg_tag > +{ + /// The image width. + jpeg_image_width::type _width; + + /// The image height. + jpeg_image_height::type _height; + + /// The number of channels. + jpeg_num_components::type _num_components; + + /// The color space. + jpeg_color_space::type _color_space; + + /// The width of channel. + /// I believe this number is always 8 in the case libjpeg is built with 8. + /// see: http://www.asmail.be/msg0055405033.html + jpeg_data_precision::type _data_precision; +}; + +/// Read settings for jpeg images. +/// +/// The structure can be used for all read_xxx functions, except read_image_info. +template<> +struct image_read_settings< jpeg_tag > : public image_read_settings_base +{ + /// Default constructor + image_read_settings() + : image_read_settings_base() + , _dct_method( jpeg_dct_method::default_value ) + {} + + /// Constructor + /// \param top_left Top left coordinate for reading partial image. + /// \param dim Dimensions for reading partial image. + /// \param dct_method Specifies dct method. + image_read_settings( const point_t& top_left + , const point_t& dim + , jpeg_dct_method::type dct_method = jpeg_dct_method::default_value + ) + : image_read_settings_base( top_left + , dim + ) + , _dct_method( dct_method ) + {} + + /// The dct ( discrete cosine transformation ) method. + jpeg_dct_method::type _dct_method; +}; + +/// Write information for jpeg images. +/// +/// The structure can be used for write_view() function. +template<> +struct image_write_info< jpeg_tag > +{ + /// Constructor + /// \param quality Defines the jpeg quality. + image_write_info( const jpeg_quality::type quality = jpeg_quality::default_value + , const jpeg_dct_method::type dct_method = jpeg_dct_method::default_value + ) + : _quality ( quality ) + , _dct_method( dct_method ) + {} + + /// The jpeg quality. + jpeg_quality::type _quality; + + /// The dct ( discrete cosine transformation ) method. + jpeg_dct_method::type _dct_method; +}; + + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_TAGS_HPP diff --git a/boost/gil/extension/io_new/jpeg_write.hpp b/boost/gil/extension/io_new/jpeg_write.hpp new file mode 100644 index 00000000..487dae6c --- /dev/null +++ b/boost/gil/extension/io_new/jpeg_write.hpp @@ -0,0 +1,28 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_JPEG_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_JPEG_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "jpeg_tags.hpp" +#include "formats/jpeg/supported_types.hpp" +#include "formats/jpeg/write.hpp" + +#include "detail/write_view.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_JPEG_WRITE_HPP diff --git a/boost/gil/extension/io_new/png_all.hpp b/boost/gil/extension/io_new/png_all.hpp new file mode 100644 index 00000000..5fd71050 --- /dev/null +++ b/boost/gil/extension/io_new/png_all.hpp @@ -0,0 +1,25 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNG_ALL_HPP +#define BOOST_GIL_EXTENSION_IO_PNG_ALL_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "png_read.hpp" +#include "png_write.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_PNG_ALL_HPP diff --git a/boost/gil/extension/io_new/png_io_old.hpp b/boost/gil/extension/io_new/png_io_old.hpp new file mode 100644 index 00000000..0a7a780e --- /dev/null +++ b/boost/gil/extension/io_new/png_io_old.hpp @@ -0,0 +1,175 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNG_IO_OLD_HPP +#define BOOST_GIL_EXTENSION_IO_PNG_IO_OLD_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "png_all.hpp" + +namespace boost { namespace gil { + +/// \ingroup PNG_IO +/// \brief Returns the width and height of the PNG file at the specified location. +/// Throws std::ios_base::failure if the location does not correspond to a valid PNG file +template< typename String > +inline +point2< std::ptrdiff_t > png_read_dimensions( const String& filename ) +{ + image_read_info< png_tag > info = read_image_info( filename + , png_tag() + ); + + return point2< std::ptrdiff_t >( info._width + , info._height + ); +} + +/// \ingroup PNG_IO +/// \brief Loads the image specified by the given png image file name into the given view. +/// Triggers a compile assert if the view color space and channel depth are not supported by the PNG library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid PNG file, or if its color space or channel depth are not +/// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void png_read_view( const String& filename + , const View& view + ) +{ + read_view( filename + , view + , png_tag() + ); +} + +/// \ingroup PNG_IO +/// \brief Allocates a new image whose dimensions are determined by the given png image file, and loads the pixels into it. +/// Triggers a compile assert if the image color space or channel depth are not supported by the PNG library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid PNG file, or if its color space or channel depth are not +/// compatible with the ones specified by Image +template< typename String + , typename Image + > +inline +void png_read_image( const String& filename + , Image& img + ) +{ + read_image( filename + , img + , png_tag() + ); +} + +/// \ingroup PNG_IO +/// \brief Loads the image specified by the given png image file name and color-converts it into the given view. +/// Throws std::ios_base::failure if the file is not a valid PNG file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + , typename CC + > +inline +void png_read_and_convert_view( const String& filename + , const View& view + , CC cc + ) +{ + read_and_convert_view( filename + , view + , cc + , png_tag() + ); +} + +/// \ingroup PNG_IO +/// \brief Loads the image specified by the given png image file name and color-converts it into the given view. +/// Throws std::ios_base::failure if the file is not a valid PNG file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void png_read_and_convert_view( const String& filename + , const View& view + ) +{ + read_and_convert_view( filename + , view + , png_tag() + ); +} + +/// \ingroup PNG_IO +/// \brief Allocates a new image whose dimensions are determined by the given png image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid PNG file +template< typename String + , typename Image + , typename CC + > +inline +void png_read_and_convert_image( const String& filename + , Image& img + , CC cc + ) +{ + read_and_convert_image( filename + , img + , cc + , png_tag() + ); +} + +/// \ingroup PNG_IO +/// \brief Allocates a new image whose dimensions are determined by the given png image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid PNG file +template< typename String + , typename Image + > +inline +void png_read_and_convert_image( const String filename + , Image& img + ) +{ + read_and_convert_image( filename + , img + , png_tag() + ); +} + +/// \ingroup PNG_IO +/// \brief Saves the view to a png file specified by the given png image file name. +/// Triggers a compile assert if the view color space and channel depth are not supported by the PNG library or by the I/O extension. +/// Throws std::ios_base::failure if it fails to create the file. +template< typename String + , typename View + > +inline +void png_write_view( const String& filename + , const View& view + ) +{ + write_view( filename + , view + , png_tag() + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_PNG_IO_OLD_HPP diff --git a/boost/gil/extension/io_new/png_read.hpp b/boost/gil/extension/io_new/png_read.hpp new file mode 100644 index 00000000..998e3ad9 --- /dev/null +++ b/boost/gil/extension/io_new/png_read.hpp @@ -0,0 +1,33 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNG_READ_HPP +#define BOOST_GIL_EXTENSION_IO_PNG_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "png_tags.hpp" +#include "formats/png/supported_types.hpp" +#include "formats/png/read.hpp" + +#include "detail/read_image.hpp" +#include "detail/read_view.hpp" +#include "detail/read_image_info.hpp" +#include "detail/read_and_convert_image.hpp" +#include "detail/read_and_convert_view.hpp" + + +#endif // BOOST_GIL_EXTENSION_IO_PNG_READ_HPP diff --git a/boost/gil/extension/io_new/png_tags.hpp b/boost/gil/extension/io_new/png_tags.hpp new file mode 100644 index 00000000..653e6ab0 --- /dev/null +++ b/boost/gil/extension/io_new/png_tags.hpp @@ -0,0 +1,613 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNG_TAGS_HPP +#define BOOST_GIL_EXTENSION_IO_PNG_TAGS_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +extern "C" { +#include +} + +#include +#include + +#include "detail/base.hpp" + +namespace boost { namespace gil { + +/// Defines png tag. +struct png_tag : format_tag {}; + +/// see http://en.wikipedia.org/wiki/Portable_Network_Graphics for reference + +/// Defines type for image width property. +struct png_image_width : property_base< png_uint_32 > {}; + +/// Defines type for image height property. +struct png_image_height : property_base< png_uint_32 > {}; + +/// Defines type for interlace method property. +struct png_interlace_method : property_base< int > {}; + +/// Defines type for compression method property. +struct png_compression_method : property_base< int > {}; + +/// Defines type for filter method property. +struct png_filter_method : property_base< int > {}; + +/// Defines type for bit depth method property. +struct png_bitdepth : property_base< int > {}; + +/// Defines type for bit depth method property. +struct png_color_type : property_base< int > {}; + +/// Defines type for number of channels property. +struct png_num_channels : property_base< png_byte > {}; + +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + + /// Defines type for CIE chromacities property. + struct png_chromacities_type : property_base< double > {}; + + /// Defines type for gamma correction property. + struct png_gamma : property_base< double > {}; + + /// Defines type for physical scale unit property. + struct png_unit : property_base< int > {}; + + /// Defines type for physical scale property. + struct png_scale : property_base< double > {}; + +#else + /// Defines type for CIE chromacities property. + struct png_chromacities_type : property_base< png_fixed_point > {}; + + /// Defines type for gamma correction property. + struct png_gamma : property_base< png_fixed_point > {}; + + /// Defines type for physical scale unit property. + struct png_unit : property_base< int > {}; + + /// Defines type for physical scale property. + struct png_scale : property_base< std::string > {}; + +#endif // BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + +/// Defines type for ICC profile name property. +struct png_ICC_name : property_base< std::string > {}; +/// Defines type for ICC profile property. +struct png_ICC_profile : property_base< std::string > {}; +/// Defines type for ICC profile length property. +struct png_ICC_profile_length : property_base< png_uint_32 > {}; +/// Defines type for ICC compression property. +struct png_ICC_compression_type : property_base< int > {}; + +/// Defines type for rendering intent property. +struct png_intent : property_base< int > {}; + +/// Defines type for color palette property. +struct png_color_palette : property_base< std::vector< png_color > > {}; +/// Defines type for number of colors property. +struct png_num_palette : property_base< int > {}; + +/// Defines type for background property. +struct png_background : property_base< png_color_16 > {}; + +/// Defines type for histogram property. +struct png_histrogram : property_base< std::vector< png_uint_16 > > {}; + +/// Defines type for screen offset property. +struct png_offset : property_base< png_int_32 > {}; +/// Defines type for screen offset type property. +struct png_offset_type : property_base< int > {}; + +/// Defines type pixel calibration for property. +struct png_CAL : property_base< std::string > {}; +/// Defines type for pixel calibration parameters property. +struct png_CAL_params : property_base< std::vector< std::string > > {}; +/// Defines type for pixel calibration x property. +struct png_CAL_X : property_base< png_int_32 > {}; +/// Defines type for pixel calibration type property. +struct png_CAL_type : property_base< int > {}; +/// Defines type for number of pixel calibration properties. +struct png_CAL_nparam : property_base< int > {}; + +/// Defines type for physical resolution property. +struct png_resolution : property_base< png_uint_32 > {}; +/// Defines type for physical resolution unit property. +struct png_unit_type : property_base< int > {}; + +/// Defines type for significant bits property. +struct png_significant_bits : property_base< png_color_8 > {}; + +/// Helper structure for reading text property. +struct gil_io_png_text +{ + /// Compression type + int _compression; + // Key + std::string _key; + /// Text + std::string _text; +}; + +/// Defines type for text property. +struct png_text_ : property_base< std::vector< gil_io_png_text > > {}; +/// Defines type for number of text property. +struct png_num_text : property_base< int > {}; + +/// Defines type for modification time property. +struct png_mod_time : property_base< png_time > {}; + +/// Defines type for transparency data property. +struct png_trans : property_base< std::vector< png_byte > > {}; +/// Defines type for number of transparency data property. +struct png_num_trans : property_base< int > {}; +/// Defines type for transparency data values property. +struct png_trans_values : property_base< std::vector< png_color_16 > > {}; + +/// Defines type for png function return type. +struct png_return_value : property_base< png_uint_32 > {}; + +/// PNG info base class. Containing all header information both for reading and writing. +/// +/// This base structure was created to avoid code doubling. +struct png_info_base +{ + /// Default constructor + png_info_base() + : _width ( 0 ) + , _height( 0 ) + + , _bit_depth ( 0 ) + , _color_type ( 0 ) + , _interlace_method ( PNG_INTERLACE_NONE ) + , _compression_method( PNG_COMPRESSION_TYPE_DEFAULT ) + , _filter_method ( PNG_FILTER_TYPE_DEFAULT ) + + , _num_channels( 0 ) + +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + , _valid_cie_colors( 0 ) + , _white_x ( 0.0 ) + , _white_y ( 0.0 ) + , _red_x ( 0.0 ) + , _red_y ( 0.0 ) + , _green_x ( 0.0 ) + , _green_y ( 0.0 ) + , _blue_x ( 0.0 ) + , _blue_y ( 0.0 ) + + , _valid_file_gamma( 0 ) + , _file_gamma ( 1.0 ) +#else + , _valid_cie_colors( 0 ) + , _white_x ( 0 ) + , _white_y ( 0 ) + , _red_x ( 0 ) + , _red_y ( 0 ) + , _green_x ( 0 ) + , _green_y ( 0 ) + , _blue_x ( 0 ) + , _blue_y ( 0 ) + + , _valid_file_gamma( 0 ) + , _file_gamma ( 1 ) +#endif // BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + + , _valid_icc_profile ( 0 ) + , _icc_name ( ) + , _iccp_compression_type( PNG_COMPRESSION_TYPE_BASE ) + , _profile ( ) + , _profile_length ( 0 ) + + , _valid_intent( 0 ) + , _intent ( 0 ) + + , _valid_palette( 0 ) + , _palette ( ) + , _num_palette ( 0 ) + + , _valid_background( 0 ) + , _background ( ) + + , _valid_histogram( 0 ) + , _histogram ( ) + + , _valid_offset ( 0 ) + , _offset_x ( 0 ) + , _offset_y ( 0 ) + , _off_unit_type( PNG_OFFSET_PIXEL ) + + , _valid_pixel_calibration( 0 ) + , _purpose ( ) + , _X0 ( 0 ) + , _X1 ( 0 ) + , _cal_type ( 0 ) + , _num_params ( 0 ) + , _units ( ) + , _params ( ) + + , _valid_resolution( 0 ) + , _res_x ( 0 ) + , _res_y ( 0 ) + , _phy_unit_type ( PNG_RESOLUTION_UNKNOWN ) + + , _valid_significant_bits( 0 ) + , _sig_bits ( ) + + , _valid_scale_factors( 0 ) + , _scale_unit ( PNG_SCALE_UNKNOWN ) +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + , _scale_width ( 0.0 ) + , _scale_height( 0.0 ) +#else + , _scale_width () + , _scale_height() +#endif // BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + + , _valid_text( 0 ) + , _text ( ) + , _num_text ( 0 ) + + , _valid_modification_time( 0 ) + , _mod_time ( ) + + , _valid_transparency_factors( 0 ) + , _trans ( ) + , _num_trans ( 0 ) + , _trans_values ( ) + {} + + /// The image width. + png_image_width::type _width; + /// The image height. + png_image_height::type _height; + + /// The bit depth per channel. + png_bitdepth::type _bit_depth; + /// The color space type. + png_color_type::type _color_type; + /// The interlace methos. + png_interlace_method::type _interlace_method; + /// The compression method. + png_compression_method::type _compression_method; + /// The filer method. + png_filter_method::type _filter_method; + + /// The number of channels. + png_num_channels::type _num_channels; + + // CIE chromacities + /// The return value when reading CIE chromacities. + png_return_value::type _valid_cie_colors; + /// The white x value. + png_chromacities_type::type _white_x; + /// The white y value. + png_chromacities_type::type _white_y; + /// The red x value. + png_chromacities_type::type _red_x; + /// The red y value. + png_chromacities_type::type _red_y; + /// The green x value. + png_chromacities_type::type _green_x; + /// The green y value. + png_chromacities_type::type _green_y; + /// The blue x value. + png_chromacities_type::type _blue_x; + /// The blue y value. + png_chromacities_type::type _blue_y; + + // Gamma Value + /// The return value when reading gamma value. + png_return_value::type _valid_file_gamma; + /// The file gamma value. + png_gamma::type _file_gamma; + + // Embedded ICC profile + /// The return value when reading ICC profile. + png_return_value::type _valid_icc_profile; + /// The ICC name. + png_ICC_name::type _icc_name; + /// The icc compression type. + png_ICC_compression_type::type _iccp_compression_type; + /// The ICC profile. + png_ICC_profile::type _profile; + /// The ICC profile length. + png_ICC_profile_length::type _profile_length; + + // Rendering intent + /// The return value when reading rendering intent. + png_return_value::type _valid_intent; + /// The rendering intent value. + png_intent::type _intent; + + // Image palette + /// The return value when reading image palette. + png_return_value::type _valid_palette; + /// The color palette. + png_color_palette::type _palette; + /// The number of colors in the palettes. + png_num_palette::type _num_palette; + + // Background + /// The return value when reading background. + png_return_value::type _valid_background; + /// The background color. + png_background::type _background; + + // Histogram + /// The return value when reading histogram. + png_return_value::type _valid_histogram; + /// The histogram. + png_histrogram::type _histogram; + + // Screen offsets + /// The return value when reading screen offsets. + png_return_value::type _valid_offset; + /// The x offset. + png_offset::type _offset_x; + /// The y offset. + png_offset::type _offset_y; + /// The offset unit. + png_offset_type::type _off_unit_type; + + // Pixel Calibration + /// The return value when reading pixel calibration. + png_return_value::type _valid_pixel_calibration; + /// The purpose. + png_CAL::type _purpose; + /// The x_0 value. + png_CAL_X::type _X0; + /// The x_1 value. + png_CAL_X::type _X1; + /// The calibration type. + png_CAL_type::type _cal_type; + /// The number of calibration parameters. + png_CAL_nparam::type _num_params; + /// The calibration unit type. + png_CAL::type _units; + /// The calibration parameters. + png_CAL_params::type _params; + + // Physical resolution + /// The return value when reading physical resolution properties. + png_return_value::type _valid_resolution; + /// The x physical resolution. + png_resolution::type _res_x; + /// The y physical resolution. + png_resolution::type _res_y; + /// The physical resolution unit. + png_unit_type::type _phy_unit_type; + + // Number of significant bits + /// The return value when reading significant bits. + png_return_value::type _valid_significant_bits; + /// The significant bits. + png_significant_bits::type _sig_bits; + + // Scale Factors + /// The return value when reading scale factors. + png_return_value::type _valid_scale_factors; + /// The scaling unit. + png_unit::type _scale_unit; + /// The scaling width. + png_scale::type _scale_width; + /// The scaling height. + png_scale::type _scale_height; + + // Comments information + /// The return value when reading image comments. + png_return_value::type _valid_text; + /// The comments. + png_text_::type _text; + /// The number of comments. + png_num_text::type _num_text; + + // Last modification time + /// The return value when reading modification time. + png_return_value::type _valid_modification_time; + /// The modification time. + png_mod_time::type _mod_time; + + // Transparency data + /// The return value when reading transparency data. + png_return_value::type _valid_transparency_factors; + /// The transparency data. + png_trans::type _trans; + /// The number of transparency data. + png_num_trans::type _num_trans; + /// The transparency data values. + png_trans_values::type _trans_values; +}; + +/// Read information for png images. +/// +/// The structure is returned when using read_image_info. +template<> +struct image_read_info< png_tag > : public png_info_base +{ + /// Default constructor. + image_read_info< png_tag >() + : png_info_base() + {} +}; + +/// PNG settings base class. +/// +/// This base structure was created to avoid code doubling. +struct png_read_settings_base +{ + /// Default Constructor. + png_read_settings_base() + { + _read_cie_chromacities = false; + _read_file_gamma = false; + _read_icc_profile = false; + _read_intent = false; + _read_palette = false; + _read_background = false; + _read_histogram = false; + _read_screen_offsets = false; + _read_pixel_calibration = false; + _read_physical_resolution = false; + _read_number_of_significant_bits = false; + _read_scale_factors = false; + _read_comments = false; + _read_last_modification_time = false; + _read_transparency_data = false; + } + + /// Helper function to enabling reading all png properties. + void set_read_members_true() + { + _read_cie_chromacities = true; + _read_file_gamma = true; + _read_icc_profile = true; + _read_intent = true; + _read_palette = true; + _read_background = true; + _read_histogram = true; + _read_screen_offsets = true; + _read_pixel_calibration = true; + _read_physical_resolution = true; + _read_number_of_significant_bits = true; + _read_scale_factors = true; + _read_comments = true; + _read_last_modification_time = true; + _read_transparency_data = true; + } + + /// Enable reading CIE chromacities. + bool _read_cie_chromacities; + /// Enable reading file gamma. + bool _read_file_gamma; + /// Enable reading ICC profile. + bool _read_icc_profile; + /// Enable reading rendering intent. + bool _read_intent; + /// Enable reading color palette. + bool _read_palette; + /// Enable reading background color. + bool _read_background; + /// Enable reading histogram. + bool _read_histogram; + /// Enable reading screen offsets. + bool _read_screen_offsets; + /// Enable reading pixel calibration. + bool _read_pixel_calibration; + /// Enable reading physical resolution. + bool _read_physical_resolution; + /// Enable reading significant bits. + bool _read_number_of_significant_bits; + /// Enable reading scaling factors. + bool _read_scale_factors; + /// Enable reading comments. + bool _read_comments; + /// Enable reading modification time. + bool _read_last_modification_time; + /// Enable reading transparency data. + bool _read_transparency_data; +}; + +#ifdef BOOST_GIL_IO_PNG_FLOATING_POINT_SUPPORTED + +/// Read settings for png images. +/// +/// The structure can be used for all read_xxx functions, except read_image_info. +template<> +struct image_read_settings< png_tag > : public image_read_settings_base + , public png_read_settings_base +{ + /// Default Constructor + image_read_settings< png_tag >() + : image_read_settings_base() + , png_read_settings_base() + , _screen_gamma( 1.0 ) + {} + + /// Constructor + /// \param top_left Top left coordinate for reading partial image. + /// \param dim Dimensions for reading partial image. + /// \param gamma Screen gamma value. + image_read_settings( const point_t& top_left + , const point_t& dim + , double gamma = 1.0 + ) + : image_read_settings_base( top_left + , dim + ) + , png_read_settings_base() + , _apply_screen_gamma( false ) + , _screen_gamma( screen_gamma ) + {} + + /// Apply screen gamma value. + bool _apply_screen_gamma; + /// The screen gamma value. + png_gamma::type _screen_gamma; +}; + +#else + +/// Read settings for png images. +/// +/// The structure can be used for all read_xxx functions, except read_image_info. +template<> +struct image_read_settings< png_tag > : public image_read_settings_base + , public png_read_settings_base +{ + /// Default Constructor. + image_read_settings< png_tag >() + : image_read_settings_base() + , png_read_settings_base() + {} + + image_read_settings( const point_t& top_left + , const point_t& dim + ) + : image_read_settings_base( top_left + , dim + ) + , png_read_settings_base() + , _apply_screen_gamma( false ) + , _screen_gamma ( 2 ) + {} + + /// Apply screen gamma value. + bool _apply_screen_gamma; + /// The screen gamma value. + png_gamma::type _screen_gamma; +}; +#endif + +/// Write information for png images. +/// +/// The structure can be used for write_view() function. +template<> +struct image_write_info< png_tag > : public png_info_base +{ + image_write_info() + : png_info_base() + {} +}; + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_PNG_TAGS_HPP diff --git a/boost/gil/extension/io_new/png_write.hpp b/boost/gil/extension/io_new/png_write.hpp new file mode 100644 index 00000000..da875977 --- /dev/null +++ b/boost/gil/extension/io_new/png_write.hpp @@ -0,0 +1,28 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNG_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_PNG_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "png_tags.hpp" +#include "formats/png/supported_types.hpp" +#include "formats/png/write.hpp" + +#include "detail/write_view.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_PNG_WRITE_HPP diff --git a/boost/gil/extension/io_new/pnm_all.hpp b/boost/gil/extension/io_new/pnm_all.hpp new file mode 100644 index 00000000..ae34d560 --- /dev/null +++ b/boost/gil/extension/io_new/pnm_all.hpp @@ -0,0 +1,25 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNM_ALL_HPP +#define BOOST_GIL_EXTENSION_IO_PNM_ALL_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "pnm_read.hpp" +#include "pnm_write.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_PNM_ALL_HPP diff --git a/boost/gil/extension/io_new/pnm_io_old.hpp b/boost/gil/extension/io_new/pnm_io_old.hpp new file mode 100644 index 00000000..1d32700f --- /dev/null +++ b/boost/gil/extension/io_new/pnm_io_old.hpp @@ -0,0 +1,177 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNM_IO_OLD_HPP +#define BOOST_GIL_EXTENSION_IO_PNM_IO_OLD_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "pnm_all.hpp" + +namespace boost { namespace gil { + +/// \ingroup PNM_IO +/// \brief Returns the width and height of the PNM file at the specified location. +/// Throws std::ios_base::failure if the location does not correspond to a valid PNM file +template< typename String > +inline +point2< std::ptrdiff_t > pnm_read_dimensions( const String& filename ) +{ + image_read_info< pnm_tag > info = read_image_info( filename + , pnm_tag() + ); + + return point2< std::ptrdiff_t >( info._width + , info._height + ); +} + + +/// \ingroup PNM_IO +/// \brief Loads the image specified by the given pnm image file name into the given view. +/// Triggers a compile assert if the view color space and channel depth are not supported by the PNM library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid PNM file, or if its color space or channel depth are not +/// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void pnm_read_view( const String& filename + , const View& view + ) +{ + read_view( filename + , view + , pnm_tag() + ); +} + +/// \ingroup PNM_IO +/// \brief Allocates a new image whose dimensions are determined by the given pnm image file, and loads the pixels into it. +/// Triggers a compile assert if the image color space or channel depth are not supported by the PNM library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid PNM file, or if its color space or channel depth are not +/// compatible with the ones specified by Image +template< typename String + , typename Image + > +inline +void pnm_read_image( const String& filename + , Image& img + ) +{ + read_image( filename + , img + , pnm_tag() + ); +} + +/// \ingroup PNM_IO +/// \brief Loads and color-converts the image specified by the given pnm image file name into the given view. +/// Throws std::ios_base::failure if the file is not a valid PNM file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + , typename CC + > +inline +void pnm_read_and_convert_view( const String& filename + , const View& view + , CC cc + ) +{ + read_and_convert_view( filename + , view + , cc + , pnm_tag() + ); +} + +/// \ingroup PNM_IO +/// \brief Loads and color-converts the image specified by the given pnm image file name into the given view. +/// Throws std::ios_base::failure if the file is not a valid PNM file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void pnm_read_and_convert_view( const String& filename + , const View& view + ) +{ + read_and_convert_view( filename + , view + , pnm_tag() + ); +} + +/// \ingroup PNM_IO +/// \brief Allocates a new image whose dimensions are determined by the given pnm image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid PNM file +template< typename String + , typename Image + , typename CC + > +inline +void pnm_read_and_convert_image( const String& filename + , Image& img + , CC cc + ) +{ + read_and_convert_image( filename + , img + , cc + , pnm_tag() + ); +} + +/// \ingroup PNM_IO +/// \brief Allocates a new image whose dimensions are determined by the given pnm image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid PNM file +template< typename String + , typename Image + > +inline +void pnm_read_and_convert_image( const String filename + , Image& img + ) +{ + read_and_convert_image( filename + , img + , pnm_tag() + ); +} + + +/// \ingroup PNM_IO +/// \brief Saves the view to a pnm file specified by the given pnm image file name. +/// Triggers a compile assert if the view color space and channel depth are not supported by the PNM library or by the I/O extension. +/// Throws std::ios_base::failure if it fails to create the file. +template< typename String + , typename View + > +inline +void pnm_write_view( const String& filename + , const View& view + ) +{ + write_view( filename + , view + , pnm_tag() + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_PNM_IO_OLD_HPP diff --git a/boost/gil/extension/io_new/pnm_read.hpp b/boost/gil/extension/io_new/pnm_read.hpp new file mode 100644 index 00000000..5ffabd52 --- /dev/null +++ b/boost/gil/extension/io_new/pnm_read.hpp @@ -0,0 +1,32 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNM_READ_HPP +#define BOOST_GIL_EXTENSION_IO_PNM_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "pnm_tags.hpp" +#include "formats/pnm/supported_types.hpp" +#include "formats/pnm/read.hpp" + +#include "detail/read_image.hpp" +#include "detail/read_view.hpp" +#include "detail/read_image_info.hpp" +#include "detail/read_and_convert_image.hpp" +#include "detail/read_and_convert_view.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_PNM_READ_HPP diff --git a/boost/gil/extension/io_new/pnm_tags.hpp b/boost/gil/extension/io_new/pnm_tags.hpp new file mode 100644 index 00000000..91f10842 --- /dev/null +++ b/boost/gil/extension/io_new/pnm_tags.hpp @@ -0,0 +1,104 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNM_TAGS_HPP +#define BOOST_GIL_EXTENSION_IO_PNM_TAGS_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +#include "detail/base.hpp" + +namespace boost { namespace gil { + +/// Defines pnm tag. +struct pnm_tag : format_tag {}; + +/// see http://en.wikipedia.org/wiki/Portable_Bitmap_File_Format for reference + +/// Defines type for image type property. +struct pnm_image_type : property_base< uint32_t > +{ + typedef boost::mpl::integral_c< type, 1 > mono_asc_t; + typedef boost::mpl::integral_c< type, 2 > gray_asc_t; + typedef boost::mpl::integral_c< type, 3 > color_asc_t; + + typedef boost::mpl::integral_c< type, 4 > mono_bin_t; + typedef boost::mpl::integral_c< type, 5 > gray_bin_t; + typedef boost::mpl::integral_c< type, 6 > color_bin_t; +}; + +/// Defines type for image width property. +struct pnm_image_width : property_base< uint32_t > {}; + +/// Defines type for image height property. +struct pnm_image_height : property_base< uint32_t > {}; + +/// Defines type for image max value property. +struct pnm_image_max_value : property_base< uint32_t > {}; + +/// Read information for pnm images. +/// +/// The structure is returned when using read_image_info. +template<> +struct image_read_info< pnm_tag > +{ + /// The image type. + pnm_image_type::type _type; + /// The image width. + pnm_image_width::type _width; + /// The image height. + pnm_image_height::type _height; + /// The image max value. + pnm_image_max_value::type _max_value; +}; + +/// Read settings for pnm images. +/// +/// The structure can be used for all read_xxx functions, except read_image_info. +template<> +struct image_read_settings< pnm_tag > : public image_read_settings_base +{ + /// Default constructor + image_read_settings< pnm_tag >() + : image_read_settings_base() + {} + + /// Constructor + /// \param top_left Top left coordinate for reading partial image. + /// \param dim Dimensions for reading partial image. + image_read_settings( const point_t& top_left + , const point_t& dim + ) + : image_read_settings_base( top_left + , dim + ) + {} +}; + +/// Write information for pnm images. +/// +/// The structure can be used for write_view() function. +template<> +struct image_write_info< pnm_tag > +{ +}; + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_PNM_TAGS_HPP diff --git a/boost/gil/extension/io_new/pnm_write.hpp b/boost/gil/extension/io_new/pnm_write.hpp new file mode 100644 index 00000000..11419ea0 --- /dev/null +++ b/boost/gil/extension/io_new/pnm_write.hpp @@ -0,0 +1,28 @@ +/* + Copyright 2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_PNM_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_PNM_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "pnm_tags.hpp" +#include "formats/pnm/supported_types.hpp" +#include "formats/pnm/write.hpp" + +#include "detail/write_view.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_PNM_WRITE_HPP diff --git a/boost/gil/extension/io_new/tiff_all.hpp b/boost/gil/extension/io_new/tiff_all.hpp new file mode 100644 index 00000000..8812d7ef --- /dev/null +++ b/boost/gil/extension/io_new/tiff_all.hpp @@ -0,0 +1,25 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_ALL_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_ALL_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "tiff_read.hpp" +#include "tiff_write.hpp" + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_ALL_HPP diff --git a/boost/gil/extension/io_new/tiff_io_old.hpp b/boost/gil/extension/io_new/tiff_io_old.hpp new file mode 100644 index 00000000..3791ff2d --- /dev/null +++ b/boost/gil/extension/io_new/tiff_io_old.hpp @@ -0,0 +1,176 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_IO_OLD_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_IO_OLD_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "tiff_all.hpp" + +namespace boost { namespace gil { + +/// \ingroup TIFF_IO +/// \brief Returns the width and height of the TIFF file at the specified location. +/// Throws std::ios_base::failure if the location does not correspond to a valid TIFF file +template< typename String > +inline +point2< std::ptrdiff_t > tiff_read_dimensions( const String& filename ) +{ + image_read_info< tiff_tag > info = read_image_info( filename + , tiff_tag() + ); + + return point2< std::ptrdiff_t >( info._width + , info._height + ); +} + +/// \ingroup TIFF_IO +/// \brief Loads the image specified by the given tiff image file name into the given view. +/// Triggers a compile assert if the view color space and channel depth are not supported by the TIFF library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not +/// compatible with the ones specified by View, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void tiff_read_view( const String& filename + , const View& view + ) +{ + read_view( filename + , view + , tiff_tag() + ); +} + +/// \ingroup TIFF_IO +/// \brief Allocates a new image whose dimensions are determined by the given tiff image file, and loads the pixels into it. +/// Triggers a compile assert if the image color space or channel depth are not supported by the TIFF library or by the I/O extension. +/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its color space or channel depth are not +/// compatible with the ones specified by Image +template< typename String + , typename Image + > +inline +void tiff_read_image( const String& filename + , Image& img + ) +{ + read_image( filename + , img + , tiff_tag() + ); +} + +/// \ingroup TIFF_IO +/// \brief Loads and color-converts the image specified by the given tiff image file name into the given view. +/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + , typename CC + > +inline +void tiff_read_and_convert_view( const String& filename + , const View& view + , CC cc + ) +{ + read_and_convert_view( filename + , view + , cc + , tiff_tag() + ); +} + +/// \ingroup TIFF_IO +/// \brief Loads and color-converts the image specified by the given tiff image file name into the given view. +/// Throws std::ios_base::failure if the file is not a valid TIFF file, or if its dimensions don't match the ones of the view. +template< typename String + , typename View + > +inline +void tiff_read_and_convert_view( const String& filename + , const View& view + ) +{ + read_and_convert_view( filename + , view + , tiff_tag() + ); +} + +/// \ingroup TIFF_IO +/// \brief Allocates a new image whose dimensions are determined by the given tiff image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid TIFF file +template< typename String + , typename Image + , typename CC + > +inline +void tiff_read_and_convert_image( const String& filename + , Image& img + , CC cc + ) +{ + read_and_convert_image( filename + , img + , cc + , tiff_tag() + ); +} + +/// \ingroup TIFF_IO +/// \brief Allocates a new image whose dimensions are determined by the given tiff image file, loads and color-converts the pixels into it. +/// Throws std::ios_base::failure if the file is not a valid TIFF file +template< typename String + , typename Image + > +inline +void tiff_read_and_convert_image( const String filename + , Image& img + ) +{ + read_and_convert_image( filename + , img + , tiff_tag() + ); +} + + +/// \ingroup TIFF_IO +/// \brief Saves the view to a tiff file specified by the given tiff image file name. +/// Triggers a compile assert if the view color space and channel depth are not supported by the TIFF library or by the I/O extension. +/// Throws std::ios_base::failure if it fails to create the file. +template< typename String + , typename View + > +inline +void tiff_write_view( const String& filename + , const View& view + ) +{ + write_view( filename + , view + , tiff_tag() + ); +} + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_IO_OLD_HPP diff --git a/boost/gil/extension/io_new/tiff_read.hpp b/boost/gil/extension/io_new/tiff_read.hpp new file mode 100644 index 00000000..a93e1f7a --- /dev/null +++ b/boost/gil/extension/io_new/tiff_read.hpp @@ -0,0 +1,34 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_READ_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_READ_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "tiff_tags.hpp" +#include "formats/tiff/supported_types.hpp" +#include "formats/tiff/read.hpp" + +#include "detail/read_image_info.hpp" +#include "detail/read_view.hpp" +#include "detail/read_image.hpp" +#include "detail/read_and_convert_image.hpp" +#include "detail/read_and_convert_view.hpp" + + + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_READ_HPP diff --git a/boost/gil/extension/io_new/tiff_tags.hpp b/boost/gil/extension/io_new/tiff_tags.hpp new file mode 100644 index 00000000..391a5269 --- /dev/null +++ b/boost/gil/extension/io_new/tiff_tags.hpp @@ -0,0 +1,302 @@ +/* + Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_TAGS_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_TAGS_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief All supported tiff tags by the gil io extension. +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +extern "C" { +#include "tiff.h" +} + +#include "detail/base.hpp" +#include "formats/tiff/log.hpp" + +namespace boost { namespace gil { + +/// Defines tiff tag. +struct tiff_tag : format_tag {}; + +/// For a description see: http://www.awaresystems.be/imaging/tiff/tifftags/baseline.html +/// see http://www.remotesensing.org/libtiff/ +/// or http://www.libtiff.org/man/ + +/// TIFF property base class +template< typename T, int Value > +struct tiff_property_base : property_base< T > +{ + /// Tag, needed when reading or writing image properties. + static const unsigned int tag = Value; +}; + +/// baseline tags + +/// Defines type for new subfile property. +struct tiff_new_subfile_type : tiff_property_base< uint32_t, TIFFTAG_SUBFILETYPE > {}; + +/// Defines type for subfile property. +struct tiff_subfile_type : tiff_property_base< uint16_t, TIFFTAG_OSUBFILETYPE > {}; + +/// Defines type for image width property. +struct tiff_image_width : tiff_property_base< uint32_t, TIFFTAG_IMAGEWIDTH > {}; + +/// Defines type for image height property. +struct tiff_image_height : tiff_property_base< uint32_t, TIFFTAG_IMAGELENGTH > {}; + +/// Defines type for bits per sample property. +struct tiff_bits_per_sample : tiff_property_base< uint16_t, TIFFTAG_BITSPERSAMPLE > {}; + +/// Defines type for compression property. +struct tiff_compression : tiff_property_base< uint16_t, TIFFTAG_COMPRESSION > {}; + +/// Defines type for photometric interpretation property. +struct tiff_photometric_interpretation : tiff_property_base< uint16_t, TIFFTAG_PHOTOMETRIC > {}; + +/// Defines type for threshold property. +struct tiff_thresholding : tiff_property_base< uint16_t, TIFFTAG_THRESHHOLDING > {}; + +/// Defines type for cell width property. +struct tiff_cell_width : tiff_property_base< uint16_t, TIFFTAG_CELLWIDTH > {}; + +/// Defines type for cell length property. +struct tiff_cell_length : tiff_property_base< uint16_t, TIFFTAG_CELLLENGTH > {}; + +/// Defines type for fill order property. +struct tiff_fill_order : tiff_property_base< std::string, TIFFTAG_FILLORDER > {}; + +/// Defines type for image description. +struct tiff_image_description : tiff_property_base< std::string, TIFFTAG_IMAGEDESCRIPTION > {}; + +/// Defines type for make property. +struct tiff_make : tiff_property_base< std::string, TIFFTAG_MAKE > {}; + +/// Defines type for model property. +struct tiff_model : tiff_property_base< std::string, TIFFTAG_MODEL > {}; + +/// Defines type for image orientation. +struct tiff_orientation : tiff_property_base< uint16_t, TIFFTAG_ORIENTATION > {}; + +/// Defines type for samples per pixel property. +struct tiff_samples_per_pixel : tiff_property_base< uint16_t, TIFFTAG_SAMPLESPERPIXEL > {}; + +/// Defines type for rows per strip property. +struct tiff_rows_per_strip : tiff_property_base< uint32_t, TIFFTAG_ROWSPERSTRIP > {}; + +/// Defines type for min sample property. +struct tiff_min_sample_value : tiff_property_base< uint16_t, TIFFTAG_MINSAMPLEVALUE > {}; + +/// Defines type for max sample property. +struct tiff_max_sample_value : tiff_property_base< uint16_t, TIFFTAG_MAXSAMPLEVALUE > {}; + +/// Defines type for x resolution property. +struct tiff_x_resolution : tiff_property_base< float, TIFFTAG_XRESOLUTION > {}; + +/// Defines type for y resolution property. +struct tiff_y_resolution : tiff_property_base< float, TIFFTAG_YRESOLUTION > {}; + +/// Defines type for resolution unit property. +struct tiff_resolution_unit : tiff_property_base< uint16_t, TIFFTAG_RESOLUTIONUNIT > {}; + +/// Defines type for planar configuration property. +struct tiff_planar_configuration : tiff_property_base< uint16_t, TIFFTAG_PLANARCONFIG > {}; + +/// Defines type for gray response unit property. +struct tiff_gray_response_unit : tiff_property_base< uint16_t, TIFFTAG_GRAYRESPONSEUNIT > {}; + +/// Defines type for gray response curve property. +struct tiff_gray_response_curve : tiff_property_base< uint16_t*, TIFFTAG_GRAYRESPONSECURVE > {}; + +/// Defines type for software vendor property. +struct tiff_software : tiff_property_base< std::string, TIFFTAG_SOFTWARE > {}; + +/// Defines type for date time property. +struct tiff_date_time : tiff_property_base< std::string, TIFFTAG_DATETIME > {}; + +/// Defines type for artist information property. +struct tiff_artist : tiff_property_base< std::string, TIFFTAG_ARTIST > {}; + +/// Defines type for host computer property. +struct tiff_host_computer : tiff_property_base< std::string, TIFFTAG_HOSTCOMPUTER > {}; + +/// Helper structure for reading a color mapper. +struct tiff_color_map +{ + typedef uint16_t* red_t; + typedef uint16_t* green_t; + typedef uint16_t* blue_t; + + static const unsigned int tag = TIFFTAG_COLORMAP; +}; + +/// Defines type for extra samples property. +struct tiff_extra_samples : tiff_property_base< uint16_t*, TIFFTAG_EXTRASAMPLES > {}; + +/// Defines type for copyright property. +struct tiff_copyright : tiff_property_base< std::string, TIFFTAG_COPYRIGHT > {}; + +/// non-baseline tags + +/// Defines type for sample format property. +struct tiff_sample_format : tiff_property_base< uint16_t, TIFFTAG_SAMPLEFORMAT > {}; + +/// Defines type for indexed property. +struct tiff_indexed : tiff_property_base< bool, TIFFTAG_INDEXED > {}; + +/// Tile related tags + +/// Defines type for a (not) tiled tiff image +struct tiff_is_tiled : tiff_property_base< bool, false > {}; + +/// Defines type for tile width +struct tiff_tile_width : tiff_property_base< long, TIFFTAG_TILEWIDTH > {}; + +/// Defines type for tile length +struct tiff_tile_length : tiff_property_base< long, TIFFTAG_TILELENGTH > {}; + +/// Defines the page to read in a multipage tiff file. +#include +struct tiff_directory : property_base< tdir_t > +{ + typedef boost::mpl::integral_c< type, 0 > default_value; +}; + +/// Read information for tiff images. +/// +/// The structure is returned when using read_image_info. +template<> +struct image_read_info< tiff_tag > +{ + image_read_info() + : _width( 0 ) + , _height( 0 ) + + , _compression( COMPRESSION_NONE ) + + , _bits_per_sample( 0 ) + , _samples_per_pixel( 0 ) + , _sample_format( SAMPLEFORMAT_UINT ) + + , _planar_configuration( PLANARCONFIG_CONTIG ) + + , _photometric_interpretation( PHOTOMETRIC_MINISWHITE ) + + , _is_tiled( false ) + + , _tile_width ( 0 ) + , _tile_length( 0 ) + {} + + /// The number of rows of pixels in the image. + tiff_image_width::type _width; + /// The number of columns in the image, i.e., the number of pixels per row. + tiff_image_height::type _height; + + /// Compression scheme used on the image data. + tiff_compression::type _compression; + + /// Number of bits per component. + tiff_bits_per_sample::type _bits_per_sample; + /// The number of components per pixel. + tiff_samples_per_pixel::type _samples_per_pixel; + /// Specifies how to interpret each data sample in a pixel. + tiff_sample_format::type _sample_format; + + /// How the components of each pixel are stored. + tiff_planar_configuration::type _planar_configuration; + + /// The color space of the image data. + tiff_photometric_interpretation::type _photometric_interpretation; + + /// Is tiled? + tiff_is_tiled::type _is_tiled; + /// Tile width + tiff_tile_width::type _tile_width; + /// Tile length + tiff_tile_length::type _tile_length; +}; + +/// Read settings for tiff images. +/// +/// The structure can be used for all read_xxx functions, except read_image_info. +template<> +struct image_read_settings< tiff_tag > : public image_read_settings_base +{ + /// Default constructor + image_read_settings< tiff_tag >() + : image_read_settings_base() + , _directory( tiff_directory::default_value::value ) + {} + + /// Constructor + /// \param top_left Top left coordinate for reading partial image. + /// \param dim Dimensions for reading partial image. + /// \param directory Defines the page to read in a multipage tiff file. + image_read_settings( const point_t& top_left + , const point_t& dim + , const tiff_directory::type& directory = tiff_directory::default_value::value + ) + : image_read_settings_base( top_left + , dim + ) + , _directory( directory ) + {} + + /// Defines the page to read in a multipage tiff file. + tiff_directory::type _directory; +}; + +/// Read settings for tiff images. +/// +/// The structure can be used for all read_xxx functions, except read_image_info. +template< typename Log > +struct image_write_info< tiff_tag, Log > +{ + /// Default constructor + image_write_info() + : _photometric_interpretation( PHOTOMETRIC_MINISBLACK ) + , _compression ( COMPRESSION_NONE ) + , _orientation ( ORIENTATION_TOPLEFT ) + , _planar_configuration ( PLANARCONFIG_CONTIG ) + , _is_tiled ( false ) + , _tile_width ( 0 ) + , _tile_length ( 0 ) + {} + + /// The color space of the image data. + tiff_photometric_interpretation::type _photometric_interpretation; + /// Compression scheme used on the image data. + tiff_compression::type _compression; + /// The orientation of the image with respect to the rows and columns. + tiff_orientation::type _orientation; + /// How the components of each pixel are stored. + tiff_planar_configuration::type _planar_configuration; + + /// Is the image tiled? + tiff_is_tiled::type _is_tiled; + /// Tiles width + tiff_tile_width::type _tile_width; + /// Tiles length + tiff_tile_length::type _tile_length; + + /// A log to transcript error and warning messages issued by libtiff. + Log _log; +}; + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_TAGS_HPP diff --git a/boost/gil/extension/io_new/tiff_write.hpp b/boost/gil/extension/io_new/tiff_write.hpp new file mode 100644 index 00000000..ecb80341 --- /dev/null +++ b/boost/gil/extension/io_new/tiff_write.hpp @@ -0,0 +1,29 @@ +/* + Copyright 2007-2008 Christian Henning + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_IO_TIFF_WRITE_HPP +#define BOOST_GIL_EXTENSION_IO_TIFF_WRITE_HPP + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Christian Henning \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include "tiff_tags.hpp" +#include "formats/tiff/supported_types.hpp" +#include "formats/tiff/write.hpp" + +#include "detail/write_view.hpp" + + +#endif // BOOST_GIL_EXTENSION_IO_TIFF_WRITE_HPP diff --git a/boost/gil/extension/numeric/affine.hpp b/boost/gil/extension/numeric/affine.hpp new file mode 100755 index 00000000..c41dffdf --- /dev/null +++ b/boost/gil/extension/numeric/affine.hpp @@ -0,0 +1,91 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt + or a copy at http://opensource.adobe.com/licenses.html) +*/ + +/*************************************************************************************************/ + +#ifndef GIL_AFFINE_HPP +#define GIL_AFFINE_HPP + +#include "boost/gil/utilities.hpp" // point2 + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief support for affine transformations +/// \author Lubomir Bourdev and Hailin Jin \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n September 21, 2006 +/// +//////////////////////////////////////////////////////////////////////////////////////// + +namespace boost { namespace gil { + +//////////////////////////////////////////////////////////////////////////////////////// +/// +/// Simple matrix to do 2D affine transformations. It is actually 3x3 but the last column is [0 0 1] +/// +//////////////////////////////////////////////////////////////////////////////////////// +template +class matrix3x2 { +public: + matrix3x2() : a(1), b(0), c(0), d(1), e(0), f(0) {} + matrix3x2(T A, T B, T C, T D, T E, T F) : a(A),b(B),c(C),d(D),e(E),f(F) {} + matrix3x2(const matrix3x2& mat) : a(mat.a), b(mat.b), c(mat.c), d(mat.d), e(mat.e), f(mat.f) {} + matrix3x2& operator=(const matrix3x2& m) { a=m.a; b=m.b; c=m.c; d=m.d; e=m.e; f=m.f; return *this; } + + matrix3x2& operator*=(const matrix3x2& m) { (*this) = (*this)*m; return *this; } + + static matrix3x2 get_rotate(T rads) { T c=std::cos(rads); T s=std::sin(rads); return matrix3x2(c,s,-s,c,0,0); } + static matrix3x2 get_translate(const point2& t) { return matrix3x2(1 ,0,0,1 ,t.x,t.y); } + static matrix3x2 get_translate(T x, T y) { return matrix3x2(1 ,0,0,1 ,x, y ); } + static matrix3x2 get_scale (const point2& s) { return matrix3x2(s.x,0,0,s.y,0 ,0 ); } + static matrix3x2 get_scale (T x, T y) { return matrix3x2(x, 0,0,y, 0 ,0 ); } + static matrix3x2 get_scale (T s) { return matrix3x2(s ,0,0,s ,0 ,0 ); } + + T a,b,c,d,e,f; +}; + +template GIL_FORCEINLINE +matrix3x2 operator*(const matrix3x2& m1, const matrix3x2& m2) { + return matrix3x2( + m1.a * m2.a + m1.b * m2.c, + m1.a * m2.b + m1.b * m2.d, + m1.c * m2.a + m1.d * m2.c, + m1.c * m2.b + m1.d * m2.d, + m1.e * m2.a + m1.f * m2.c + m2.e, + m1.e * m2.b + m1.f * m2.d + m2.f ); +} + +template GIL_FORCEINLINE +point2 operator*(const point2& p, const matrix3x2& m) { + return point2(m.a*p.x + m.c*p.y + m.e, m.b*p.x + m.d*p.y + m.f); +} + +//////////////////////////////////////////////////////////////////////////////////////// +/// Define affine mapping that transforms the source coordinates by the affine transformation +//////////////////////////////////////////////////////////////////////////////////////// +/* +template +concept MappingFunctionConcept { + typename mapping_traits::result_type; where PointNDConcept; + + template { where PointNDConcept } + result_type transform(MapFn&, const Domain& src); +}; +*/ + +template struct mapping_traits; + +template +struct mapping_traits > { + typedef point2 result_type; +}; + +template GIL_FORCEINLINE +point2 transform(const matrix3x2& mat, const point2& src) { return src * mat; } + +} } // namespace boost::gil + +#endif diff --git a/boost/gil/extension/numeric/algorithm.hpp b/boost/gil/extension/numeric/algorithm.hpp new file mode 100755 index 00000000..7074bb94 --- /dev/null +++ b/boost/gil/extension/numeric/algorithm.hpp @@ -0,0 +1,155 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt + or a copy at http://opensource.adobe.com/licenses.html) +*/ + +/*************************************************************************************************/ + +#ifndef GIL_NUMERIC_ALGORITHM_HPP +#define GIL_NUMERIC_ALGORITHM_HPP + +/*! +/// \file +/// \brief Numeric algorithms +/// \author Hailin Jin and Lubomir Bourdev \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n Last updated on February 6, 2007 +*/ + +#include +#include +#include +#include +#include "../../gil_config.hpp" +#include "../../pixel_iterator.hpp" +#include "../../metafunctions.hpp" + +namespace boost { namespace gil { + +/// \brief Returns the reference proxy associated with a type that has a \p "reference" member typedef. +/// +/// The reference proxy is the reference type, but with stripped-out C++ reference. It models PixelConcept +template +struct pixel_proxy : public remove_reference {}; + +/// \brief std::for_each for a pair of iterators +template +BinaryFunction for_each(Iterator1 first1,Iterator1 last1,Iterator2 first2,BinaryFunction f) { + while(first1!=last1) + f(*first1++,*first2++); + return f; +} + +template +inline DstIterator assign_pixels(SrcIterator src,SrcIterator src_end,DstIterator dst) { + for_each(src,src_end,dst,pixel_assigns_t::value_type>::type, + typename pixel_proxy::value_type>::type>()); + return dst+(src_end-src); +} + +namespace detail { +template +struct inner_product_k_t { + template + static _Tp apply(_InputIterator1 __first1, + _InputIterator2 __first2, _Tp __init, + _BinaryOperation1 __binary_op1, + _BinaryOperation2 __binary_op2) { + __init = __binary_op1(__init, __binary_op2(*__first1, *__first2)); + return inner_product_k_t::template apply(__first1+1,__first2+1,__init, + __binary_op1, __binary_op2); + } +}; + +template <> +struct inner_product_k_t<0> { + template + static _Tp apply(_InputIterator1 __first1, + _InputIterator2 __first2, _Tp __init, + _BinaryOperation1 __binary_op1, + _BinaryOperation2 __binary_op2) { + return __init; + } +}; +} // namespace detail + +/// static version of std::inner_product +template +GIL_FORCEINLINE +_Tp inner_product_k(_InputIterator1 __first1, + _InputIterator2 __first2, + _Tp __init, + _BinaryOperation1 __binary_op1, + _BinaryOperation2 __binary_op2) { + return detail::inner_product_k_t::template apply(__first1,__first2,__init, + __binary_op1, __binary_op2); +} + +/// \brief 1D un-guarded correlation with a variable-size kernel +template +inline DstIterator correlate_pixels_n(SrcIterator src_begin,SrcIterator src_end, + KernelIterator ker_begin,Integer ker_size, + DstIterator dst_begin) { + typedef typename pixel_proxy::value_type>::type PIXEL_SRC_REF; + typedef typename pixel_proxy::value_type>::type PIXEL_DST_REF; + typedef typename std::iterator_traits::value_type kernel_type; + PixelAccum acc_zero; pixel_zeros_t()(acc_zero); + while(src_begin!=src_end) { + pixel_assigns_t()( + std::inner_product(src_begin,src_begin+ker_size,ker_begin,acc_zero, + pixel_plus_t(), + pixel_multiplies_scalar_t()), + *dst_begin); + ++src_begin; ++dst_begin; + } + return dst_begin; +} + +/// \brief 1D un-guarded correlation with a fixed-size kernel +template +inline DstIterator correlate_pixels_k(SrcIterator src_begin,SrcIterator src_end, + KernelIterator ker_begin, + DstIterator dst_begin) { + typedef typename pixel_proxy::value_type>::type PIXEL_SRC_REF; + typedef typename pixel_proxy::value_type>::type PIXEL_DST_REF; + typedef typename std::iterator_traits::value_type kernel_type; + PixelAccum acc_zero; pixel_zeros_t()(acc_zero); + while(src_begin!=src_end) { + pixel_assigns_t()( + inner_product_k(src_begin,ker_begin,acc_zero, + pixel_plus_t(), + pixel_multiplies_scalar_t()), + *dst_begin); + ++src_begin; ++dst_begin; + } + return dst_begin; +} + +/// \brief destination is set to be product of the source and a scalar +template +inline void view_multiplies_scalar(const SrcView& src,const Scalar& scalar,const DstView& dst) { + assert(src.dimensions()==dst.dimensions()); + typedef typename pixel_proxy::type PIXEL_SRC_REF; + typedef typename pixel_proxy::type PIXEL_DST_REF; + int height=src.height(); + for(int rr=0;rr()( + pixel_multiplies_scalar_t()(*it_src,scalar), + *it_dst); + ++it_src; ++it_dst; + } + } +} + +} } // namespace boost::gil + +#endif diff --git a/boost/gil/extension/numeric/channel_numeric_operations.hpp b/boost/gil/extension/numeric/channel_numeric_operations.hpp new file mode 100755 index 00000000..1fc5879a --- /dev/null +++ b/boost/gil/extension/numeric/channel_numeric_operations.hpp @@ -0,0 +1,156 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt + or a copy at http://opensource.adobe.com/licenses.html) +*/ + +/*************************************************************************************************/ + +#ifndef GIL_CHANNEL_NUMERIC_OPERATIONS_HPP +#define GIL_CHANNEL_NUMERIC_OPERATIONS_HPP + +/*! +/// \file +/// \brief Structures for channel-wise numeric operations +/// \author Hailin Jin and Lubomir Bourdev \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n Last updated on September 30, 2006 +/// Currently defined structures: +/// channel_plus_t (+), channel_minus_t (-), +/// channel_multiplies_t (*), channel_divides_t (/), +/// channel_plus_scalar_t (+s), channel_minus_scalar_t (-s), +/// channel_multiplies_scalar_t (*s), channel_divides_scalar_t (/s), +/// channel_halves_t (/=2), channel_zeros_t (=0), channel_assigns_t (=) +*/ + +#include +#include "boost/gil/gil_config.hpp" +#include "boost/gil/channel.hpp" + +namespace boost { namespace gil { + +/// \ingroup ChannelNumericOperations +/// structure for adding one channel to another +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_plus_t : public std::binary_function { + ChannelR operator()(typename channel_traits::const_reference ch1, + typename channel_traits::const_reference ch2) const { + return ChannelR(ch1)+ChannelR(ch2); + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for subtracting one channel from another +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_minus_t : public std::binary_function { + ChannelR operator()(typename channel_traits::const_reference ch1, + typename channel_traits::const_reference ch2) const { + return ChannelR(ch1)-ChannelR(ch2); + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for multiplying one channel to another +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_multiplies_t : public std::binary_function { + ChannelR operator()(typename channel_traits::const_reference ch1, + typename channel_traits::const_reference ch2) const { + return ChannelR(ch1)*ChannelR(ch2); + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for dividing channels +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_divides_t : public std::binary_function { + ChannelR operator()(typename channel_traits::const_reference ch1, + typename channel_traits::const_reference ch2) const { + return ChannelR(ch1)/ChannelR(ch2); + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for adding a scalar to a channel +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_plus_scalar_t : public std::binary_function { + ChannelR operator()(typename channel_traits::const_reference ch, + const Scalar& s) const { + return ChannelR(ch)+ChannelR(s); + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for subtracting a scalar from a channel +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_minus_scalar_t : public std::binary_function { + ChannelR operator()(typename channel_traits::const_reference ch, + const Scalar& s) const { + return ChannelR(ch-s); + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for multiplying a scalar to one channel +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_multiplies_scalar_t : public std::binary_function { + ChannelR operator()(typename channel_traits::const_reference ch, + const Scalar& s) const { + return ChannelR(ch)*ChannelR(s); + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for dividing a channel by a scalar +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_divides_scalar_t : public std::binary_function { + ChannelR operator()(typename channel_traits::const_reference ch, + const Scalar& s) const { + return ChannelR(ch)/ChannelR(s); + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for halving a channel +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_halves_t : public std::unary_function { + typename channel_traits::reference + operator()(typename channel_traits::reference ch) const { + return ch/=2.0; + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for setting a channel to zero +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_zeros_t : public std::unary_function { + typename channel_traits::reference + operator()(typename channel_traits::reference ch) const { + return ch=Channel(0); + } +}; + +/// \ingroup ChannelNumericOperations +/// structure for assigning one channel to another +/// this is a generic implementation; user should specialize it for better performance +template +struct channel_assigns_t : public std::binary_function { + typename channel_traits::reference + operator()(typename channel_traits::const_reference ch1, + typename channel_traits::reference ch2) const { + return ch2=Channel2(ch1); + } +}; + +} } // namespace boost::gil + +#endif diff --git a/boost/gil/extension/numeric/convolve.hpp b/boost/gil/extension/numeric/convolve.hpp new file mode 100755 index 00000000..1e146afc --- /dev/null +++ b/boost/gil/extension/numeric/convolve.hpp @@ -0,0 +1,216 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt + or a copy at http://opensource.adobe.com/licenses.html) +*/ + +/*************************************************************************************************/ + +#ifndef GIL_CONVOLVE_HPP +#define GIL_CONVOLVE_HPP + +/*! +/// \file +/// \brief 2D seperable convolutions and correlations +/// +/// \author Hailin Jin and Lubomir Bourdev \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n Last updated on February 6, 2007 +*/ + + +#include +#include +#include +#include +#include +#include "../../gil_config.hpp" +#include "../../image_view_factory.hpp" +#include "../../algorithm.hpp" +#include "../../metafunctions.hpp" +#include "pixel_numeric_operations.hpp" +#include "algorithm.hpp" + +namespace boost { namespace gil { + +/// \ingroup ImageAlgorithms +/// Boundary options for 1D correlations/convolutions +enum convolve_boundary_option { + convolve_option_output_ignore, /// do nothing to the output + convolve_option_output_zero, /// set the output to zero + convolve_option_extend_padded, /// assume the source boundaries to be padded already + convolve_option_extend_zero, /// assume the source boundaries to be zero + convolve_option_extend_constant /// assume the source boundaries to be the boundary value +}; + +namespace detail { +/// compute the correlation of 1D kernel with the rows of an image +template +void correlate_rows_imp(const SrcView& src, const Kernel& ker, const DstView& dst, + convolve_boundary_option option, + Correlator correlator) { + assert(src.dimensions()==dst.dimensions()); + assert(ker.size()!=0); + + typedef typename pixel_proxy::type PIXEL_SRC_REF; + typedef typename pixel_proxy::type PIXEL_DST_REF; + typedef typename Kernel::value_type kernel_type; + + if(ker.size()==1) {//reduces to a multiplication + view_multiplies_scalar(src,*ker.begin(),dst); + return; + } + + int width=src.width(),height=src.height(); + PixelAccum acc_zero; pixel_zeros_t()(acc_zero); + if (width==0) return; + if (option==convolve_option_output_ignore || option==convolve_option_output_zero) { + typename DstView::value_type dst_zero; pixel_assigns_t()(acc_zero,dst_zero); + if (width<(int)ker.size()) { + if (option==convolve_option_output_zero) + fill_pixels(dst,dst_zero); + } else { + std::vector buffer(width); + for(int rr=0;rr buffer(width+ker.size()-1); + for(int rr=0;rr()(*src.row_begin(rr),filler); + std::fill_n(it_buffer,ker.left_size(),filler); + it_buffer+=ker.left_size(); + assign_pixels(src.row_begin(rr),src.row_end(rr),it_buffer); + it_buffer+=width; + pixel_assigns_t()(src.row_end(rr)[-1],filler); + std::fill_n(it_buffer,ker.right_size(),filler); + } + correlator(&buffer.front(),&buffer.front()+width, + ker.begin(), + dst.row_begin(rr)); + } + } +} +template +class correlator_n { +private: + std::size_t _size; +public: + correlator_n(std::size_t size_in) : _size(size_in) {} + template + void operator()(SrcIterator src_begin,SrcIterator src_end, + KernelIterator ker_begin, + DstIterator dst_begin) { + correlate_pixels_n(src_begin,src_end,ker_begin,_size,dst_begin); + } +}; +template +struct correlator_k { +public: + template + void operator()(SrcIterator src_begin,SrcIterator src_end, + KernelIterator ker_begin, + DstIterator dst_begin){ + correlate_pixels_k(src_begin,src_end,ker_begin,dst_begin); + } +}; +} // namespace detail + +/// \ingroup ImageAlgorithms +///correlate a 1D variable-size kernel along the rows of an image +template +GIL_FORCEINLINE +void correlate_rows(const SrcView& src, const Kernel& ker, const DstView& dst, + convolve_boundary_option option=convolve_option_extend_zero) { + detail::correlate_rows_imp(src,ker,dst,option,detail::correlator_n(ker.size())); +} + +/// \ingroup ImageAlgorithms +///correlate a 1D variable-size kernel along the columns of an image +template +GIL_FORCEINLINE +void correlate_cols(const SrcView& src, const Kernel& ker, const DstView& dst, + convolve_boundary_option option=convolve_option_extend_zero) { + correlate_rows(transposed_view(src),ker,transposed_view(dst),option); +} + +/// \ingroup ImageAlgorithms +///convolve a 1D variable-size kernel along the rows of an image +template +GIL_FORCEINLINE +void convolve_rows(const SrcView& src, const Kernel& ker, const DstView& dst, + convolve_boundary_option option=convolve_option_extend_zero) { + correlate_rows(src,reverse_kernel(ker),dst,option); +} + +/// \ingroup ImageAlgorithms +///convolve a 1D variable-size kernel along the columns of an image +template +GIL_FORCEINLINE +void convolve_cols(const SrcView& src, const Kernel& ker, const DstView& dst, + convolve_boundary_option option=convolve_option_extend_zero) { + convolve_rows(transposed_view(src),ker,transposed_view(dst),option); +} + +/// \ingroup ImageAlgorithms +///correlate a 1D fixed-size kernel along the rows of an image +template +GIL_FORCEINLINE +void correlate_rows_fixed(const SrcView& src, const Kernel& ker, const DstView& dst, + convolve_boundary_option option=convolve_option_extend_zero) { + detail::correlate_rows_imp(src,ker,dst,option,detail::correlator_k()); +} + +/// \ingroup ImageAlgorithms +///correlate a 1D fixed-size kernel along the columns of an image +template +GIL_FORCEINLINE +void correlate_cols_fixed(const SrcView& src, const Kernel& ker, const DstView& dst, + convolve_boundary_option option=convolve_option_extend_zero) { + correlate_rows_fixed(transposed_view(src),ker,transposed_view(dst),option); +} + +/// \ingroup ImageAlgorithms +///convolve a 1D fixed-size kernel along the rows of an image +template +GIL_FORCEINLINE +void convolve_rows_fixed(const SrcView& src, const Kernel& ker, const DstView& dst, + convolve_boundary_option option=convolve_option_extend_zero) { + correlate_rows_fixed(src,reverse_kernel(ker),dst,option); +} + +/// \ingroup ImageAlgorithms +///convolve a 1D fixed-size kernel along the columns of an image +template +GIL_FORCEINLINE +void convolve_cols_fixed(const SrcView& src, const Kernel& ker, const DstView& dst, + convolve_boundary_option option=convolve_option_extend_zero) { + convolve_rows_fixed(transposed_view(src),ker,transposed_view(dst),option); +} + +} } // namespace boost::gil + +#endif diff --git a/boost/gil/extension/numeric/kernel.hpp b/boost/gil/extension/numeric/kernel.hpp new file mode 100755 index 00000000..da7ebac1 --- /dev/null +++ b/boost/gil/extension/numeric/kernel.hpp @@ -0,0 +1,101 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt + or a copy at http://opensource.adobe.com/licenses.html) +*/ + +/*************************************************************************************************/ + +#ifndef GIL_KERNEL_HPP +#define GIL_KERNEL_HPP + +/*! +/// \file +/// \brief Definitions of 1D fixed-size and variable-size kernels and related operations +/// \author Hailin Jin and Lubomir Bourdev \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n Last updated on September 26, 2006 +*/ + +#include +#include +#include +#include +#include +#include +#include "../../gil_config.hpp" +#include "../../utilities.hpp" + +namespace boost { namespace gil { + +namespace detail { + +/// \brief kernel adaptor for one-dimensional cores +/// Core needs to provide size(),begin(),end(),operator[], +/// value_type,iterator,const_iterator,reference,const_reference +template +class kernel_1d_adaptor : public Core { +private: + std::size_t _center; +public: + kernel_1d_adaptor() : _center(0) {} + explicit kernel_1d_adaptor(std::size_t center_in) : _center(center_in) {assert(_centersize());} + kernel_1d_adaptor(std::size_t size_in,std::size_t center_in) : + Core(size_in), _center(center_in) {assert(_centersize());} + kernel_1d_adaptor(const kernel_1d_adaptor& k_in) : Core(k_in), _center(k_in._center) {} + + kernel_1d_adaptor& operator=(const kernel_1d_adaptor& k_in) { + Core::operator=(k_in); + _center=k_in._center; + return *this; + } + std::size_t left_size() const {assert(_centersize());return _center;} + std::size_t right_size() const {assert(_centersize());return this->size()-_center-1;} + std::size_t& center() {return _center;} + const std::size_t& center() const {return _center;} +}; + +} // namespace detail + +/// \brief variable-size kernel +template > +class kernel_1d : public detail::kernel_1d_adaptor > { + typedef detail::kernel_1d_adaptor > parent_t; +public: + kernel_1d() {} + kernel_1d(std::size_t size_in,std::size_t center_in) : parent_t(size_in,center_in) {} + template + kernel_1d(FwdIterator elements, std::size_t size_in, std::size_t center_in) : parent_t(size_in,center_in) { + detail::copy_n(elements,size_in,this->begin()); + } + kernel_1d(const kernel_1d& k_in) : parent_t(k_in) {} +}; + +/// \brief static-size kernel +template +class kernel_1d_fixed : public detail::kernel_1d_adaptor > { + typedef detail::kernel_1d_adaptor > parent_t; +public: + kernel_1d_fixed() {} + explicit kernel_1d_fixed(std::size_t center_in) : parent_t(center_in) {} + + template + explicit kernel_1d_fixed(FwdIterator elements, std::size_t center_in) : parent_t(center_in) { + detail::copy_n(elements,Size,this->begin()); + } + kernel_1d_fixed(const kernel_1d_fixed& k_in) : parent_t(k_in) {} +}; + +/// \brief reverse a kernel +template +inline Kernel reverse_kernel(const Kernel& kernel) { + Kernel result(kernel); + result.center()=kernel.right_size(); + std::reverse(result.begin(), result.end()); + return result; +} + + +} } // namespace boost::gil + +#endif diff --git a/boost/gil/extension/numeric/pixel_numeric_operations.hpp b/boost/gil/extension/numeric/pixel_numeric_operations.hpp new file mode 100755 index 00000000..1f6d8bcd --- /dev/null +++ b/boost/gil/extension/numeric/pixel_numeric_operations.hpp @@ -0,0 +1,144 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt + or a copy at http://opensource.adobe.com/licenses.html) +*/ + +/*************************************************************************************************/ + +#ifndef GIL_PIXEL_NUMERIC_OPERATIONS_HPP +#define GIL_PIXEL_NUMERIC_OPERATIONS_HPP + +/*! +/// \file +/// \brief Structures for pixel-wise numeric operations +/// \author Lubomir Bourdev and Hailin Jin \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n Last updated on February 6, 2007 +/// Currently defined structures: +/// pixel_plus_t (+), pixel_minus_t (-) +/// pixel_multiplies_scalar_t (*), pixel_divides_scalar_t (/) +/// pixel_halves_t (/=2), pixel_zeros_t (=0) +/// pixel_assigns_t (=) +*/ + +#include +#include "boost/gil/gil_config.hpp" +#include "boost/gil/pixel.hpp" +#include "boost/gil/color_base_algorithm.hpp" +#include "channel_numeric_operations.hpp" + +namespace boost { namespace gil { + +/// \ingroup PixelNumericOperations +/// \brief construct for adding two pixels +template // models pixel value concept +struct pixel_plus_t { + PixelR operator() (const PixelRef1& p1, + const PixelRef2& p2) const { + PixelR result; + static_transform(p1,p2,result, + channel_plus_t::type, + typename channel_type::type, + typename channel_type::type>()); + return result; + } +}; + +/// \ingroup PixelNumericOperations +/// \brief construct for subtracting two pixels +template // models pixel value concept +struct pixel_minus_t { + PixelR operator() (const PixelRef1& p1, + const PixelRef2& p2) const { + PixelR result; + static_transform(p1,p2,result, + channel_minus_t::type, + typename channel_type::type, + typename channel_type::type>()); + return result; + } +}; + +/// \ingroup PixelNumericOperations +/// \brief construct for multiplying scalar to a pixel +template // models pixel value concept +struct pixel_multiplies_scalar_t { + PixelR operator () (const PixelRef& p, + const Scalar& s) const { + PixelR result; + static_transform(p,result, + std::bind2nd(channel_multiplies_scalar_t::type, + Scalar, + typename channel_type::type>(),s)); + return result; + } +}; + +/// \ingroup PixelNumericOperations +/// \brief construct for dividing a pixel by a scalar +template // models pixel value concept +struct pixel_divides_scalar_t { + PixelR operator () (const PixelRef& p, + const Scalar& s) const { + PixelR result; + static_transform(p,result, + std::bind2nd(channel_divides_scalar_t::type, + Scalar, + typename channel_type::type>(),s)); + return result; + } +}; + +/// \ingroup PixelNumericOperations +/// \brief construct for dividing a pixel by 2 +template // models pixel concept +struct pixel_halves_t { + PixelRef& operator () (PixelRef& p) const { + static_for_each(p,channel_halves_t::type>()); + return p; + } +}; + +/// \ingroup PixelNumericOperations +/// \brief construct for setting a pixel to zero (for whatever zero means) +template // models pixel concept +struct pixel_zeros_t { + PixelRef& operator () (PixelRef& p) const { + static_for_each(p,channel_zeros_t::type>()); + return p; + } +}; + +// Hailin: This is how you can do it: +template +void zero_channels(Pixel& p) { + static_for_each(p,channel_zeros_t::type>()); +} + + +/// \ingroup PixelNumericOperations +///definition and a generic implementation for casting and assigning a pixel to another +///user should specialize it for better performance +template // models pixel concept +struct pixel_assigns_t { + PixelRefR operator () (const PixelRef& src, + PixelRefR& dst) const { + static_for_each(src,dst,channel_assigns_t::type, + typename channel_type::type>()); + return dst; + } +}; + +} } // namespace boost::gil + +#endif diff --git a/boost/gil/extension/numeric/resample.hpp b/boost/gil/extension/numeric/resample.hpp new file mode 100755 index 00000000..a42bc41e --- /dev/null +++ b/boost/gil/extension/numeric/resample.hpp @@ -0,0 +1,141 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt + or a copy at http://opensource.adobe.com/licenses.html) +*/ + +/*************************************************************************************************/ + +#ifndef GIL_RESAMPLE_HPP +#define GIL_RESAMPLE_HPP + +#include +#include +#include "boost/gil/extension/dynamic_image/dynamic_image_all.hpp" +#include "affine.hpp" + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief support for generic image resampling +/// NOTE: The code is for example use only. It is not optimized for performance +/// \author Lubomir Bourdev and Hailin Jin \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n October 30, 2006 +/// +//////////////////////////////////////////////////////////////////////////////////////// + +namespace boost { namespace gil { + +/////////////////////////////////////////////////////////////////////////// +//// +//// resample_pixels: set each pixel in the destination view as the result of a sampling function over the transformed coordinates of the source view +//// +/////////////////////////////////////////////////////////////////////////// + +template struct mapping_traits {}; + +/// \brief Set each pixel in the destination view as the result of a sampling function over the transformed coordinates of the source view +/// \ingroup ImageAlgorithms +/// +/// The provided implementation works for 2D image views only +template // Models MappingFunctionConcept +void resample_pixels(const SrcView& src_view, const DstView& dst_view, const MapFn& dst_to_src, Sampler sampler=Sampler()) { + typename DstView::point_t dst_dims=dst_view.dimensions(); + typename DstView::point_t dst_p; + typename mapping_traits::result_type src_p; + + for (dst_p.y=0; dst_p.y + struct resample_pixels_fn : public binary_operation_obj > { + MapFn _dst_to_src; + Sampler _sampler; + resample_pixels_fn(const MapFn& dst_to_src, const Sampler& sampler) : _dst_to_src(dst_to_src), _sampler(sampler) {} + + template GIL_FORCEINLINE void apply_compatible(const SrcView& src, const DstView& dst) const { + resample_pixels(src, dst, _dst_to_src, _sampler); + } + }; +} + +/// \brief resample_pixels when the source is run-time specified +/// If invoked on incompatible views, throws std::bad_cast() +/// \ingroup ImageAlgorithms +template +void resample_pixels(const any_image_view& src, const V2& dst, const MapFn& dst_to_src, Sampler sampler=Sampler()) { + apply_operation(src,bind(detail::resample_pixels_fn(dst_to_src,sampler), _1, dst)); +} + +/// \brief resample_pixels when the destination is run-time specified +/// If invoked on incompatible views, throws std::bad_cast() +/// \ingroup ImageAlgorithms +template +void resample_pixels(const V1& src, const any_image_view& dst, const MapFn& dst_to_src, Sampler sampler=Sampler()) { + apply_operation(dst,bind(detail::resample_pixels_fn(dst_to_src,sampler), src, _1)); +} + +/// \brief resample_pixels when both the source and the destination are run-time specified +/// If invoked on incompatible views, throws std::bad_cast() +/// \ingroup ImageAlgorithms +template +void resample_pixels(const any_image_view& src, const any_image_view& dst, const MapFn& dst_to_src, Sampler sampler=Sampler()) { + apply_operation(src,dst,detail::resample_pixels_fn(dst_to_src,sampler)); +} + +/////////////////////////////////////////////////////////////////////////// +//// +//// resample_subimage: copy into the destination a rotated rectangular region from the source, rescaling it to fit into the destination +//// +/////////////////////////////////////////////////////////////////////////// + +// Extract into dst the rotated bounds [src_min..src_max] rotated at 'angle' from the source view 'src' +// The source coordinates are in the coordinate space of the source image +// Note that the views could also be variants (i.e. any_image_view) +template +void resample_subimage(const SrcMetaView& src, const DstMetaView& dst, + double src_min_x, double src_min_y, + double src_max_x, double src_max_y, + double angle, const Sampler& sampler=Sampler()) { + double src_width = std::max(src_max_x - src_min_x - 1,1); + double src_height = std::max(src_max_y - src_min_y - 1,1); + double dst_width = std::max(dst.width()-1,1); + double dst_height = std::max(dst.height()-1,1); + + matrix3x2 mat = + matrix3x2::get_translate(-dst_width/2.0, -dst_height/2.0) * + matrix3x2::get_scale(src_width / dst_width, src_height / dst_height)* + matrix3x2::get_rotate(-angle)* + matrix3x2::get_translate(src_min_x + src_width/2.0, src_min_y + src_height/2.0); + resample_pixels(src,dst,mat,sampler); +} + +/////////////////////////////////////////////////////////////////////////// +//// +//// resize_view: Copy the source view into the destination, scaling to fit +//// +/////////////////////////////////////////////////////////////////////////// + +template +void resize_view(const SrcMetaView& src, const DstMetaView& dst, const Sampler& sampler=Sampler()) { + resample_subimage(src,dst,0,0,src.width(),src.height(),0,sampler); +} + +} } // namespace boost::gil + +#endif diff --git a/boost/gil/extension/numeric/sampler.hpp b/boost/gil/extension/numeric/sampler.hpp new file mode 100755 index 00000000..85f639ab --- /dev/null +++ b/boost/gil/extension/numeric/sampler.hpp @@ -0,0 +1,146 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt + or a copy at http://opensource.adobe.com/licenses.html) +*/ + +/*************************************************************************************************/ + +#ifndef GIL_SAMPLER_HPP +#define GIL_SAMPLER_HPP + +#include "boost/gil/extension/dynamic_image/dynamic_image_all.hpp" +#include "pixel_numeric_operations.hpp" + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief Nearest-neighbor and bilinear image samplers. +/// NOTE: The code is for example use only. It is not optimized for performance +/// \author Lubomir Bourdev and Hailin Jin \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n October 30, 2006 +/// +//////////////////////////////////////////////////////////////////////////////////////// + +namespace boost { namespace gil { + +/////////////////////////////////////////////////////////////////////////// +//// +//// resample_pixels: set each pixel in the destination view as the result of a sampling function over the transformed coordinates of the source view +//// +/////////////////////////////////////////////////////////////////////////// +/* +template +concept SamplerConcept { + template // Models PointNDConcept, where S_COORDS::num_dimensions == SrcView::num_dimensions + bool sample(const Sampler& s, const SrcView& src, const S_COORDS& p, DstP result); +}; +*/ + +/// \brief A sampler that sets the destination pixel to the closest one in the source. If outside the bounds, it doesn't change the destination +/// \ingroup ImageAlgorithms +struct nearest_neighbor_sampler {}; + +template +bool sample(nearest_neighbor_sampler, const SrcView& src, const point2& p, DstP& result) { + point2 center(iround(p)); + if (center.x>=0 && center.y>=0 && center.x + void operator()(const SrcChannel& src, DstChannel& dst) { + typedef typename channel_traits::value_type dst_value_t; + dst = dst_value_t(src); + } +}; + +template +void cast_pixel(const SrcPixel& src, DstPixel& dst) { + static_for_each(src,dst,cast_channel_fn()); +} + +namespace detail { + +template +struct add_dst_mul_src_channel { + Weight _w; + add_dst_mul_src_channel(Weight w) : _w(w) {} + + template + void operator()(const SrcChannel& src, DstChannel& dst) const { + dst += DstChannel(src*_w); + } +}; + +// dst += DST_TYPE(src * w) +template +struct add_dst_mul_src { + void operator()(const SrcP& src, Weight weight, DstP& dst) const { + static_for_each(src,dst, add_dst_mul_src_channel(weight)); +// pixel_assigns_t()( +// pixel_plus_t()( +// pixel_multiplies_scalar_t()(src,weight), +// dst), +// dst); + } +}; +} // namespace detail + +/// \brief A sampler that sets the destination pixel as the bilinear interpolation of the four closest pixels from the source. +/// If outside the bounds, it doesn't change the destination +/// \ingroup ImageAlgorithms +struct bilinear_sampler {}; + +template +bool sample(bilinear_sampler, const SrcView& src, const point2& p, DstP& result) { + typedef typename SrcView::value_type SrcP; + point2 p0(ifloor(p)); // the closest integer coordinate top left from p + point2 frac(p.x-p0.x, p.y-p0.y); + if (p0.x < 0 || p0.y < 0 || p0.x>=src.width() || p0.y>=src.height()) return false; + + pixel::value> > mp(0); // suboptimal + typename SrcView::xy_locator loc=src.xy_at(p0.x,p0.y); + + if (p0.x+1::value> > >()(*loc, (1-frac.x)*(1-frac.y),mp); + detail::add_dst_mul_src::value> > >()(loc.x()[1], frac.x *(1-frac.y),mp); + ++loc.y(); + detail::add_dst_mul_src::value> > >()(*loc, (1-frac.x)* frac.y ,mp); + detail::add_dst_mul_src::value> > >()(loc.x()[1], frac.x * frac.y ,mp); + } else { + // on the last row, but not the bottom-right corner pixel + detail::add_dst_mul_src::value> > >()(*loc, (1-frac.x),mp); + detail::add_dst_mul_src::value> > >()(loc.x()[1], frac.x ,mp); + } + } else { + if (p0.y+1::value> > >()(*loc, (1-frac.y),mp); + ++loc.y(); + detail::add_dst_mul_src::value> > >()(*loc, frac.y ,mp); + } else { + // the bottom-right corner pixel + detail::add_dst_mul_src::value> > >()(*loc,1,mp); + } + } + + // Convert from floating point average value to the source type + SrcP src_result; + cast_pixel(mp,src_result); + + color_convert(src_result, result); + return true; +} + +} } // namespace boost::gil + +#endif diff --git a/boost/gil/extension/toolbox/dynamic_images.hpp b/boost/gil/extension/toolbox/dynamic_images.hpp new file mode 100644 index 00000000..bed2540c --- /dev/null +++ b/boost/gil/extension/toolbox/dynamic_images.hpp @@ -0,0 +1,115 @@ +/* + Copyright 2005-2007 Adobe Systems Incorporated + + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). + + See http://opensource.adobe.com/gil for most recent version including documentation. +*/ +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP_INCLUDED +#define BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP_INCLUDED + +/// \file +/// \brief Generic io functions for dealing with dynamic images +// +/// \author Hailin Jin and Lubomir Bourdev \n +/// Adobe Systems Incorporated +/// \date 2005-2007 \n Last updated May 30, 2006 + +#include +#include +#include +#include +#include + +namespace boost { namespace gil { + +// need this for various meta functions. +struct any_image_pixel_t {}; +struct any_image_channel_t {}; +struct any_image_color_space_t {}; + +namespace detail { + +template +struct construct_matched_t { + template + static bool apply(any_image& im,Pred pred) { + if (pred.template apply::type>()) { + typename mpl::at_c::type x; + im.move_in(x); + return true; + } else return construct_matched_t::apply(im,pred); + } +}; +template <> +struct construct_matched_t<0> { + template + static bool apply(any_image&,Pred) {return false;} +}; + +// A function object that can be passed to apply_operation. +// Given a predicate IsSupported taking a view type and returning an MPL boolean, +// calls the apply method of OpClass with the view if the given view IsSupported, or throws an exception otherwise +template +class dynamic_io_fnobj { + OpClass* _op; + + template + void apply(const View& view,mpl::true_ ) {_op->apply(view);} + + template + void apply( const View& view + , const Info& info + , const mpl::true_ + ) + { + _op->apply( view, info ); + } + + template + void apply(const View& /* view */ ,mpl::false_) {io_error("dynamic_io: unsupported view type for the given file format");} + + template + void apply( const View& /* view */ + , const Info& /* info */ + , const mpl::false_ + ) + { + io_error( "dynamic_io: unsupported view type for the given file format" ); + } + +public: + dynamic_io_fnobj(OpClass* op) : _op(op) {} + + typedef void result_type; + + template + void operator()(const View& view) {apply(view,typename IsSupported::template apply::type());} + + template< typename View, typename Info > + void operator()(const View& view, const Info& info ) + { + apply( view + , info + , typename IsSupported::template apply< View >::type() + ); + } + +}; + +} // namespace detail + +/// \brief Within the any_image, constructs an image with the given dimensions +/// and a type that satisfies the given predicate +template +inline bool construct_matched(any_image& im,Pred pred) { + return detail::construct_matched_t::value>::apply(im,pred); +} + +} } // namespace boost::gil + +#endif // BOOST_GIL_EXTENSION_TOOLBOX_DYNAMIC_IMAGES_HPP_INCLUDED diff --git a/boost/gil/extension/toolbox/gil_extensions.hpp b/boost/gil/extension/toolbox/gil_extensions.hpp new file mode 100644 index 00000000..ff553caa --- /dev/null +++ b/boost/gil/extension/toolbox/gil_extensions.hpp @@ -0,0 +1,281 @@ +/* + Copyright 2010 Christian Henning, Andreas Pokorny, Lubomir Bourdev + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + +#ifndef BOOST_GIL_EXTENSION_TOOLBOX_GIL_EXTENSIONS_HPP_INCLUDED +#define BOOST_GIL_EXTENSION_TOOLBOX_GIL_EXTENSIONS_HPP_INCLUDED + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief Definitions of is_bit_aligned, is_homogeneous, and is_similar metafunctions and +/// some other goodies. +/// \author Christian Henning, Andreas Pokorny, Lubomir Bourdev \n +/// +/// \date 2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include + +namespace boost { namespace gil { + +/// is_bit_aligned metafunctions +/// \brief Determines whether the given type is bit_aligned. + +template< typename PixelRef > +struct is_bit_aligned : mpl::false_{}; + +template +struct is_bit_aligned > : mpl::true_{}; + +template +struct is_bit_aligned > : mpl::true_{}; + +template +struct is_bit_aligned > : mpl::true_{}; + +template +struct is_bit_aligned > : mpl::true_{}; + + +/// is_similar metafunctions +/// \brief Determines if two pixel types are similar. + +template< typename A, typename B > +struct is_similar : mpl::false_ {}; + +template +struct is_similar< A, A > : mpl::true_ {}; + +template +struct is_similar< packed_channel_reference< B, I, S, M > + , packed_channel_reference< B, I2, S, M > + > : mpl::true_ {}; + +/// is_homogeneous metafunctions +/// \brief Determines if a pixel types are homogeneous. + +template struct is_homogeneous_impl; + +template +struct is_homogeneous_impl : mpl::true_{}; + +template +struct is_homogeneous_impl : mpl::and_< is_homogeneous_impl< C, CMP,Next + 1, Last > + , is_same< CMP, typename mpl::at_c::type + > > {}; + +template < typename P > struct is_homogeneous : mpl::false_ {}; + +// pixel +template < typename C, typename L > struct is_homogeneous< pixel > : mpl::true_ {}; +template < typename C, typename L > struct is_homogeneous > : mpl::true_ {}; +template < typename C, typename L > struct is_homogeneous< pixel& > : mpl::true_ {}; +template < typename C, typename L > struct is_homogeneous& > : mpl::true_ {}; + +// planar pixel reference +template +struct is_homogeneous< planar_pixel_reference< Channel, ColorSpace > > : mpl::true_ {}; +template +struct is_homogeneous< const planar_pixel_reference< Channel, ColorSpace > > : mpl::true_ {}; + +template +struct is_homogeneous_impl_p {}; + +// for packed_pixel +template +struct is_homogeneous > + : is_homogeneous_impl_p< C + , typename mpl::at_c< C, 0 >::type + , 1 + , mpl::size< C >::type::value + > {}; + +template< typename B + , typename C + , typename L + > +struct is_homogeneous< const packed_pixel< B, C, L > > + : is_homogeneous_impl_p< C + , typename mpl::at_c::type + , 1 + , mpl::size< C >::type::value + > {}; + +// for bit_aligned_pixel_reference +template +struct is_homogeneous > + : is_homogeneous_impl::type,1,mpl::size::type::value> +{}; + +template +struct is_homogeneous > + : is_homogeneous_impl::type,1,mpl::size::type::value> +{}; + +////////////////////// +/// other goodies + +/// get_num_bits metafunctions +/// \brief Determines the numbers of bits for the given channel type. + +template +struct get_num_bits; + +template< typename B, int I, int S, bool M > +struct get_num_bits< packed_channel_reference< B, I, S, M > > +{ + BOOST_STATIC_CONSTANT( int, value = S ); +}; + +template +struct get_num_bits< const packed_channel_reference< B, I, S, M > > +{ + BOOST_STATIC_CONSTANT( int, value = S ); +}; + + +/// channel_type metafunction +/// \brief Generates the channel type for + + +template +struct gen_chan_ref +{ + typedef packed_dynamic_channel_reference< B + , mpl::at_c< C, 0 >::type::value + , M + > type; +}; + + +//! This implementation works for bit_algined_pixel_reference +//! with a homogeneous channel layout. +//! The result type will be a packed_dynamic_channel_reference, since the +//! offset info will be missing. + +// bit_aligned_pixel_reference +template +struct channel_type< bit_aligned_pixel_reference > + : lazy_enable_if< is_homogeneous< bit_aligned_pixel_reference< B, C, L, M > > + , gen_chan_ref< B, C, L, M > + > {}; + +template +struct channel_type > + : lazy_enable_if< is_homogeneous< bit_aligned_pixel_reference< B, C, L, M > > + , gen_chan_ref< B, C, L, M > + > {}; + +template +struct gen_chan_ref_p +{ + typedef packed_dynamic_channel_reference< B + , get_num_bits< typename mpl::at_c::type>::value + , true + > type; +}; + +// packed_pixel +template < typename BitField + , typename ChannelRefVec + , typename Layout + > +struct channel_type< packed_pixel< BitField + , ChannelRefVec + , Layout + > + > : lazy_enable_if< is_homogeneous< packed_pixel< BitField + , ChannelRefVec + , Layout + > + > + , gen_chan_ref_p< BitField + , ChannelRefVec + , Layout + > + > {}; + +template +struct channel_type< const packed_pixel< B, C, L > > + : lazy_enable_if< is_homogeneous > + , gen_chan_ref_p< B, C, L > + > +{}; + +template<> +struct channel_type< any_image_pixel_t > +{ + typedef any_image_channel_t type; +}; + +template<> +struct color_space_type< any_image_pixel_t > +{ + typedef any_image_color_space_t type; +}; + +/// get_pixel_type metafunction +/// \brief Depending on Image this function generates either +/// the pixel type or the reference type in case +/// the image is bit_aligned. +template< typename View > +struct get_pixel_type : mpl::if_< typename is_bit_aligned< typename View::value_type >::type + , typename View::reference + , typename View::value_type + > {}; + +template< typename ImageViewTypes > +struct get_pixel_type< any_image_view< ImageViewTypes > > +{ + typedef any_image_pixel_t type; +}; + +namespace detail { + +/// - performance specialization double +/// - to eliminate compiler warning 4244 +template +struct rgb_to_luminance_fn< double, double, double, GrayChannelValue > +{ + GrayChannelValue operator()( const double& red + , const double& green + , const double& blue ) const + { + return channel_convert( red * 0.30 + green * 0.59 + blue * 0.11 ); + } +}; + +} // namespace detail + +/// This one is missing in gil ( color_convert.hpp ). +template <> +struct default_color_converter_impl +{ + template + void operator()(const P1& src, P2& dst) const + { + get_color(dst,red_t()) = + channel_convert::type>(get_color(src,gray_color_t())); + get_color(dst,green_t())= + channel_convert::type>(get_color(src,gray_color_t())); + get_color(dst,blue_t()) = + channel_convert::type>(get_color(src,gray_color_t())); + + typedef typename channel_type< P2 >::type channel_t; + get_color(dst,alpha_t()) = channel_traits< channel_t >::max_value(); + } +}; + +} // namespace gil +} // namespace boost + +#endif // BOOST_GIL_EXTENSION_TOOLBOX_GIL_EXTENSIONS_HPP_INCLUDED diff --git a/boost/gil/extension/toolbox/gray_alpha.hpp b/boost/gil/extension/toolbox/gray_alpha.hpp new file mode 100644 index 00000000..651a2e69 --- /dev/null +++ b/boost/gil/extension/toolbox/gray_alpha.hpp @@ -0,0 +1,101 @@ +/* + Copyright 2007-2008 Andreas Pokorny + Use, modification and distribution are subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +*/ + +/*************************************************************************************************/ + + +#ifndef BOOST_GIL_GRAY_ALPHA_HPP_INCLUDED +#define BOOST_GIL_GRAY_ALPHA_HPP_INCLUDED + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief +/// \author Andreas Pokorny \n +/// +/// \date 2007-2008 \n +/// +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +namespace boost { namespace gil { + +typedef mpl::vector2 gray_alpha_t; + +typedef layout gray_alpha_layout_t; +typedef layout > alpha_gray_layout_t; + +GIL_DEFINE_BASE_TYPEDEFS(8, alpha_gray) +GIL_DEFINE_BASE_TYPEDEFS(8s, alpha_gray) +GIL_DEFINE_BASE_TYPEDEFS(16, alpha_gray) +GIL_DEFINE_BASE_TYPEDEFS(16s,alpha_gray) +GIL_DEFINE_BASE_TYPEDEFS(32 ,alpha_gray) +GIL_DEFINE_BASE_TYPEDEFS(32s,alpha_gray) +GIL_DEFINE_BASE_TYPEDEFS(32f,alpha_gray) + +GIL_DEFINE_ALL_TYPEDEFS(8, gray_alpha) +GIL_DEFINE_ALL_TYPEDEFS(8s, gray_alpha) +GIL_DEFINE_ALL_TYPEDEFS(16, gray_alpha) +GIL_DEFINE_ALL_TYPEDEFS(16s,gray_alpha) +GIL_DEFINE_ALL_TYPEDEFS(32 ,gray_alpha) +GIL_DEFINE_ALL_TYPEDEFS(32s,gray_alpha) +GIL_DEFINE_ALL_TYPEDEFS(32f,gray_alpha) + +/// \ingroup ColorConvert +/// \brief Gray Alpha to RGBA +template <> +struct default_color_converter_impl { + template + void operator()(const P1& src, P2& dst) const { + get_color(dst,red_t()) = + channel_convert::type>(get_color(src,gray_color_t())); + get_color(dst,green_t())= + channel_convert::type>(get_color(src,gray_color_t())); + get_color(dst,blue_t()) = + channel_convert::type>(get_color(src,gray_color_t())); + get_color(dst,alpha_t()) = + channel_convert::type>(get_color(src,alpha_t())); + } +}; + +template <> +struct default_color_converter_impl { + template + void operator()(const P1& src, P2& dst) const { + get_color(dst,red_t()) = + channel_convert::type>( + channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) + ); + get_color(dst,green_t()) = + channel_convert::type>( + channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) + ); + get_color(dst,blue_t()) = + channel_convert::type>( + channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) + ); + } +}; + +template <> +struct default_color_converter_impl { + template + void operator()(const P1& src, P2& dst) const { + get_color(dst,gray_color_t()) = + channel_convert::type>( + channel_multiply(get_color(src,gray_color_t()),get_color(src,alpha_t()) ) + ); + } +}; + +} // gil +} // boost + +#endif // BOOST_GIL_GRAY_ALPHA_HPP_INCLUDED diff --git a/boost/gil/extension/toolbox/hsl.hpp b/boost/gil/extension/toolbox/hsl.hpp new file mode 100644 index 00000000..92736dd3 --- /dev/null +++ b/boost/gil/extension/toolbox/hsl.hpp @@ -0,0 +1,262 @@ +// Copyright 2007 Christian Henning. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/*************************************************************************************************/ + +#ifndef GIL_HSL_H +#define GIL_HSL_H + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief Support for HSL color space +/// \author Christian Henning \n +//////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace boost { namespace gil { + +/// \addtogroup ColorNameModel +/// \{ +namespace hsl_color_space +{ +/// \brief Hue +struct hue_t {}; +/// \brief Saturation +struct saturation_t {}; +/// \brief Lightness +struct lightness_t {}; +} +/// \} + +/// \ingroup ColorSpaceModel +typedef mpl::vector3< hsl_color_space::hue_t + , hsl_color_space::saturation_t + , hsl_color_space::lightness_t + > hsl_t; + +/// \ingroup LayoutModel +typedef layout hsl_layout_t; + + +GIL_DEFINE_ALL_TYPEDEFS( 32f, hsl ); + +/// \ingroup ColorConvert +/// \brief RGB to HSL +template <> +struct default_color_converter_impl< rgb_t, hsl_t > +{ + template + void operator()( const P1& src, P2& dst ) const + { + using namespace hsl_color_space; + + // only bits32f for hsl is supported + bits32f temp_red = channel_convert( get_color( src, red_t() )); + bits32f temp_green = channel_convert( get_color( src, green_t() )); + bits32f temp_blue = channel_convert( get_color( src, blue_t() )); + + bits32f hue, saturation, lightness; + + bits32f min_color = (std::min)( temp_red, (std::min)( temp_green, temp_blue )); + bits32f max_color = (std::max)( temp_red, (std::max)( temp_green, temp_blue )); + + if( abs( min_color - max_color ) < 0.001 ) + { + // rgb color is gray + + hue = 0.f; + saturation = 0.f; + + // doesn't matter which rgb channel we use. + lightness = temp_red; + } + else + { + + bits32f diff = max_color - min_color; + + // lightness calculation + + lightness = ( min_color + max_color ) / 2.f; + + // saturation calculation + + if( lightness < 0.5f ) + { + saturation = diff + / ( min_color + max_color ); + } + else + { + saturation = ( max_color - min_color ) + / ( 2.f - diff ); + + } + + // hue calculation + if( abs( max_color - temp_red ) < 0.0001f ) + { + // max_color is red + hue = ( temp_green - temp_blue ) + / diff; + + } + else if( abs( max_color - temp_green) < 0.0001f ) + { + // max_color is green + // 2.0 + (b - r) / (maxColor - minColor); + hue = 2.f + + ( temp_blue - temp_red ) + / diff; + + } + else + { + // max_color is blue + hue = 4.f + + ( temp_red - temp_blue ) + / diff; + } + + hue /= 6.f; + + if( hue < 0.f ) + { + hue += 1.f; + } + } + + get_color( dst,hue_t() ) = hue; + get_color( dst,saturation_t() ) = saturation; + get_color( dst,lightness_t() ) = lightness; + } +}; + +/// \ingroup ColorConvert +/// \brief HSL to RGB +template <> +struct default_color_converter_impl +{ + template + void operator()( const P1& src, P2& dst) const + { + using namespace hsl_color_space; + + bits32f red, green, blue; + + if( abs( get_color( src, saturation_t() )) < 0.0001 ) + { + // If saturation is 0, the color is a shade of gray + red = get_color( src, lightness_t() ); + green = get_color( src, lightness_t() ); + blue = get_color( src, lightness_t() ); + } + else + { + float temp1, temp2; + float tempr, tempg, tempb; + + //Set the temporary values + if( get_color( src, lightness_t() ) < 0.5 ) + { + temp2 = get_color( src, lightness_t() ) + * ( 1.f + get_color( src, saturation_t() ) ); + } + else + { + temp2 = ( get_color( src, lightness_t() ) + get_color( src, saturation_t() )) + - ( get_color( src, lightness_t() ) * get_color( src, saturation_t() )); + } + + temp1 = 2.f + * get_color( src, lightness_t() ) + - temp2; + + tempr = get_color( src, hue_t() ) + 1.f / 3.f; + + if( tempr > 1.f ) + { + tempr--; + } + + tempg = get_color( src, hue_t() ); + tempb = get_color( src, hue_t() ) - 1.f / 3.f; + + if( tempb < 0.f ) + { + tempb++; + } + + //Red + if( tempr < 1.f / 6.f ) + { + red = temp1 + ( temp2 - temp1 ) * 6.f * tempr; + } + else if( tempr < 0.5f ) + { + red = temp2; + } + else if( tempr < 2.f / 3.f ) + { + red = temp1 + (temp2 - temp1) + * (( 2.f / 3.f ) - tempr) * 6.f; + } + else + { + red = temp1; + } + + //Green + if( tempg < 1.f / 6.f ) + { + green = temp1 + ( temp2 - temp1 ) * 6.f * tempg; + } + else if( tempg < 0.5f ) + { + green = temp2; + } + else if( tempg < 2.f / 3.f ) + { + green = temp1 + ( temp2 - temp1 ) + * (( 2.f / 3.f ) - tempg) * 6.f; + } + else + { + green = temp1; + } + + //Blue + if( tempb < 1.f / 6.f ) + { + blue = temp1 + (temp2 - temp1) * 6.f * tempb; + } + else if( tempb < 0.5f ) + { + blue = temp2; + } + else if( tempb < 2.f / 3.f ) + { + blue = temp1 + (temp2 - temp1) + * (( 2.f / 3.f ) - tempb) * 6.f; + } + else + { + blue = temp1; + } + } + + get_color(dst,red_t()) = + channel_convert::type>( red ); + get_color(dst,green_t())= + channel_convert::type>( green ); + get_color(dst,blue_t()) = + channel_convert::type>( blue ); + } +}; + +} } // namespace boost::gil + +#endif // GIL_HSL_H diff --git a/boost/gil/extension/toolbox/hsv.hpp b/boost/gil/extension/toolbox/hsv.hpp new file mode 100644 index 00000000..dc992feb --- /dev/null +++ b/boost/gil/extension/toolbox/hsv.hpp @@ -0,0 +1,231 @@ +// Copyright 2004 Christian Henning. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/*************************************************************************************************/ + +#ifndef GIL_HSV_H +#define GIL_HSV_H + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief Support for HSV color space +/// \author Christian Henning \n +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +namespace boost { namespace gil { + +/// \addtogroup ColorNameModel +/// \{ +namespace hsv_color_space +{ +/// \brief Hue +struct hue_t {}; +/// \brief Saturation +struct saturation_t{}; +/// \brief Value +struct value_t {}; +} +/// \} + +/// \ingroup ColorSpaceModel +typedef mpl::vector3< hsv_color_space::hue_t + , hsv_color_space::saturation_t + , hsv_color_space::value_t + > hsv_t; + +/// \ingroup LayoutModel +typedef layout hsv_layout_t; + + +GIL_DEFINE_ALL_TYPEDEFS( 32f, hsv ) + +/// \ingroup ColorConvert +/// \brief RGB to HSV +template <> +struct default_color_converter_impl< rgb_t, hsv_t > +{ + template + void operator()( const P1& src, P2& dst ) const + { + using namespace hsv_color_space; + + // only bits32f for hsv is supported + bits32f temp_red = channel_convert( get_color( src, red_t() )); + bits32f temp_green = channel_convert( get_color( src, green_t() )); + bits32f temp_blue = channel_convert( get_color( src, blue_t() )); + + bits32f hue, saturation, value; + + bits32f min_color = (std::min)( temp_red, (std::min)( temp_green, temp_blue )); + bits32f max_color = (std::max)( temp_red, (std::max)( temp_green, temp_blue )); + + value = max_color; + + bits32f diff = max_color - min_color; + + if( max_color < 0.0001f ) + { + saturation = 0.f; + } + else + { + saturation = diff / max_color; + } + + + if( saturation < 0.0001f ) + { + //it doesn't matter what value it has + hue = 0.f; + } + else + { + if( (std::abs)( boost::numeric_cast(temp_red - max_color) ) < 0.0001f ) + { + hue = ( temp_green - temp_blue ) + / diff; + } + else if( temp_green == max_color ) + { + hue = 2.f + ( temp_blue - temp_red ) + / diff; + } + else + { + hue = 4.f + ( temp_red - temp_green ) + / diff; + } + + //to bring it to a number between 0 and 1 + hue /= 6.f; + + if( hue < 0.f ) + { + hue++; + } + } + + get_color( dst, hue_t() ) = hue; + get_color( dst, saturation_t() ) = saturation; + get_color( dst, value_t() ) = value; + } +}; + +/// \ingroup ColorConvert +/// \brief HSV to RGB +template <> +struct default_color_converter_impl +{ + template + void operator()( const P1& src, P2& dst) const + { + using namespace hsv_color_space; + + bits32f red, green, blue; + + //If saturation is 0, the color is a shade of gray + if( abs( get_color( src, saturation_t() )) < 0.0001f ) + { + // If saturation is 0, the color is a shade of gray + red = get_color( src, value_t() ); + green = get_color( src, value_t() ); + blue = get_color( src, value_t() ); + } + else + { + bits32f frac, p, q, t, h; + bits32 i; + + //to bring hue to a number between 0 and 6, better for the calculations + h = get_color( src, hue_t() ); + h *= 6.f; + + i = static_cast( floor( h )); + + frac = h - i; + + p = get_color( src, value_t() ) + * ( 1.f - get_color( src, saturation_t() )); + + q = get_color( src, value_t() ) + * ( 1.f - ( get_color( src, saturation_t() ) * frac )); + + t = get_color( src, value_t() ) + * ( 1.f - ( get_color( src, saturation_t() ) * ( 1.f - frac ))); + + switch( i ) + { + case 0: + { + red = get_color( src, value_t() ); + green = t; + blue = p; + + break; + } + + case 1: + { + red = q; + green = get_color( src, value_t() ); + blue = p; + + break; + } + + case 2: + { + red = p; + green = get_color( src, value_t() ); + blue = t; + + break; + } + + case 3: + { + red = p; + green = q; + blue = get_color( src, value_t() ); + + break; + } + + case 4: + { + red = t; + green = p; + blue = get_color( src, value_t() ); + + break; + } + + case 5: + { + red = get_color( src, value_t() ); + green = p; + blue = q; + + break; + } + + } + } + + get_color(dst,red_t()) = + channel_convert::type>( red ); + get_color(dst,green_t())= + channel_convert::type>( green ); + get_color(dst,blue_t()) = + channel_convert::type>( blue ); + } +}; + +} } // namespace boost::gil + +#endif // GIL_HSV_H diff --git a/boost/gil/extension/toolbox/lab.hpp b/boost/gil/extension/toolbox/lab.hpp new file mode 100644 index 00000000..cc05960a --- /dev/null +++ b/boost/gil/extension/toolbox/lab.hpp @@ -0,0 +1,255 @@ +// Copyright 2008 Chung-Lin Wen. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/*************************************************************************************************/ + +#ifndef GIL_LAB_H +#define GIL_LAB_H + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief Support for CIE Lab color space +/// \author Chung-Lin Wen \n +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +namespace boost { namespace gil { + +/// \addtogroup ColorNameModel +/// \{ +namespace lab_color_space +{ +/// \brief Luminance +struct luminance_t {}; +/// \brief a Color Component +struct a_color_opponent_t {}; +/// \brief b Color Component +struct b_color_opponent_t {}; +} +/// \} + +/// \ingroup ColorSpaceModel +typedef mpl::vector3< lab_color_space::luminance_t + , lab_color_space::a_color_opponent_t + , lab_color_space::b_color_opponent_t + > lab_t; + +/// \ingroup LayoutModel +typedef layout lab_layout_t; + + +GIL_DEFINE_ALL_TYPEDEFS( 32f, lab ); + +/// \ingroup ColorConvert +/// \brief RGB to LAB +template <> +struct default_color_converter_impl< rgb_t, lab_t > +{ + template + void operator()( const P1& src, P2& dst ) const + { + using namespace lab_color_space; + + // only bits32f for lab is supported + bits32f temp_red = channel_convert( get_color( src, red_t() )); + bits32f temp_green = channel_convert( get_color( src, green_t() )); + bits32f temp_blue = channel_convert( get_color( src, blue_t() )); + + // first, transfer to xyz color space + bits32f normalized_r = temp_red / 255.f; + bits32f normalized_g = temp_green / 255.f; + bits32f normalized_b = temp_blue / 255.f; + + if( normalized_r > 0.04045f ) + { + normalized_r = pow( (( normalized_r + 0.055f ) / 1.055f ), 2.4f ); + } + else + { + normalized_r /= 12.92f; + } + + if( normalized_g > 0.04045f ) + { + normalized_g = pow((( normalized_g + 0.055f ) / 1.055f ), 2.4f ); + } + else + { + normalized_g /= 12.92f; + } + + if( normalized_b > 0.04045f ) + { + normalized_b = pow( (( normalized_b + 0.055f ) / 1.055f ), 2.4f ); + } + else + { + normalized_b /= 12.92f; + } + + normalized_r *= 100.f; + normalized_g *= 100.f; + normalized_b *= 100.f; + + bits32f x, y, z; + x = normalized_r * 0.4124f + normalized_g * 0.3576f + normalized_b * 0.1805f; + y = normalized_r * 0.2126f + normalized_g * 0.7152f + normalized_b * 0.0722f; + z = normalized_r * 0.0193f + normalized_g * 0.1192f + normalized_b * 0.9505f; + + // then, transfer to lab color space + bits32f ref_x = 95.047f; + bits32f ref_y = 100.000f; + bits32f ref_z = 108.883f; + bits32f normalized_x = x / ref_x; + bits32f normalized_y = y / ref_y; + bits32f normalized_z = z / ref_z; + + if( normalized_x > 0.008856f ) + { + normalized_x = pow( normalized_x, 0.333f ); + } + else + { + normalized_x = (7.787f * normalized_x) + ( 16.f/116.f ); + } + + if( normalized_y > 0.008856f ) + { + normalized_y = pow( normalized_y, 0.333f ); + } + else + { + normalized_y = (7.787f * normalized_y) + ( 16.f/116.f ); + } + + if( normalized_z > 0.008856f ) + { + normalized_z = pow( normalized_z, 0.333f ); + } + else + { + normalized_z = ( 7.787f * normalized_z ) + ( 16.f/116.f ); + } + + bits32f luminance, a_color_opponent, b_color_opponent; + luminance = ( 116.f * normalized_y ) - 16.f; + a_color_opponent = 500.f * ( normalized_x - normalized_y ); + b_color_opponent = 200.f * ( normalized_y - normalized_z ); + + get_color( dst, luminance_t() ) = luminance; + get_color( dst, a_color_opponent_t() ) = a_color_opponent; + get_color( dst, b_color_opponent_t() ) = b_color_opponent; + } +}; + +/// \ingroup ColorConvert +/// \brief LAB to RGB +template <> +struct default_color_converter_impl +{ + template + void operator()( const P1& src, P2& dst) const + { + using namespace lab_color_space; + + bits32f luminance = get_color( src, luminance_t() ); + bits32f a_color_opponent = get_color( src, a_color_opponent_t() ); + bits32f b_color_opponent = get_color( src, b_color_opponent_t() ); + + // first, transfer to xyz color space + bits32f normalized_y = ( luminance + 16.f ) / 116.f; + bits32f normalized_x = ( a_color_opponent / 500.f ) + normalized_y; + bits32f normalized_z = normalized_y - ( b_color_opponent / 200.f ); + + if( pow( normalized_y, 3.f ) > 0.008856f ) + { + normalized_y = pow( normalized_y, 3.f ); + } + else + { + normalized_y = ( normalized_y - 16.f / 116.f ) / 7.787f; + } + + if( pow( normalized_x, 3.f ) > 0.008856f ) + { + normalized_x = pow( normalized_x, 3.f ); + } + else + { + normalized_x = ( normalized_x - 16.f / 116.f ) / 7.787f; + } + + if( pow( normalized_z, 3.f ) > 0.008856f ) + { + normalized_z = pow( normalized_z, 3.f ); + } + else + { + normalized_z = ( normalized_z - 16.f / 116.f ) / 7.787f; + } + + bits32f reference_x = 95.047f; + bits32f reference_y = 100.000f; + bits32f reference_z = 108.883f; + bits32f x, y, z; + x = reference_x * normalized_x; + y = reference_y * normalized_y; + z = reference_z * normalized_z; + + // then, transfer to rgb color space + normalized_x = x / 100.f; + normalized_y = y / 100.f; + normalized_z = z / 100.f; + + bits32f result_r = normalized_x * 3.2406f + normalized_y * -1.5372f + normalized_z * -0.4986f; + bits32f result_g = normalized_x * -0.9689f + normalized_y * 1.8758f + normalized_z * 0.0415f; + bits32f result_b = normalized_x * 0.0557f + normalized_y * -0.2040f + normalized_z * 1.0570f; + + if( result_r > 0.0031308f ) + { + result_r = 1.055f * pow( result_r, 1.f/2.4f ) - 0.055f; + } + else + { + result_r = 12.92f * result_r; + } + + if( result_g > 0.0031308f ) + { + result_g = 1.055f * pow( result_g, 1.f/2.4f ) - 0.055f; + } + else + { + result_g = 12.92f * result_g; + } + + if( result_b > 0.0031308f ) + { + result_b = 1.055f * pow( result_b, 1.f/2.4f ) - 0.055f; + } + else + { + result_b = 12.92f * result_b; + } + + bits32f red, green, blue; + red = result_r * 255.f; + green = result_g * 255.f; + blue = result_b * 255.f; + + get_color(dst,red_t()) = + channel_convert::type>( red ); + get_color(dst,green_t())= + channel_convert::type>( green ); + get_color(dst,blue_t()) = + channel_convert::type>( blue ); + } +}; + +} } // namespace boost::gil + +#endif // GIL_LAB_H diff --git a/boost/gil/extension/toolbox/xyz.hpp b/boost/gil/extension/toolbox/xyz.hpp new file mode 100644 index 00000000..14e4fa42 --- /dev/null +++ b/boost/gil/extension/toolbox/xyz.hpp @@ -0,0 +1,173 @@ +// Copyright 2008 Chung-Lin Wen. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +/*************************************************************************************************/ + +#ifndef GIL_XYZ_H +#define GIL_XYZ_H + +//////////////////////////////////////////////////////////////////////////////////////// +/// \file +/// \brief Support for CIE XYZ color space +/// \author Chung-Lin Wen \n +//////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +namespace boost { namespace gil { + +/// \addtogroup ColorNameModel +/// \{ +namespace xyz_color_space +{ +/// \brief x Color Component +struct x_t {}; +/// \brief y Color Component +struct y_t {}; +/// \brief z Color Component +struct z_t {}; +} +/// \} + +/// \ingroup ColorSpaceModel +typedef mpl::vector3< xyz_color_space::x_t + , xyz_color_space::y_t + , xyz_color_space::z_t + > xyz_t; + +/// \ingroup LayoutModel +typedef layout xyz_layout_t; + + +GIL_DEFINE_ALL_TYPEDEFS( 32f, xyz ); + +/// \ingroup ColorConvert +/// \brief RGB to XYZ +template <> +struct default_color_converter_impl< rgb_t, xyz_t > +{ + template + void operator()( const P1& src, P2& dst ) const + { + using namespace xyz_color_space; + + // only bits32f for xyz is supported + bits32f temp_red = channel_convert( get_color( src, red_t() )); + bits32f temp_green = channel_convert( get_color( src, green_t() )); + bits32f temp_blue = channel_convert( get_color( src, blue_t() )); + + bits32f normalized_r = temp_red / 255.f; + bits32f normalized_g = temp_green / 255.f; + bits32f normalized_b = temp_blue / 255.f; + + if( normalized_r > 0.04045f ) + { + normalized_r = pow((( normalized_r + 0.055f ) / 1.055f ), 2.4f ); + } + else + { + normalized_r /= 12.92f; + } + + if( normalized_g > 0.04045f ) + { + normalized_g = pow((( normalized_g + 0.055f ) / 1.055f ), 2.4f ); + } + else + { + normalized_g /= 12.92f; + } + + if( normalized_b > 0.04045f ) + { + normalized_b = pow((( normalized_b + 0.055f ) / 1.055f ), 2.4f ); + } + else + { + normalized_b /= 12.92f; + } + + normalized_r *= 100.f; + normalized_g *= 100.f; + normalized_b *= 100.f; + + bits32f x, y, z; + x = normalized_r * 0.4124f + normalized_g * 0.3576f + normalized_b * 0.1805f; + y = normalized_r * 0.2126f + normalized_g * 0.7152f + normalized_b * 0.0722f; + z = normalized_r * 0.0193f + normalized_g * 0.1192f + normalized_b * 0.9505f; + + get_color( dst, x_t() ) = x; + get_color( dst, y_t() ) = y; + get_color( dst, z_t() ) = z; + } +}; + +/// \ingroup ColorConvert +/// \brief XYZ to RGB +template <> +struct default_color_converter_impl +{ + template + void operator()( const P1& src, P2& dst) const + { + using namespace xyz_color_space; + + bits32f x = get_color( src, x_t() ); + bits32f y = get_color( src, y_t() ); + bits32f z = get_color( src, z_t() ); + + bits32f normalized_x = x / 100.f; + bits32f normalized_y = y / 100.f; + bits32f normalized_z = z / 100.f; + + bits32f result_r = normalized_x * 3.2406f + normalized_y * -1.5372f + normalized_z * -0.4986f; + bits32f result_g = normalized_x * -0.9689f + normalized_y * 1.8758f + normalized_z * 0.0415f; + bits32f result_b = normalized_x * 0.0557f + normalized_y * -0.2040f + normalized_z * 1.0570f; + + if ( result_r > 0.0031308f ) + { + result_r = 1.055f * pow( result_r, 1.f/2.4f ) - 0.055f; + } + else + { + result_r = 12.92f * result_r; + } + + if ( result_g > 0.0031308f ) + { + result_g = 1.055f * pow( result_g, 1.f/2.4f ) - 0.055f; + } + else + { + result_g = 12.92f * result_g; + } + + if ( result_b > 0.0031308f ) + { + result_b = 1.055f * pow( result_b, 1.f/2.4f ) - 0.055f; + } + else + { + result_b = 12.92f * result_b; + } + + bits32f red, green, blue; + red = result_r * 255.f; + green = result_g * 255.f; + blue = result_b * 255.f; + + get_color(dst,red_t()) = + channel_convert::type>( red ); + get_color(dst,green_t())= + channel_convert::type>( green ); + get_color(dst,blue_t()) = + channel_convert::type>( blue ); + } +}; + +} } // namespace boost::gil + +#endif // GIL_XYZ_H diff --git a/configure.ac b/configure.ac index ac5df1f8..c2a6c1ea 100644 --- a/configure.ac +++ b/configure.ac @@ -8,10 +8,15 @@ AC_LANG_CPLUSPLUS # Checks for programs AC_PROG_CXX -AC_CHECK_HEADERS([Wt/WApplication], +AC_CHECK_HEADERS([Wt/WApplication jpeglib.h], [], [AC_MSG_ERROR([Header not found or unusable !])]) +AC_CHECK_LIB([jpeg], + [jpeg_destroy], + , + [AC_MSG_ERROR([libpthread not found!])]) + AC_CHECK_LIB([pthread], [pthread_create], , diff --git a/cover/CoverArt.cpp b/cover/CoverArt.cpp new file mode 100644 index 00000000..2fabb095 --- /dev/null +++ b/cover/CoverArt.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include + +#include "CoverArt.hpp" + +namespace CoverArt { + +bool +CoverArt::scale(std::size_t size) +{ + bool res = false; + try { + + boost::gil::rgb8_image_t source; + boost::gil::rgb8_image_t dest(size, size); + + // Read source + { + std::istringstream iss( std::string(_data.begin(), _data.end())); + boost::gil::read_image(iss, source, boost::gil::jpeg_tag()); + } + + // Resize + boost::gil::resize_view(boost::gil::const_view(source), + boost::gil::view(dest), + boost::gil::bilinear_sampler()); + + // Output to dest + { + std::ostringstream oss; + boost::gil::write_view(oss, boost::gil::const_view(dest), boost::gil::jpeg_tag()); + + std::string output = oss.str(); + _data.assign(output.begin(), output.end()); + } + + res = true; + } + catch(std::exception& e) + { + std::cerr << "Caught exception: " << e.what() << std::endl; + } + + return res; +} + +} // namespace CoverArt diff --git a/cover/CoverArt.hpp b/cover/CoverArt.hpp index 5e1cebfe..66afa4bb 100644 --- a/cover/CoverArt.hpp +++ b/cover/CoverArt.hpp @@ -23,6 +23,8 @@ class CoverArt void setMimeType(const std::string& mimeType) { _mimeType = mimeType;} void setData(const data_type& data) { _data = data; } + bool scale(std::size_t size); + private: std::string _mimeType; diff --git a/remote/server/AudioCollectionRequestHandler.cpp b/remote/server/AudioCollectionRequestHandler.cpp index e1220874..18d61122 100644 --- a/remote/server/AudioCollectionRequestHandler.cpp +++ b/remote/server/AudioCollectionRequestHandler.cpp @@ -251,8 +251,6 @@ AudioCollectionRequestHandler::processGetTracks(const AudioCollectionRequest::Ge BOOST_FOREACH(Genre::pointer genre, (*it)->getGenres()) track->add_genre_id( genre.id() ); -// if (!(*it)->getCoverArt().empty) -// track->set_coverart( (*it)->getCoverArt() ); } return true; @@ -278,10 +276,13 @@ AudioCollectionRequestHandler::processGetCoverArt(const AudioCollectionRequest:: std::vector coverArts = CoverArt::Grabber::getFromRelease(release); - BOOST_FOREACH(const CoverArt::CoverArt& coverArt, coverArts) + BOOST_FOREACH(CoverArt::CoverArt& coverArt, coverArts) { AudioCollectionResponse_CoverArt* cover_art = response.add_cover_art(); + if (request.has_size()) + coverArt.scale(request.size()); + cover_art->set_mime_type(coverArt.getMimeType()); cover_art->set_data( std::string( coverArt.getData().begin(), coverArt.getData().end()) ); } @@ -299,10 +300,21 @@ AudioCollectionRequestHandler::processGetCoverArt(const AudioCollectionRequest:: std::vector coverArts = CoverArt::Grabber::getFromTrack(track); - BOOST_FOREACH(const CoverArt::CoverArt& coverArt, coverArts) + BOOST_FOREACH(CoverArt::CoverArt& coverArt, coverArts) { AudioCollectionResponse_CoverArt* cover_art = response.add_cover_art(); + if (request.has_size()) + { + std::size_t size = request.size(); + if (size > _maxCoverArtSize || size == 0) + size = _maxCoverArtSize; + if (size < _minCoverArtSize) + size = _minCoverArtSize; + + coverArt.scale(size); + } + cover_art->set_mime_type(coverArt.getMimeType()); cover_art->set_data( std::string( coverArt.getData().begin(), coverArt.getData().end()) ); } diff --git a/remote/server/AudioCollectionRequestHandler.hpp b/remote/server/AudioCollectionRequestHandler.hpp index e27aa958..24f16b91 100644 --- a/remote/server/AudioCollectionRequestHandler.hpp +++ b/remote/server/AudioCollectionRequestHandler.hpp @@ -29,6 +29,9 @@ class AudioCollectionRequestHandler static const std::size_t _maxListGenres = 256; static const std::size_t _maxListReleases = 128; static const std::size_t _maxListTracks = 128; + + static const std::size_t _minCoverArtSize = 64; // in pixels, square + static const std::size_t _maxCoverArtSize = 512; // in pixels, square }; } // namespace Remote diff --git a/test/Makefile.am b/test/Makefile.am index 1e9bf68f..f0b37681 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -12,6 +12,7 @@ remote_SOURCES = \ $(top_srcdir)/av/FormatContext.cpp \ $(top_srcdir)/av/InputFormatContext.cpp \ $(top_srcdir)/av/Stream.cpp \ + $(top_srcdir)/cover/CoverArt.cpp \ $(top_srcdir)/cover/CoverArtGrabber.cpp \ $(top_srcdir)/remote/server/Server.cpp \ $(top_srcdir)/remote/server/RequestHandler.cpp \ @@ -38,7 +39,7 @@ remote_SOURCES = \ $(top_srcdir)/database/Video.cpp \ $(top_srcdir)/database/Checksum.cpp -remote_CXXFLAGS=-std=c++11 -Wall -Wextra -I$(top_srcdir) -I$(top_srcdir)/remote +remote_CXXFLAGS=-std=c++11 -Wall -Wextra -I$(top_srcdir) -I$(top_srcdir)/remote -I$(top_srcdir)/boost database_integrity_SOURCES = \ $(srcdir)/DatabaseIntegrity.cpp \ diff --git a/test/Makefile.in b/test/Makefile.in deleted file mode 100644 index 26be0635..00000000 --- a/test/Makefile.in +++ /dev/null @@ -1,1878 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -TESTS = database-integrity$(EXEEXT) sql-query$(EXEEXT) \ - database-basics$(EXEEXT) remote$(EXEEXT) -check_PROGRAMS = database-integrity$(EXEEXT) sql-query$(EXEEXT) \ - database-basics$(EXEEXT) remote$(EXEEXT) -subdir = test -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp $(top_srcdir)/test-driver -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am_database_basics_OBJECTS = \ - database_basics-CheckDatabaseBasics.$(OBJEXT) \ - database_basics-Artist.$(OBJEXT) \ - database_basics-Genre.$(OBJEXT) \ - database_basics-Release.$(OBJEXT) \ - database_basics-Track.$(OBJEXT) \ - database_basics-DatabaseHandler.$(OBJEXT) \ - database_basics-SqlQuery.$(OBJEXT) \ - database_basics-Path.$(OBJEXT) database_basics-Video.$(OBJEXT) \ - database_basics-Checksum.$(OBJEXT) -database_basics_OBJECTS = $(am_database_basics_OBJECTS) -database_basics_LDADD = $(LDADD) -database_basics_LINK = $(CXXLD) $(database_basics_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_database_integrity_OBJECTS = \ - database_integrity-DatabaseIntegrity.$(OBJEXT) \ - database_integrity-Artist.$(OBJEXT) \ - database_integrity-Genre.$(OBJEXT) \ - database_integrity-Release.$(OBJEXT) \ - database_integrity-Track.$(OBJEXT) \ - database_integrity-DatabaseHandler.$(OBJEXT) \ - database_integrity-SqlQuery.$(OBJEXT) \ - database_integrity-Path.$(OBJEXT) \ - database_integrity-Video.$(OBJEXT) \ - database_integrity-Checksum.$(OBJEXT) -database_integrity_OBJECTS = $(am_database_integrity_OBJECTS) -database_integrity_LDADD = $(LDADD) -database_integrity_LINK = $(CXXLD) $(database_integrity_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_remote_OBJECTS = remote-RemoteClientServer.$(OBJEXT) \ - remote-TestDatabase.$(OBJEXT) remote-CodecContext.$(OBJEXT) \ - remote-Common.$(OBJEXT) remote-Dictionary.$(OBJEXT) \ - remote-FormatContext.$(OBJEXT) \ - remote-InputFormatContext.$(OBJEXT) remote-Stream.$(OBJEXT) \ - remote-CoverArtGrabber.$(OBJEXT) remote-Server.$(OBJEXT) \ - remote-RequestHandler.$(OBJEXT) \ - remote-AudioCollectionRequestHandler.$(OBJEXT) \ - remote-MediaRequestHandler.$(OBJEXT) \ - remote-ConnectionManager.$(OBJEXT) remote-Connection.$(OBJEXT) \ - remote-auth.pb.$(OBJEXT) remote-collection.pb.$(OBJEXT) \ - remote-common.pb.$(OBJEXT) remote-media.pb.$(OBJEXT) \ - remote-messages.pb.$(OBJEXT) remote-AvConvTranscoder.$(OBJEXT) \ - remote-Format.$(OBJEXT) remote-Parameters.$(OBJEXT) \ - remote-InputMediaFile.$(OBJEXT) remote-Artist.$(OBJEXT) \ - remote-Genre.$(OBJEXT) remote-Release.$(OBJEXT) \ - remote-Track.$(OBJEXT) remote-DatabaseHandler.$(OBJEXT) \ - remote-SqlQuery.$(OBJEXT) remote-Path.$(OBJEXT) \ - remote-Video.$(OBJEXT) remote-Checksum.$(OBJEXT) -remote_OBJECTS = $(am_remote_OBJECTS) -remote_LDADD = $(LDADD) -remote_LINK = $(CXXLD) $(remote_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -am_sql_query_OBJECTS = sql_query-CheckSqlQuery.$(OBJEXT) \ - sql_query-SqlQuery.$(OBJEXT) -sql_query_OBJECTS = $(am_sql_query_OBJECTS) -sql_query_LDADD = $(LDADD) -sql_query_LINK = $(CXXLD) $(sql_query_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -AM_V_CXX = $(am__v_CXX_@AM_V@) -am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) -am__v_CXX_0 = @echo " CXX " $@; -am__v_CXX_1 = -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) -am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) -am__v_CXXLD_0 = @echo " CXXLD " $@; -am__v_CXXLD_1 = -SOURCES = $(database_basics_SOURCES) $(database_integrity_SOURCES) \ - $(remote_SOURCES) $(sql_query_SOURCES) -DIST_SOURCES = $(database_basics_SOURCES) \ - $(database_integrity_SOURCES) $(remote_SOURCES) \ - $(sql_query_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__tty_colors_dummy = \ - mgn= red= grn= lgn= blu= brg= std=; \ - am__color_tests=no -am__tty_colors = { \ - $(am__tty_colors_dummy); \ - if test "X$(AM_COLOR_TESTS)" = Xno; then \ - am__color_tests=no; \ - elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ - am__color_tests=yes; \ - elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ - am__color_tests=yes; \ - fi; \ - if test $$am__color_tests = yes; then \ - red=''; \ - grn=''; \ - lgn=''; \ - blu=''; \ - mgn=''; \ - brg=''; \ - std=''; \ - fi; \ -} -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__recheck_rx = ^[ ]*:recheck:[ ]* -am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* -am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* -# A command that, given a newline-separated list of test names on the -# standard input, print the name of the tests that are to be re-run -# upon "make recheck". -am__list_recheck_tests = $(AWK) '{ \ - recheck = 1; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - { \ - if ((getline line2 < ($$0 ".log")) < 0) \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ - { \ - recheck = 0; \ - break; \ - } \ - else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ - { \ - break; \ - } \ - }; \ - if (recheck) \ - print $$0; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# A command that, given a newline-separated list of test names on the -# standard input, create the global log from their .trs and .log files. -am__create_global_log = $(AWK) ' \ -function fatal(msg) \ -{ \ - print "fatal: making $@: " msg | "cat >&2"; \ - exit 1; \ -} \ -function rst_section(header) \ -{ \ - print header; \ - len = length(header); \ - for (i = 1; i <= len; i = i + 1) \ - printf "="; \ - printf "\n\n"; \ -} \ -{ \ - copy_in_global_log = 1; \ - global_test_result = "RUN"; \ - while ((rc = (getline line < ($$0 ".trs"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".trs"); \ - if (line ~ /$(am__global_test_result_rx)/) \ - { \ - sub("$(am__global_test_result_rx)", "", line); \ - sub("[ ]*$$", "", line); \ - global_test_result = line; \ - } \ - else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ - copy_in_global_log = 0; \ - }; \ - if (copy_in_global_log) \ - { \ - rst_section(global_test_result ": " $$0); \ - while ((rc = (getline line < ($$0 ".log"))) != 0) \ - { \ - if (rc < 0) \ - fatal("failed to read from " $$0 ".log"); \ - print line; \ - }; \ - printf "\n"; \ - }; \ - close ($$0 ".trs"); \ - close ($$0 ".log"); \ -}' -# Restructured Text title. -am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } -# Solaris 10 'make', and several other traditional 'make' implementations, -# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it -# by disabling -e (using the XSI extension "set +e") if it's set. -am__sh_e_setup = case $$- in *e*) set +e;; esac -# Default flags passed to test drivers. -am__common_driver_flags = \ - --color-tests "$$am__color_tests" \ - --enable-hard-errors "$$am__enable_hard_errors" \ - --expect-failure "$$am__expect_failure" -# To be inserted before the command running the test. Creates the -# directory for the log if needed. Stores in $dir the directory -# containing $f, in $tst the test, in $log the log. Executes the -# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and -# passes TESTS_ENVIRONMENT. Set up options for the wrapper that -# will run the test scripts (or their associated LOG_COMPILER, if -# thy have one). -am__check_pre = \ -$(am__sh_e_setup); \ -$(am__vpath_adj_setup) $(am__vpath_adj) \ -$(am__tty_colors); \ -srcdir=$(srcdir); export srcdir; \ -case "$@" in \ - */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ - *) am__odir=.;; \ -esac; \ -test "x$$am__odir" = x"." || test -d "$$am__odir" \ - || $(MKDIR_P) "$$am__odir" || exit $$?; \ -if test -f "./$$f"; then dir=./; \ -elif test -f "$$f"; then dir=; \ -else dir="$(srcdir)/"; fi; \ -tst=$$dir$$f; log='$@'; \ -if test -n '$(DISABLE_HARD_ERRORS)'; then \ - am__enable_hard_errors=no; \ -else \ - am__enable_hard_errors=yes; \ -fi; \ -case " $(XFAIL_TESTS) " in \ - *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ - am__expect_failure=yes;; \ - *) \ - am__expect_failure=no;; \ -esac; \ -$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) -# A shell command to get the names of the tests scripts with any registered -# extension removed (i.e., equivalently, the names of the test logs, with -# the '.log' extension removed). The result is saved in the shell variable -# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, -# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", -# since that might cause problem with VPATH rewrites for suffix-less tests. -# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. -am__set_TESTS_bases = \ - bases='$(TEST_LOGS)'; \ - bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ - bases=`echo $$bases` -RECHECK_LOGS = $(TEST_LOGS) -AM_RECURSIVE_TARGETS = check recheck -TEST_SUITE_LOG = test-suite.log -TEST_EXTENSIONS = @EXEEXT@ .test -LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver -LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) -am__set_b = \ - case '$@' in \ - */*) \ - case '$*' in \ - */*) b='$*';; \ - *) b=`echo '$@' | sed 's/\.log$$//'`; \ - esac;; \ - *) \ - b='$*';; \ - esac -am__test_logs1 = $(TESTS:=.log) -am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) -TEST_LOGS = $(am__test_logs2:.test.log=.log) -TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver -TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ - $(TEST_LOG_FLAGS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CXX = @ac_ct_CXX@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -remote_SOURCES = \ - $(srcdir)/RemoteClientServer.cpp \ - $(srcdir)/TestDatabase.cpp \ - $(top_srcdir)/av/CodecContext.cpp \ - $(top_srcdir)/av/Common.cpp \ - $(top_srcdir)/av/Dictionary.cpp \ - $(top_srcdir)/av/FormatContext.cpp \ - $(top_srcdir)/av/InputFormatContext.cpp \ - $(top_srcdir)/av/Stream.cpp \ - $(top_srcdir)/cover/CoverArtGrabber.cpp \ - $(top_srcdir)/remote/server/Server.cpp \ - $(top_srcdir)/remote/server/RequestHandler.cpp \ - $(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp \ - $(top_srcdir)/remote/server/MediaRequestHandler.cpp \ - $(top_srcdir)/remote/server/ConnectionManager.cpp \ - $(top_srcdir)/remote/server/Connection.cpp \ - $(top_srcdir)/remote/messages/auth.pb.cc \ - $(top_srcdir)/remote/messages/collection.pb.cc \ - $(top_srcdir)/remote/messages/common.pb.cc \ - $(top_srcdir)/remote/messages/media.pb.cc \ - $(top_srcdir)/remote/messages/messages.pb.cc \ - $(top_srcdir)/transcode/AvConvTranscoder.cpp \ - $(top_srcdir)/transcode/Format.cpp \ - $(top_srcdir)/transcode/Parameters.cpp \ - $(top_srcdir)/transcode/InputMediaFile.cpp \ - $(top_srcdir)/database/Artist.cpp \ - $(top_srcdir)/database/Genre.cpp \ - $(top_srcdir)/database/Release.cpp \ - $(top_srcdir)/database/Track.cpp \ - $(top_srcdir)/database/DatabaseHandler.cpp \ - $(top_srcdir)/database/SqlQuery.cpp \ - $(top_srcdir)/database/Path.cpp \ - $(top_srcdir)/database/Video.cpp \ - $(top_srcdir)/database/Checksum.cpp - -remote_CXXFLAGS = -std=c++11 -Wall -Wextra -I$(top_srcdir) -I$(top_srcdir)/remote -database_integrity_SOURCES = \ - $(srcdir)/DatabaseIntegrity.cpp \ - $(top_srcdir)/database/Artist.cpp \ - $(top_srcdir)/database/Genre.cpp \ - $(top_srcdir)/database/Release.cpp \ - $(top_srcdir)/database/Track.cpp \ - $(top_srcdir)/database/DatabaseHandler.cpp \ - $(top_srcdir)/database/SqlQuery.cpp \ - $(top_srcdir)/database/Path.cpp \ - $(top_srcdir)/database/Video.cpp \ - $(top_srcdir)/database/Checksum.cpp - -database_integrity_CXXFLAGS = -std=c++11 -Wall -Wextra -I$(top_srcdir) -database_basics_SOURCES = \ - $(srcdir)/CheckDatabaseBasics.cpp \ - $(top_srcdir)/database/Artist.cpp \ - $(top_srcdir)/database/Genre.cpp \ - $(top_srcdir)/database/Release.cpp \ - $(top_srcdir)/database/Track.cpp \ - $(top_srcdir)/database/DatabaseHandler.cpp \ - $(top_srcdir)/database/SqlQuery.cpp \ - $(top_srcdir)/database/Path.cpp \ - $(top_srcdir)/database/Video.cpp \ - $(top_srcdir)/database/Checksum.cpp - -database_basics_CXXFLAGS = -std=c++11 -Wall -Wextra -I$(top_srcdir) -sql_query_SOURCES = \ - $(srcdir)/CheckSqlQuery.cpp \ - $(top_srcdir)/database/SqlQuery.cpp - -sql_query_CXXFLAGS = -std=c++11 -Wall -Wextra -I$(top_srcdir) -all: all-am - -.SUFFIXES: -.SUFFIXES: .cc .cpp .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-checkPROGRAMS: - -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) - -database-basics$(EXEEXT): $(database_basics_OBJECTS) $(database_basics_DEPENDENCIES) $(EXTRA_database_basics_DEPENDENCIES) - @rm -f database-basics$(EXEEXT) - $(AM_V_CXXLD)$(database_basics_LINK) $(database_basics_OBJECTS) $(database_basics_LDADD) $(LIBS) - -database-integrity$(EXEEXT): $(database_integrity_OBJECTS) $(database_integrity_DEPENDENCIES) $(EXTRA_database_integrity_DEPENDENCIES) - @rm -f database-integrity$(EXEEXT) - $(AM_V_CXXLD)$(database_integrity_LINK) $(database_integrity_OBJECTS) $(database_integrity_LDADD) $(LIBS) - -remote$(EXEEXT): $(remote_OBJECTS) $(remote_DEPENDENCIES) $(EXTRA_remote_DEPENDENCIES) - @rm -f remote$(EXEEXT) - $(AM_V_CXXLD)$(remote_LINK) $(remote_OBJECTS) $(remote_LDADD) $(LIBS) - -sql-query$(EXEEXT): $(sql_query_OBJECTS) $(sql_query_DEPENDENCIES) $(EXTRA_sql_query_DEPENDENCIES) - @rm -f sql-query$(EXEEXT) - $(AM_V_CXXLD)$(sql_query_LINK) $(sql_query_OBJECTS) $(sql_query_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-Artist.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-CheckDatabaseBasics.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-Checksum.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-DatabaseHandler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-Genre.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-Path.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-Release.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-SqlQuery.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-Track.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_basics-Video.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-Artist.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-Checksum.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-DatabaseHandler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-DatabaseIntegrity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-Genre.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-Path.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-Release.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-SqlQuery.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-Track.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-Video.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Artist.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-AudioCollectionRequestHandler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-AvConvTranscoder.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Checksum.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-CodecContext.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Common.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Connection.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-ConnectionManager.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-CoverArtGrabber.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-DatabaseHandler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Dictionary.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Format.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-FormatContext.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Genre.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-InputFormatContext.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-InputMediaFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-MediaRequestHandler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Parameters.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Path.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Release.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-RemoteClientServer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-RequestHandler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Server.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-SqlQuery.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Stream.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-TestDatabase.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Track.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Video.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-auth.pb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-collection.pb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-common.pb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-media.pb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-messages.pb.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sql_query-CheckSqlQuery.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sql_query-SqlQuery.Po@am__quote@ - -.cc.o: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< - -.cc.obj: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -database_basics-CheckDatabaseBasics.o: $(srcdir)/CheckDatabaseBasics.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-CheckDatabaseBasics.o -MD -MP -MF $(DEPDIR)/database_basics-CheckDatabaseBasics.Tpo -c -o database_basics-CheckDatabaseBasics.o `test -f '$(srcdir)/CheckDatabaseBasics.cpp' || echo '$(srcdir)/'`$(srcdir)/CheckDatabaseBasics.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-CheckDatabaseBasics.Tpo $(DEPDIR)/database_basics-CheckDatabaseBasics.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/CheckDatabaseBasics.cpp' object='database_basics-CheckDatabaseBasics.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-CheckDatabaseBasics.o `test -f '$(srcdir)/CheckDatabaseBasics.cpp' || echo '$(srcdir)/'`$(srcdir)/CheckDatabaseBasics.cpp - -database_basics-CheckDatabaseBasics.obj: $(srcdir)/CheckDatabaseBasics.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-CheckDatabaseBasics.obj -MD -MP -MF $(DEPDIR)/database_basics-CheckDatabaseBasics.Tpo -c -o database_basics-CheckDatabaseBasics.obj `if test -f '$(srcdir)/CheckDatabaseBasics.cpp'; then $(CYGPATH_W) '$(srcdir)/CheckDatabaseBasics.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/CheckDatabaseBasics.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-CheckDatabaseBasics.Tpo $(DEPDIR)/database_basics-CheckDatabaseBasics.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/CheckDatabaseBasics.cpp' object='database_basics-CheckDatabaseBasics.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-CheckDatabaseBasics.obj `if test -f '$(srcdir)/CheckDatabaseBasics.cpp'; then $(CYGPATH_W) '$(srcdir)/CheckDatabaseBasics.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/CheckDatabaseBasics.cpp'; fi` - -database_basics-Artist.o: $(top_srcdir)/database/Artist.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Artist.o -MD -MP -MF $(DEPDIR)/database_basics-Artist.Tpo -c -o database_basics-Artist.o `test -f '$(top_srcdir)/database/Artist.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Artist.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Artist.Tpo $(DEPDIR)/database_basics-Artist.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Artist.cpp' object='database_basics-Artist.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Artist.o `test -f '$(top_srcdir)/database/Artist.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Artist.cpp - -database_basics-Artist.obj: $(top_srcdir)/database/Artist.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Artist.obj -MD -MP -MF $(DEPDIR)/database_basics-Artist.Tpo -c -o database_basics-Artist.obj `if test -f '$(top_srcdir)/database/Artist.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Artist.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Artist.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Artist.Tpo $(DEPDIR)/database_basics-Artist.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Artist.cpp' object='database_basics-Artist.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Artist.obj `if test -f '$(top_srcdir)/database/Artist.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Artist.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Artist.cpp'; fi` - -database_basics-Genre.o: $(top_srcdir)/database/Genre.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Genre.o -MD -MP -MF $(DEPDIR)/database_basics-Genre.Tpo -c -o database_basics-Genre.o `test -f '$(top_srcdir)/database/Genre.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Genre.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Genre.Tpo $(DEPDIR)/database_basics-Genre.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Genre.cpp' object='database_basics-Genre.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Genre.o `test -f '$(top_srcdir)/database/Genre.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Genre.cpp - -database_basics-Genre.obj: $(top_srcdir)/database/Genre.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Genre.obj -MD -MP -MF $(DEPDIR)/database_basics-Genre.Tpo -c -o database_basics-Genre.obj `if test -f '$(top_srcdir)/database/Genre.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Genre.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Genre.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Genre.Tpo $(DEPDIR)/database_basics-Genre.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Genre.cpp' object='database_basics-Genre.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Genre.obj `if test -f '$(top_srcdir)/database/Genre.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Genre.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Genre.cpp'; fi` - -database_basics-Release.o: $(top_srcdir)/database/Release.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Release.o -MD -MP -MF $(DEPDIR)/database_basics-Release.Tpo -c -o database_basics-Release.o `test -f '$(top_srcdir)/database/Release.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Release.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Release.Tpo $(DEPDIR)/database_basics-Release.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Release.cpp' object='database_basics-Release.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Release.o `test -f '$(top_srcdir)/database/Release.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Release.cpp - -database_basics-Release.obj: $(top_srcdir)/database/Release.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Release.obj -MD -MP -MF $(DEPDIR)/database_basics-Release.Tpo -c -o database_basics-Release.obj `if test -f '$(top_srcdir)/database/Release.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Release.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Release.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Release.Tpo $(DEPDIR)/database_basics-Release.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Release.cpp' object='database_basics-Release.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Release.obj `if test -f '$(top_srcdir)/database/Release.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Release.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Release.cpp'; fi` - -database_basics-Track.o: $(top_srcdir)/database/Track.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Track.o -MD -MP -MF $(DEPDIR)/database_basics-Track.Tpo -c -o database_basics-Track.o `test -f '$(top_srcdir)/database/Track.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Track.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Track.Tpo $(DEPDIR)/database_basics-Track.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Track.cpp' object='database_basics-Track.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Track.o `test -f '$(top_srcdir)/database/Track.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Track.cpp - -database_basics-Track.obj: $(top_srcdir)/database/Track.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Track.obj -MD -MP -MF $(DEPDIR)/database_basics-Track.Tpo -c -o database_basics-Track.obj `if test -f '$(top_srcdir)/database/Track.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Track.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Track.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Track.Tpo $(DEPDIR)/database_basics-Track.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Track.cpp' object='database_basics-Track.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Track.obj `if test -f '$(top_srcdir)/database/Track.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Track.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Track.cpp'; fi` - -database_basics-DatabaseHandler.o: $(top_srcdir)/database/DatabaseHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-DatabaseHandler.o -MD -MP -MF $(DEPDIR)/database_basics-DatabaseHandler.Tpo -c -o database_basics-DatabaseHandler.o `test -f '$(top_srcdir)/database/DatabaseHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/DatabaseHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-DatabaseHandler.Tpo $(DEPDIR)/database_basics-DatabaseHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/DatabaseHandler.cpp' object='database_basics-DatabaseHandler.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-DatabaseHandler.o `test -f '$(top_srcdir)/database/DatabaseHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/DatabaseHandler.cpp - -database_basics-DatabaseHandler.obj: $(top_srcdir)/database/DatabaseHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-DatabaseHandler.obj -MD -MP -MF $(DEPDIR)/database_basics-DatabaseHandler.Tpo -c -o database_basics-DatabaseHandler.obj `if test -f '$(top_srcdir)/database/DatabaseHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/DatabaseHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/DatabaseHandler.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-DatabaseHandler.Tpo $(DEPDIR)/database_basics-DatabaseHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/DatabaseHandler.cpp' object='database_basics-DatabaseHandler.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-DatabaseHandler.obj `if test -f '$(top_srcdir)/database/DatabaseHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/DatabaseHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/DatabaseHandler.cpp'; fi` - -database_basics-SqlQuery.o: $(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-SqlQuery.o -MD -MP -MF $(DEPDIR)/database_basics-SqlQuery.Tpo -c -o database_basics-SqlQuery.o `test -f '$(top_srcdir)/database/SqlQuery.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-SqlQuery.Tpo $(DEPDIR)/database_basics-SqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/SqlQuery.cpp' object='database_basics-SqlQuery.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-SqlQuery.o `test -f '$(top_srcdir)/database/SqlQuery.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/SqlQuery.cpp - -database_basics-SqlQuery.obj: $(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-SqlQuery.obj -MD -MP -MF $(DEPDIR)/database_basics-SqlQuery.Tpo -c -o database_basics-SqlQuery.obj `if test -f '$(top_srcdir)/database/SqlQuery.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/SqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/SqlQuery.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-SqlQuery.Tpo $(DEPDIR)/database_basics-SqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/SqlQuery.cpp' object='database_basics-SqlQuery.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-SqlQuery.obj `if test -f '$(top_srcdir)/database/SqlQuery.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/SqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/SqlQuery.cpp'; fi` - -database_basics-Path.o: $(top_srcdir)/database/Path.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Path.o -MD -MP -MF $(DEPDIR)/database_basics-Path.Tpo -c -o database_basics-Path.o `test -f '$(top_srcdir)/database/Path.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Path.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Path.Tpo $(DEPDIR)/database_basics-Path.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Path.cpp' object='database_basics-Path.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Path.o `test -f '$(top_srcdir)/database/Path.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Path.cpp - -database_basics-Path.obj: $(top_srcdir)/database/Path.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Path.obj -MD -MP -MF $(DEPDIR)/database_basics-Path.Tpo -c -o database_basics-Path.obj `if test -f '$(top_srcdir)/database/Path.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Path.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Path.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Path.Tpo $(DEPDIR)/database_basics-Path.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Path.cpp' object='database_basics-Path.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Path.obj `if test -f '$(top_srcdir)/database/Path.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Path.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Path.cpp'; fi` - -database_basics-Video.o: $(top_srcdir)/database/Video.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Video.o -MD -MP -MF $(DEPDIR)/database_basics-Video.Tpo -c -o database_basics-Video.o `test -f '$(top_srcdir)/database/Video.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Video.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Video.Tpo $(DEPDIR)/database_basics-Video.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Video.cpp' object='database_basics-Video.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Video.o `test -f '$(top_srcdir)/database/Video.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Video.cpp - -database_basics-Video.obj: $(top_srcdir)/database/Video.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Video.obj -MD -MP -MF $(DEPDIR)/database_basics-Video.Tpo -c -o database_basics-Video.obj `if test -f '$(top_srcdir)/database/Video.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Video.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Video.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Video.Tpo $(DEPDIR)/database_basics-Video.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Video.cpp' object='database_basics-Video.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Video.obj `if test -f '$(top_srcdir)/database/Video.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Video.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Video.cpp'; fi` - -database_basics-Checksum.o: $(top_srcdir)/database/Checksum.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Checksum.o -MD -MP -MF $(DEPDIR)/database_basics-Checksum.Tpo -c -o database_basics-Checksum.o `test -f '$(top_srcdir)/database/Checksum.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Checksum.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Checksum.Tpo $(DEPDIR)/database_basics-Checksum.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Checksum.cpp' object='database_basics-Checksum.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Checksum.o `test -f '$(top_srcdir)/database/Checksum.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Checksum.cpp - -database_basics-Checksum.obj: $(top_srcdir)/database/Checksum.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -MT database_basics-Checksum.obj -MD -MP -MF $(DEPDIR)/database_basics-Checksum.Tpo -c -o database_basics-Checksum.obj `if test -f '$(top_srcdir)/database/Checksum.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Checksum.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Checksum.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_basics-Checksum.Tpo $(DEPDIR)/database_basics-Checksum.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Checksum.cpp' object='database_basics-Checksum.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_basics_CXXFLAGS) $(CXXFLAGS) -c -o database_basics-Checksum.obj `if test -f '$(top_srcdir)/database/Checksum.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Checksum.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Checksum.cpp'; fi` - -database_integrity-DatabaseIntegrity.o: $(srcdir)/DatabaseIntegrity.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-DatabaseIntegrity.o -MD -MP -MF $(DEPDIR)/database_integrity-DatabaseIntegrity.Tpo -c -o database_integrity-DatabaseIntegrity.o `test -f '$(srcdir)/DatabaseIntegrity.cpp' || echo '$(srcdir)/'`$(srcdir)/DatabaseIntegrity.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-DatabaseIntegrity.Tpo $(DEPDIR)/database_integrity-DatabaseIntegrity.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/DatabaseIntegrity.cpp' object='database_integrity-DatabaseIntegrity.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-DatabaseIntegrity.o `test -f '$(srcdir)/DatabaseIntegrity.cpp' || echo '$(srcdir)/'`$(srcdir)/DatabaseIntegrity.cpp - -database_integrity-DatabaseIntegrity.obj: $(srcdir)/DatabaseIntegrity.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-DatabaseIntegrity.obj -MD -MP -MF $(DEPDIR)/database_integrity-DatabaseIntegrity.Tpo -c -o database_integrity-DatabaseIntegrity.obj `if test -f '$(srcdir)/DatabaseIntegrity.cpp'; then $(CYGPATH_W) '$(srcdir)/DatabaseIntegrity.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/DatabaseIntegrity.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-DatabaseIntegrity.Tpo $(DEPDIR)/database_integrity-DatabaseIntegrity.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/DatabaseIntegrity.cpp' object='database_integrity-DatabaseIntegrity.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-DatabaseIntegrity.obj `if test -f '$(srcdir)/DatabaseIntegrity.cpp'; then $(CYGPATH_W) '$(srcdir)/DatabaseIntegrity.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/DatabaseIntegrity.cpp'; fi` - -database_integrity-Artist.o: $(top_srcdir)/database/Artist.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Artist.o -MD -MP -MF $(DEPDIR)/database_integrity-Artist.Tpo -c -o database_integrity-Artist.o `test -f '$(top_srcdir)/database/Artist.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Artist.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Artist.Tpo $(DEPDIR)/database_integrity-Artist.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Artist.cpp' object='database_integrity-Artist.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Artist.o `test -f '$(top_srcdir)/database/Artist.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Artist.cpp - -database_integrity-Artist.obj: $(top_srcdir)/database/Artist.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Artist.obj -MD -MP -MF $(DEPDIR)/database_integrity-Artist.Tpo -c -o database_integrity-Artist.obj `if test -f '$(top_srcdir)/database/Artist.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Artist.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Artist.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Artist.Tpo $(DEPDIR)/database_integrity-Artist.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Artist.cpp' object='database_integrity-Artist.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Artist.obj `if test -f '$(top_srcdir)/database/Artist.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Artist.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Artist.cpp'; fi` - -database_integrity-Genre.o: $(top_srcdir)/database/Genre.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Genre.o -MD -MP -MF $(DEPDIR)/database_integrity-Genre.Tpo -c -o database_integrity-Genre.o `test -f '$(top_srcdir)/database/Genre.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Genre.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Genre.Tpo $(DEPDIR)/database_integrity-Genre.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Genre.cpp' object='database_integrity-Genre.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Genre.o `test -f '$(top_srcdir)/database/Genre.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Genre.cpp - -database_integrity-Genre.obj: $(top_srcdir)/database/Genre.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Genre.obj -MD -MP -MF $(DEPDIR)/database_integrity-Genre.Tpo -c -o database_integrity-Genre.obj `if test -f '$(top_srcdir)/database/Genre.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Genre.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Genre.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Genre.Tpo $(DEPDIR)/database_integrity-Genre.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Genre.cpp' object='database_integrity-Genre.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Genre.obj `if test -f '$(top_srcdir)/database/Genre.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Genre.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Genre.cpp'; fi` - -database_integrity-Release.o: $(top_srcdir)/database/Release.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Release.o -MD -MP -MF $(DEPDIR)/database_integrity-Release.Tpo -c -o database_integrity-Release.o `test -f '$(top_srcdir)/database/Release.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Release.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Release.Tpo $(DEPDIR)/database_integrity-Release.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Release.cpp' object='database_integrity-Release.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Release.o `test -f '$(top_srcdir)/database/Release.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Release.cpp - -database_integrity-Release.obj: $(top_srcdir)/database/Release.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Release.obj -MD -MP -MF $(DEPDIR)/database_integrity-Release.Tpo -c -o database_integrity-Release.obj `if test -f '$(top_srcdir)/database/Release.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Release.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Release.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Release.Tpo $(DEPDIR)/database_integrity-Release.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Release.cpp' object='database_integrity-Release.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Release.obj `if test -f '$(top_srcdir)/database/Release.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Release.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Release.cpp'; fi` - -database_integrity-Track.o: $(top_srcdir)/database/Track.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Track.o -MD -MP -MF $(DEPDIR)/database_integrity-Track.Tpo -c -o database_integrity-Track.o `test -f '$(top_srcdir)/database/Track.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Track.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Track.Tpo $(DEPDIR)/database_integrity-Track.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Track.cpp' object='database_integrity-Track.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Track.o `test -f '$(top_srcdir)/database/Track.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Track.cpp - -database_integrity-Track.obj: $(top_srcdir)/database/Track.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Track.obj -MD -MP -MF $(DEPDIR)/database_integrity-Track.Tpo -c -o database_integrity-Track.obj `if test -f '$(top_srcdir)/database/Track.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Track.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Track.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Track.Tpo $(DEPDIR)/database_integrity-Track.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Track.cpp' object='database_integrity-Track.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Track.obj `if test -f '$(top_srcdir)/database/Track.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Track.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Track.cpp'; fi` - -database_integrity-DatabaseHandler.o: $(top_srcdir)/database/DatabaseHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-DatabaseHandler.o -MD -MP -MF $(DEPDIR)/database_integrity-DatabaseHandler.Tpo -c -o database_integrity-DatabaseHandler.o `test -f '$(top_srcdir)/database/DatabaseHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/DatabaseHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-DatabaseHandler.Tpo $(DEPDIR)/database_integrity-DatabaseHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/DatabaseHandler.cpp' object='database_integrity-DatabaseHandler.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-DatabaseHandler.o `test -f '$(top_srcdir)/database/DatabaseHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/DatabaseHandler.cpp - -database_integrity-DatabaseHandler.obj: $(top_srcdir)/database/DatabaseHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-DatabaseHandler.obj -MD -MP -MF $(DEPDIR)/database_integrity-DatabaseHandler.Tpo -c -o database_integrity-DatabaseHandler.obj `if test -f '$(top_srcdir)/database/DatabaseHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/DatabaseHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/DatabaseHandler.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-DatabaseHandler.Tpo $(DEPDIR)/database_integrity-DatabaseHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/DatabaseHandler.cpp' object='database_integrity-DatabaseHandler.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-DatabaseHandler.obj `if test -f '$(top_srcdir)/database/DatabaseHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/DatabaseHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/DatabaseHandler.cpp'; fi` - -database_integrity-SqlQuery.o: $(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-SqlQuery.o -MD -MP -MF $(DEPDIR)/database_integrity-SqlQuery.Tpo -c -o database_integrity-SqlQuery.o `test -f '$(top_srcdir)/database/SqlQuery.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-SqlQuery.Tpo $(DEPDIR)/database_integrity-SqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/SqlQuery.cpp' object='database_integrity-SqlQuery.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-SqlQuery.o `test -f '$(top_srcdir)/database/SqlQuery.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/SqlQuery.cpp - -database_integrity-SqlQuery.obj: $(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-SqlQuery.obj -MD -MP -MF $(DEPDIR)/database_integrity-SqlQuery.Tpo -c -o database_integrity-SqlQuery.obj `if test -f '$(top_srcdir)/database/SqlQuery.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/SqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/SqlQuery.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-SqlQuery.Tpo $(DEPDIR)/database_integrity-SqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/SqlQuery.cpp' object='database_integrity-SqlQuery.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-SqlQuery.obj `if test -f '$(top_srcdir)/database/SqlQuery.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/SqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/SqlQuery.cpp'; fi` - -database_integrity-Path.o: $(top_srcdir)/database/Path.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Path.o -MD -MP -MF $(DEPDIR)/database_integrity-Path.Tpo -c -o database_integrity-Path.o `test -f '$(top_srcdir)/database/Path.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Path.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Path.Tpo $(DEPDIR)/database_integrity-Path.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Path.cpp' object='database_integrity-Path.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Path.o `test -f '$(top_srcdir)/database/Path.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Path.cpp - -database_integrity-Path.obj: $(top_srcdir)/database/Path.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Path.obj -MD -MP -MF $(DEPDIR)/database_integrity-Path.Tpo -c -o database_integrity-Path.obj `if test -f '$(top_srcdir)/database/Path.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Path.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Path.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Path.Tpo $(DEPDIR)/database_integrity-Path.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Path.cpp' object='database_integrity-Path.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Path.obj `if test -f '$(top_srcdir)/database/Path.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Path.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Path.cpp'; fi` - -database_integrity-Video.o: $(top_srcdir)/database/Video.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Video.o -MD -MP -MF $(DEPDIR)/database_integrity-Video.Tpo -c -o database_integrity-Video.o `test -f '$(top_srcdir)/database/Video.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Video.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Video.Tpo $(DEPDIR)/database_integrity-Video.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Video.cpp' object='database_integrity-Video.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Video.o `test -f '$(top_srcdir)/database/Video.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Video.cpp - -database_integrity-Video.obj: $(top_srcdir)/database/Video.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Video.obj -MD -MP -MF $(DEPDIR)/database_integrity-Video.Tpo -c -o database_integrity-Video.obj `if test -f '$(top_srcdir)/database/Video.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Video.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Video.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Video.Tpo $(DEPDIR)/database_integrity-Video.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Video.cpp' object='database_integrity-Video.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Video.obj `if test -f '$(top_srcdir)/database/Video.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Video.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Video.cpp'; fi` - -database_integrity-Checksum.o: $(top_srcdir)/database/Checksum.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Checksum.o -MD -MP -MF $(DEPDIR)/database_integrity-Checksum.Tpo -c -o database_integrity-Checksum.o `test -f '$(top_srcdir)/database/Checksum.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Checksum.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Checksum.Tpo $(DEPDIR)/database_integrity-Checksum.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Checksum.cpp' object='database_integrity-Checksum.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Checksum.o `test -f '$(top_srcdir)/database/Checksum.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Checksum.cpp - -database_integrity-Checksum.obj: $(top_srcdir)/database/Checksum.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -MT database_integrity-Checksum.obj -MD -MP -MF $(DEPDIR)/database_integrity-Checksum.Tpo -c -o database_integrity-Checksum.obj `if test -f '$(top_srcdir)/database/Checksum.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Checksum.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Checksum.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/database_integrity-Checksum.Tpo $(DEPDIR)/database_integrity-Checksum.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Checksum.cpp' object='database_integrity-Checksum.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(database_integrity_CXXFLAGS) $(CXXFLAGS) -c -o database_integrity-Checksum.obj `if test -f '$(top_srcdir)/database/Checksum.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Checksum.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Checksum.cpp'; fi` - -remote-RemoteClientServer.o: $(srcdir)/RemoteClientServer.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-RemoteClientServer.o -MD -MP -MF $(DEPDIR)/remote-RemoteClientServer.Tpo -c -o remote-RemoteClientServer.o `test -f '$(srcdir)/RemoteClientServer.cpp' || echo '$(srcdir)/'`$(srcdir)/RemoteClientServer.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-RemoteClientServer.Tpo $(DEPDIR)/remote-RemoteClientServer.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/RemoteClientServer.cpp' object='remote-RemoteClientServer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-RemoteClientServer.o `test -f '$(srcdir)/RemoteClientServer.cpp' || echo '$(srcdir)/'`$(srcdir)/RemoteClientServer.cpp - -remote-RemoteClientServer.obj: $(srcdir)/RemoteClientServer.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-RemoteClientServer.obj -MD -MP -MF $(DEPDIR)/remote-RemoteClientServer.Tpo -c -o remote-RemoteClientServer.obj `if test -f '$(srcdir)/RemoteClientServer.cpp'; then $(CYGPATH_W) '$(srcdir)/RemoteClientServer.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/RemoteClientServer.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-RemoteClientServer.Tpo $(DEPDIR)/remote-RemoteClientServer.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/RemoteClientServer.cpp' object='remote-RemoteClientServer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-RemoteClientServer.obj `if test -f '$(srcdir)/RemoteClientServer.cpp'; then $(CYGPATH_W) '$(srcdir)/RemoteClientServer.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/RemoteClientServer.cpp'; fi` - -remote-TestDatabase.o: $(srcdir)/TestDatabase.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-TestDatabase.o -MD -MP -MF $(DEPDIR)/remote-TestDatabase.Tpo -c -o remote-TestDatabase.o `test -f '$(srcdir)/TestDatabase.cpp' || echo '$(srcdir)/'`$(srcdir)/TestDatabase.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-TestDatabase.Tpo $(DEPDIR)/remote-TestDatabase.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/TestDatabase.cpp' object='remote-TestDatabase.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-TestDatabase.o `test -f '$(srcdir)/TestDatabase.cpp' || echo '$(srcdir)/'`$(srcdir)/TestDatabase.cpp - -remote-TestDatabase.obj: $(srcdir)/TestDatabase.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-TestDatabase.obj -MD -MP -MF $(DEPDIR)/remote-TestDatabase.Tpo -c -o remote-TestDatabase.obj `if test -f '$(srcdir)/TestDatabase.cpp'; then $(CYGPATH_W) '$(srcdir)/TestDatabase.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/TestDatabase.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-TestDatabase.Tpo $(DEPDIR)/remote-TestDatabase.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/TestDatabase.cpp' object='remote-TestDatabase.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-TestDatabase.obj `if test -f '$(srcdir)/TestDatabase.cpp'; then $(CYGPATH_W) '$(srcdir)/TestDatabase.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/TestDatabase.cpp'; fi` - -remote-CodecContext.o: $(top_srcdir)/av/CodecContext.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-CodecContext.o -MD -MP -MF $(DEPDIR)/remote-CodecContext.Tpo -c -o remote-CodecContext.o `test -f '$(top_srcdir)/av/CodecContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/CodecContext.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-CodecContext.Tpo $(DEPDIR)/remote-CodecContext.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/CodecContext.cpp' object='remote-CodecContext.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-CodecContext.o `test -f '$(top_srcdir)/av/CodecContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/CodecContext.cpp - -remote-CodecContext.obj: $(top_srcdir)/av/CodecContext.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-CodecContext.obj -MD -MP -MF $(DEPDIR)/remote-CodecContext.Tpo -c -o remote-CodecContext.obj `if test -f '$(top_srcdir)/av/CodecContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/CodecContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/CodecContext.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-CodecContext.Tpo $(DEPDIR)/remote-CodecContext.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/CodecContext.cpp' object='remote-CodecContext.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-CodecContext.obj `if test -f '$(top_srcdir)/av/CodecContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/CodecContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/CodecContext.cpp'; fi` - -remote-Common.o: $(top_srcdir)/av/Common.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Common.o -MD -MP -MF $(DEPDIR)/remote-Common.Tpo -c -o remote-Common.o `test -f '$(top_srcdir)/av/Common.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Common.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Common.Tpo $(DEPDIR)/remote-Common.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Common.cpp' object='remote-Common.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Common.o `test -f '$(top_srcdir)/av/Common.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Common.cpp - -remote-Common.obj: $(top_srcdir)/av/Common.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Common.obj -MD -MP -MF $(DEPDIR)/remote-Common.Tpo -c -o remote-Common.obj `if test -f '$(top_srcdir)/av/Common.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Common.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Common.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Common.Tpo $(DEPDIR)/remote-Common.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Common.cpp' object='remote-Common.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Common.obj `if test -f '$(top_srcdir)/av/Common.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Common.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Common.cpp'; fi` - -remote-Dictionary.o: $(top_srcdir)/av/Dictionary.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Dictionary.o -MD -MP -MF $(DEPDIR)/remote-Dictionary.Tpo -c -o remote-Dictionary.o `test -f '$(top_srcdir)/av/Dictionary.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Dictionary.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Dictionary.Tpo $(DEPDIR)/remote-Dictionary.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Dictionary.cpp' object='remote-Dictionary.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Dictionary.o `test -f '$(top_srcdir)/av/Dictionary.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Dictionary.cpp - -remote-Dictionary.obj: $(top_srcdir)/av/Dictionary.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Dictionary.obj -MD -MP -MF $(DEPDIR)/remote-Dictionary.Tpo -c -o remote-Dictionary.obj `if test -f '$(top_srcdir)/av/Dictionary.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Dictionary.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Dictionary.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Dictionary.Tpo $(DEPDIR)/remote-Dictionary.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Dictionary.cpp' object='remote-Dictionary.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Dictionary.obj `if test -f '$(top_srcdir)/av/Dictionary.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Dictionary.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Dictionary.cpp'; fi` - -remote-FormatContext.o: $(top_srcdir)/av/FormatContext.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-FormatContext.o -MD -MP -MF $(DEPDIR)/remote-FormatContext.Tpo -c -o remote-FormatContext.o `test -f '$(top_srcdir)/av/FormatContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/FormatContext.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-FormatContext.Tpo $(DEPDIR)/remote-FormatContext.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/FormatContext.cpp' object='remote-FormatContext.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-FormatContext.o `test -f '$(top_srcdir)/av/FormatContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/FormatContext.cpp - -remote-FormatContext.obj: $(top_srcdir)/av/FormatContext.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-FormatContext.obj -MD -MP -MF $(DEPDIR)/remote-FormatContext.Tpo -c -o remote-FormatContext.obj `if test -f '$(top_srcdir)/av/FormatContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/FormatContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/FormatContext.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-FormatContext.Tpo $(DEPDIR)/remote-FormatContext.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/FormatContext.cpp' object='remote-FormatContext.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-FormatContext.obj `if test -f '$(top_srcdir)/av/FormatContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/FormatContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/FormatContext.cpp'; fi` - -remote-InputFormatContext.o: $(top_srcdir)/av/InputFormatContext.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-InputFormatContext.o -MD -MP -MF $(DEPDIR)/remote-InputFormatContext.Tpo -c -o remote-InputFormatContext.o `test -f '$(top_srcdir)/av/InputFormatContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/InputFormatContext.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-InputFormatContext.Tpo $(DEPDIR)/remote-InputFormatContext.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/InputFormatContext.cpp' object='remote-InputFormatContext.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-InputFormatContext.o `test -f '$(top_srcdir)/av/InputFormatContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/InputFormatContext.cpp - -remote-InputFormatContext.obj: $(top_srcdir)/av/InputFormatContext.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-InputFormatContext.obj -MD -MP -MF $(DEPDIR)/remote-InputFormatContext.Tpo -c -o remote-InputFormatContext.obj `if test -f '$(top_srcdir)/av/InputFormatContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/InputFormatContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/InputFormatContext.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-InputFormatContext.Tpo $(DEPDIR)/remote-InputFormatContext.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/InputFormatContext.cpp' object='remote-InputFormatContext.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-InputFormatContext.obj `if test -f '$(top_srcdir)/av/InputFormatContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/InputFormatContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/InputFormatContext.cpp'; fi` - -remote-Stream.o: $(top_srcdir)/av/Stream.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Stream.o -MD -MP -MF $(DEPDIR)/remote-Stream.Tpo -c -o remote-Stream.o `test -f '$(top_srcdir)/av/Stream.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Stream.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Stream.Tpo $(DEPDIR)/remote-Stream.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Stream.cpp' object='remote-Stream.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Stream.o `test -f '$(top_srcdir)/av/Stream.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Stream.cpp - -remote-Stream.obj: $(top_srcdir)/av/Stream.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Stream.obj -MD -MP -MF $(DEPDIR)/remote-Stream.Tpo -c -o remote-Stream.obj `if test -f '$(top_srcdir)/av/Stream.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Stream.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Stream.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Stream.Tpo $(DEPDIR)/remote-Stream.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Stream.cpp' object='remote-Stream.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Stream.obj `if test -f '$(top_srcdir)/av/Stream.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Stream.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Stream.cpp'; fi` - -remote-CoverArtGrabber.o: $(top_srcdir)/cover/CoverArtGrabber.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-CoverArtGrabber.o -MD -MP -MF $(DEPDIR)/remote-CoverArtGrabber.Tpo -c -o remote-CoverArtGrabber.o `test -f '$(top_srcdir)/cover/CoverArtGrabber.cpp' || echo '$(srcdir)/'`$(top_srcdir)/cover/CoverArtGrabber.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-CoverArtGrabber.Tpo $(DEPDIR)/remote-CoverArtGrabber.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/cover/CoverArtGrabber.cpp' object='remote-CoverArtGrabber.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-CoverArtGrabber.o `test -f '$(top_srcdir)/cover/CoverArtGrabber.cpp' || echo '$(srcdir)/'`$(top_srcdir)/cover/CoverArtGrabber.cpp - -remote-CoverArtGrabber.obj: $(top_srcdir)/cover/CoverArtGrabber.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-CoverArtGrabber.obj -MD -MP -MF $(DEPDIR)/remote-CoverArtGrabber.Tpo -c -o remote-CoverArtGrabber.obj `if test -f '$(top_srcdir)/cover/CoverArtGrabber.cpp'; then $(CYGPATH_W) '$(top_srcdir)/cover/CoverArtGrabber.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/cover/CoverArtGrabber.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-CoverArtGrabber.Tpo $(DEPDIR)/remote-CoverArtGrabber.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/cover/CoverArtGrabber.cpp' object='remote-CoverArtGrabber.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-CoverArtGrabber.obj `if test -f '$(top_srcdir)/cover/CoverArtGrabber.cpp'; then $(CYGPATH_W) '$(top_srcdir)/cover/CoverArtGrabber.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/cover/CoverArtGrabber.cpp'; fi` - -remote-Server.o: $(top_srcdir)/remote/server/Server.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Server.o -MD -MP -MF $(DEPDIR)/remote-Server.Tpo -c -o remote-Server.o `test -f '$(top_srcdir)/remote/server/Server.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/Server.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Server.Tpo $(DEPDIR)/remote-Server.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/Server.cpp' object='remote-Server.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Server.o `test -f '$(top_srcdir)/remote/server/Server.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/Server.cpp - -remote-Server.obj: $(top_srcdir)/remote/server/Server.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Server.obj -MD -MP -MF $(DEPDIR)/remote-Server.Tpo -c -o remote-Server.obj `if test -f '$(top_srcdir)/remote/server/Server.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/Server.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/Server.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Server.Tpo $(DEPDIR)/remote-Server.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/Server.cpp' object='remote-Server.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Server.obj `if test -f '$(top_srcdir)/remote/server/Server.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/Server.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/Server.cpp'; fi` - -remote-RequestHandler.o: $(top_srcdir)/remote/server/RequestHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-RequestHandler.o -MD -MP -MF $(DEPDIR)/remote-RequestHandler.Tpo -c -o remote-RequestHandler.o `test -f '$(top_srcdir)/remote/server/RequestHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/RequestHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-RequestHandler.Tpo $(DEPDIR)/remote-RequestHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/RequestHandler.cpp' object='remote-RequestHandler.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-RequestHandler.o `test -f '$(top_srcdir)/remote/server/RequestHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/RequestHandler.cpp - -remote-RequestHandler.obj: $(top_srcdir)/remote/server/RequestHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-RequestHandler.obj -MD -MP -MF $(DEPDIR)/remote-RequestHandler.Tpo -c -o remote-RequestHandler.obj `if test -f '$(top_srcdir)/remote/server/RequestHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/RequestHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/RequestHandler.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-RequestHandler.Tpo $(DEPDIR)/remote-RequestHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/RequestHandler.cpp' object='remote-RequestHandler.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-RequestHandler.obj `if test -f '$(top_srcdir)/remote/server/RequestHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/RequestHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/RequestHandler.cpp'; fi` - -remote-AudioCollectionRequestHandler.o: $(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-AudioCollectionRequestHandler.o -MD -MP -MF $(DEPDIR)/remote-AudioCollectionRequestHandler.Tpo -c -o remote-AudioCollectionRequestHandler.o `test -f '$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-AudioCollectionRequestHandler.Tpo $(DEPDIR)/remote-AudioCollectionRequestHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp' object='remote-AudioCollectionRequestHandler.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-AudioCollectionRequestHandler.o `test -f '$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp - -remote-AudioCollectionRequestHandler.obj: $(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-AudioCollectionRequestHandler.obj -MD -MP -MF $(DEPDIR)/remote-AudioCollectionRequestHandler.Tpo -c -o remote-AudioCollectionRequestHandler.obj `if test -f '$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-AudioCollectionRequestHandler.Tpo $(DEPDIR)/remote-AudioCollectionRequestHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp' object='remote-AudioCollectionRequestHandler.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-AudioCollectionRequestHandler.obj `if test -f '$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp'; fi` - -remote-MediaRequestHandler.o: $(top_srcdir)/remote/server/MediaRequestHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-MediaRequestHandler.o -MD -MP -MF $(DEPDIR)/remote-MediaRequestHandler.Tpo -c -o remote-MediaRequestHandler.o `test -f '$(top_srcdir)/remote/server/MediaRequestHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/MediaRequestHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-MediaRequestHandler.Tpo $(DEPDIR)/remote-MediaRequestHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/MediaRequestHandler.cpp' object='remote-MediaRequestHandler.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-MediaRequestHandler.o `test -f '$(top_srcdir)/remote/server/MediaRequestHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/MediaRequestHandler.cpp - -remote-MediaRequestHandler.obj: $(top_srcdir)/remote/server/MediaRequestHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-MediaRequestHandler.obj -MD -MP -MF $(DEPDIR)/remote-MediaRequestHandler.Tpo -c -o remote-MediaRequestHandler.obj `if test -f '$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-MediaRequestHandler.Tpo $(DEPDIR)/remote-MediaRequestHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/MediaRequestHandler.cpp' object='remote-MediaRequestHandler.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-MediaRequestHandler.obj `if test -f '$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; fi` - -remote-ConnectionManager.o: $(top_srcdir)/remote/server/ConnectionManager.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-ConnectionManager.o -MD -MP -MF $(DEPDIR)/remote-ConnectionManager.Tpo -c -o remote-ConnectionManager.o `test -f '$(top_srcdir)/remote/server/ConnectionManager.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/ConnectionManager.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-ConnectionManager.Tpo $(DEPDIR)/remote-ConnectionManager.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/ConnectionManager.cpp' object='remote-ConnectionManager.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-ConnectionManager.o `test -f '$(top_srcdir)/remote/server/ConnectionManager.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/ConnectionManager.cpp - -remote-ConnectionManager.obj: $(top_srcdir)/remote/server/ConnectionManager.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-ConnectionManager.obj -MD -MP -MF $(DEPDIR)/remote-ConnectionManager.Tpo -c -o remote-ConnectionManager.obj `if test -f '$(top_srcdir)/remote/server/ConnectionManager.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/ConnectionManager.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/ConnectionManager.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-ConnectionManager.Tpo $(DEPDIR)/remote-ConnectionManager.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/ConnectionManager.cpp' object='remote-ConnectionManager.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-ConnectionManager.obj `if test -f '$(top_srcdir)/remote/server/ConnectionManager.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/ConnectionManager.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/ConnectionManager.cpp'; fi` - -remote-Connection.o: $(top_srcdir)/remote/server/Connection.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Connection.o -MD -MP -MF $(DEPDIR)/remote-Connection.Tpo -c -o remote-Connection.o `test -f '$(top_srcdir)/remote/server/Connection.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/Connection.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Connection.Tpo $(DEPDIR)/remote-Connection.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/Connection.cpp' object='remote-Connection.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Connection.o `test -f '$(top_srcdir)/remote/server/Connection.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/Connection.cpp - -remote-Connection.obj: $(top_srcdir)/remote/server/Connection.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Connection.obj -MD -MP -MF $(DEPDIR)/remote-Connection.Tpo -c -o remote-Connection.obj `if test -f '$(top_srcdir)/remote/server/Connection.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/Connection.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/Connection.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Connection.Tpo $(DEPDIR)/remote-Connection.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/Connection.cpp' object='remote-Connection.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Connection.obj `if test -f '$(top_srcdir)/remote/server/Connection.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/Connection.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/Connection.cpp'; fi` - -remote-auth.pb.o: $(top_srcdir)/remote/messages/auth.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-auth.pb.o -MD -MP -MF $(DEPDIR)/remote-auth.pb.Tpo -c -o remote-auth.pb.o `test -f '$(top_srcdir)/remote/messages/auth.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/auth.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-auth.pb.Tpo $(DEPDIR)/remote-auth.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/auth.pb.cc' object='remote-auth.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-auth.pb.o `test -f '$(top_srcdir)/remote/messages/auth.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/auth.pb.cc - -remote-auth.pb.obj: $(top_srcdir)/remote/messages/auth.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-auth.pb.obj -MD -MP -MF $(DEPDIR)/remote-auth.pb.Tpo -c -o remote-auth.pb.obj `if test -f '$(top_srcdir)/remote/messages/auth.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/auth.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/auth.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-auth.pb.Tpo $(DEPDIR)/remote-auth.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/auth.pb.cc' object='remote-auth.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-auth.pb.obj `if test -f '$(top_srcdir)/remote/messages/auth.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/auth.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/auth.pb.cc'; fi` - -remote-collection.pb.o: $(top_srcdir)/remote/messages/collection.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-collection.pb.o -MD -MP -MF $(DEPDIR)/remote-collection.pb.Tpo -c -o remote-collection.pb.o `test -f '$(top_srcdir)/remote/messages/collection.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/collection.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-collection.pb.Tpo $(DEPDIR)/remote-collection.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/collection.pb.cc' object='remote-collection.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-collection.pb.o `test -f '$(top_srcdir)/remote/messages/collection.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/collection.pb.cc - -remote-collection.pb.obj: $(top_srcdir)/remote/messages/collection.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-collection.pb.obj -MD -MP -MF $(DEPDIR)/remote-collection.pb.Tpo -c -o remote-collection.pb.obj `if test -f '$(top_srcdir)/remote/messages/collection.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/collection.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/collection.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-collection.pb.Tpo $(DEPDIR)/remote-collection.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/collection.pb.cc' object='remote-collection.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-collection.pb.obj `if test -f '$(top_srcdir)/remote/messages/collection.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/collection.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/collection.pb.cc'; fi` - -remote-common.pb.o: $(top_srcdir)/remote/messages/common.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-common.pb.o -MD -MP -MF $(DEPDIR)/remote-common.pb.Tpo -c -o remote-common.pb.o `test -f '$(top_srcdir)/remote/messages/common.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/common.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-common.pb.Tpo $(DEPDIR)/remote-common.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/common.pb.cc' object='remote-common.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-common.pb.o `test -f '$(top_srcdir)/remote/messages/common.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/common.pb.cc - -remote-common.pb.obj: $(top_srcdir)/remote/messages/common.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-common.pb.obj -MD -MP -MF $(DEPDIR)/remote-common.pb.Tpo -c -o remote-common.pb.obj `if test -f '$(top_srcdir)/remote/messages/common.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/common.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/common.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-common.pb.Tpo $(DEPDIR)/remote-common.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/common.pb.cc' object='remote-common.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-common.pb.obj `if test -f '$(top_srcdir)/remote/messages/common.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/common.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/common.pb.cc'; fi` - -remote-media.pb.o: $(top_srcdir)/remote/messages/media.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-media.pb.o -MD -MP -MF $(DEPDIR)/remote-media.pb.Tpo -c -o remote-media.pb.o `test -f '$(top_srcdir)/remote/messages/media.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/media.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-media.pb.Tpo $(DEPDIR)/remote-media.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/media.pb.cc' object='remote-media.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-media.pb.o `test -f '$(top_srcdir)/remote/messages/media.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/media.pb.cc - -remote-media.pb.obj: $(top_srcdir)/remote/messages/media.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-media.pb.obj -MD -MP -MF $(DEPDIR)/remote-media.pb.Tpo -c -o remote-media.pb.obj `if test -f '$(top_srcdir)/remote/messages/media.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/media.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/media.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-media.pb.Tpo $(DEPDIR)/remote-media.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/media.pb.cc' object='remote-media.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-media.pb.obj `if test -f '$(top_srcdir)/remote/messages/media.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/media.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/media.pb.cc'; fi` - -remote-messages.pb.o: $(top_srcdir)/remote/messages/messages.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-messages.pb.o -MD -MP -MF $(DEPDIR)/remote-messages.pb.Tpo -c -o remote-messages.pb.o `test -f '$(top_srcdir)/remote/messages/messages.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/messages.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-messages.pb.Tpo $(DEPDIR)/remote-messages.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/messages.pb.cc' object='remote-messages.pb.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-messages.pb.o `test -f '$(top_srcdir)/remote/messages/messages.pb.cc' || echo '$(srcdir)/'`$(top_srcdir)/remote/messages/messages.pb.cc - -remote-messages.pb.obj: $(top_srcdir)/remote/messages/messages.pb.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-messages.pb.obj -MD -MP -MF $(DEPDIR)/remote-messages.pb.Tpo -c -o remote-messages.pb.obj `if test -f '$(top_srcdir)/remote/messages/messages.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/messages.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/messages.pb.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-messages.pb.Tpo $(DEPDIR)/remote-messages.pb.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/messages/messages.pb.cc' object='remote-messages.pb.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-messages.pb.obj `if test -f '$(top_srcdir)/remote/messages/messages.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/messages.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/messages.pb.cc'; fi` - -remote-AvConvTranscoder.o: $(top_srcdir)/transcode/AvConvTranscoder.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-AvConvTranscoder.o -MD -MP -MF $(DEPDIR)/remote-AvConvTranscoder.Tpo -c -o remote-AvConvTranscoder.o `test -f '$(top_srcdir)/transcode/AvConvTranscoder.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/AvConvTranscoder.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-AvConvTranscoder.Tpo $(DEPDIR)/remote-AvConvTranscoder.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/AvConvTranscoder.cpp' object='remote-AvConvTranscoder.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-AvConvTranscoder.o `test -f '$(top_srcdir)/transcode/AvConvTranscoder.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/AvConvTranscoder.cpp - -remote-AvConvTranscoder.obj: $(top_srcdir)/transcode/AvConvTranscoder.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-AvConvTranscoder.obj -MD -MP -MF $(DEPDIR)/remote-AvConvTranscoder.Tpo -c -o remote-AvConvTranscoder.obj `if test -f '$(top_srcdir)/transcode/AvConvTranscoder.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/AvConvTranscoder.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/AvConvTranscoder.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-AvConvTranscoder.Tpo $(DEPDIR)/remote-AvConvTranscoder.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/AvConvTranscoder.cpp' object='remote-AvConvTranscoder.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-AvConvTranscoder.obj `if test -f '$(top_srcdir)/transcode/AvConvTranscoder.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/AvConvTranscoder.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/AvConvTranscoder.cpp'; fi` - -remote-Format.o: $(top_srcdir)/transcode/Format.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Format.o -MD -MP -MF $(DEPDIR)/remote-Format.Tpo -c -o remote-Format.o `test -f '$(top_srcdir)/transcode/Format.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/Format.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Format.Tpo $(DEPDIR)/remote-Format.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/Format.cpp' object='remote-Format.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Format.o `test -f '$(top_srcdir)/transcode/Format.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/Format.cpp - -remote-Format.obj: $(top_srcdir)/transcode/Format.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Format.obj -MD -MP -MF $(DEPDIR)/remote-Format.Tpo -c -o remote-Format.obj `if test -f '$(top_srcdir)/transcode/Format.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/Format.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/Format.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Format.Tpo $(DEPDIR)/remote-Format.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/Format.cpp' object='remote-Format.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Format.obj `if test -f '$(top_srcdir)/transcode/Format.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/Format.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/Format.cpp'; fi` - -remote-Parameters.o: $(top_srcdir)/transcode/Parameters.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Parameters.o -MD -MP -MF $(DEPDIR)/remote-Parameters.Tpo -c -o remote-Parameters.o `test -f '$(top_srcdir)/transcode/Parameters.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/Parameters.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Parameters.Tpo $(DEPDIR)/remote-Parameters.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/Parameters.cpp' object='remote-Parameters.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Parameters.o `test -f '$(top_srcdir)/transcode/Parameters.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/Parameters.cpp - -remote-Parameters.obj: $(top_srcdir)/transcode/Parameters.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Parameters.obj -MD -MP -MF $(DEPDIR)/remote-Parameters.Tpo -c -o remote-Parameters.obj `if test -f '$(top_srcdir)/transcode/Parameters.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/Parameters.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/Parameters.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Parameters.Tpo $(DEPDIR)/remote-Parameters.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/Parameters.cpp' object='remote-Parameters.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Parameters.obj `if test -f '$(top_srcdir)/transcode/Parameters.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/Parameters.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/Parameters.cpp'; fi` - -remote-InputMediaFile.o: $(top_srcdir)/transcode/InputMediaFile.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-InputMediaFile.o -MD -MP -MF $(DEPDIR)/remote-InputMediaFile.Tpo -c -o remote-InputMediaFile.o `test -f '$(top_srcdir)/transcode/InputMediaFile.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/InputMediaFile.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-InputMediaFile.Tpo $(DEPDIR)/remote-InputMediaFile.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/InputMediaFile.cpp' object='remote-InputMediaFile.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-InputMediaFile.o `test -f '$(top_srcdir)/transcode/InputMediaFile.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/InputMediaFile.cpp - -remote-InputMediaFile.obj: $(top_srcdir)/transcode/InputMediaFile.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-InputMediaFile.obj -MD -MP -MF $(DEPDIR)/remote-InputMediaFile.Tpo -c -o remote-InputMediaFile.obj `if test -f '$(top_srcdir)/transcode/InputMediaFile.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/InputMediaFile.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/InputMediaFile.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-InputMediaFile.Tpo $(DEPDIR)/remote-InputMediaFile.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/InputMediaFile.cpp' object='remote-InputMediaFile.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-InputMediaFile.obj `if test -f '$(top_srcdir)/transcode/InputMediaFile.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/InputMediaFile.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/InputMediaFile.cpp'; fi` - -remote-Artist.o: $(top_srcdir)/database/Artist.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Artist.o -MD -MP -MF $(DEPDIR)/remote-Artist.Tpo -c -o remote-Artist.o `test -f '$(top_srcdir)/database/Artist.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Artist.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Artist.Tpo $(DEPDIR)/remote-Artist.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Artist.cpp' object='remote-Artist.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Artist.o `test -f '$(top_srcdir)/database/Artist.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Artist.cpp - -remote-Artist.obj: $(top_srcdir)/database/Artist.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Artist.obj -MD -MP -MF $(DEPDIR)/remote-Artist.Tpo -c -o remote-Artist.obj `if test -f '$(top_srcdir)/database/Artist.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Artist.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Artist.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Artist.Tpo $(DEPDIR)/remote-Artist.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Artist.cpp' object='remote-Artist.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Artist.obj `if test -f '$(top_srcdir)/database/Artist.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Artist.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Artist.cpp'; fi` - -remote-Genre.o: $(top_srcdir)/database/Genre.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Genre.o -MD -MP -MF $(DEPDIR)/remote-Genre.Tpo -c -o remote-Genre.o `test -f '$(top_srcdir)/database/Genre.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Genre.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Genre.Tpo $(DEPDIR)/remote-Genre.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Genre.cpp' object='remote-Genre.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Genre.o `test -f '$(top_srcdir)/database/Genre.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Genre.cpp - -remote-Genre.obj: $(top_srcdir)/database/Genre.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Genre.obj -MD -MP -MF $(DEPDIR)/remote-Genre.Tpo -c -o remote-Genre.obj `if test -f '$(top_srcdir)/database/Genre.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Genre.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Genre.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Genre.Tpo $(DEPDIR)/remote-Genre.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Genre.cpp' object='remote-Genre.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Genre.obj `if test -f '$(top_srcdir)/database/Genre.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Genre.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Genre.cpp'; fi` - -remote-Release.o: $(top_srcdir)/database/Release.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Release.o -MD -MP -MF $(DEPDIR)/remote-Release.Tpo -c -o remote-Release.o `test -f '$(top_srcdir)/database/Release.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Release.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Release.Tpo $(DEPDIR)/remote-Release.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Release.cpp' object='remote-Release.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Release.o `test -f '$(top_srcdir)/database/Release.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Release.cpp - -remote-Release.obj: $(top_srcdir)/database/Release.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Release.obj -MD -MP -MF $(DEPDIR)/remote-Release.Tpo -c -o remote-Release.obj `if test -f '$(top_srcdir)/database/Release.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Release.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Release.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Release.Tpo $(DEPDIR)/remote-Release.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Release.cpp' object='remote-Release.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Release.obj `if test -f '$(top_srcdir)/database/Release.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Release.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Release.cpp'; fi` - -remote-Track.o: $(top_srcdir)/database/Track.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Track.o -MD -MP -MF $(DEPDIR)/remote-Track.Tpo -c -o remote-Track.o `test -f '$(top_srcdir)/database/Track.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Track.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Track.Tpo $(DEPDIR)/remote-Track.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Track.cpp' object='remote-Track.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Track.o `test -f '$(top_srcdir)/database/Track.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Track.cpp - -remote-Track.obj: $(top_srcdir)/database/Track.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Track.obj -MD -MP -MF $(DEPDIR)/remote-Track.Tpo -c -o remote-Track.obj `if test -f '$(top_srcdir)/database/Track.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Track.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Track.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Track.Tpo $(DEPDIR)/remote-Track.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Track.cpp' object='remote-Track.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Track.obj `if test -f '$(top_srcdir)/database/Track.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Track.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Track.cpp'; fi` - -remote-DatabaseHandler.o: $(top_srcdir)/database/DatabaseHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-DatabaseHandler.o -MD -MP -MF $(DEPDIR)/remote-DatabaseHandler.Tpo -c -o remote-DatabaseHandler.o `test -f '$(top_srcdir)/database/DatabaseHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/DatabaseHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-DatabaseHandler.Tpo $(DEPDIR)/remote-DatabaseHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/DatabaseHandler.cpp' object='remote-DatabaseHandler.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-DatabaseHandler.o `test -f '$(top_srcdir)/database/DatabaseHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/DatabaseHandler.cpp - -remote-DatabaseHandler.obj: $(top_srcdir)/database/DatabaseHandler.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-DatabaseHandler.obj -MD -MP -MF $(DEPDIR)/remote-DatabaseHandler.Tpo -c -o remote-DatabaseHandler.obj `if test -f '$(top_srcdir)/database/DatabaseHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/DatabaseHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/DatabaseHandler.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-DatabaseHandler.Tpo $(DEPDIR)/remote-DatabaseHandler.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/DatabaseHandler.cpp' object='remote-DatabaseHandler.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-DatabaseHandler.obj `if test -f '$(top_srcdir)/database/DatabaseHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/DatabaseHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/DatabaseHandler.cpp'; fi` - -remote-SqlQuery.o: $(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-SqlQuery.o -MD -MP -MF $(DEPDIR)/remote-SqlQuery.Tpo -c -o remote-SqlQuery.o `test -f '$(top_srcdir)/database/SqlQuery.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-SqlQuery.Tpo $(DEPDIR)/remote-SqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/SqlQuery.cpp' object='remote-SqlQuery.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-SqlQuery.o `test -f '$(top_srcdir)/database/SqlQuery.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/SqlQuery.cpp - -remote-SqlQuery.obj: $(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-SqlQuery.obj -MD -MP -MF $(DEPDIR)/remote-SqlQuery.Tpo -c -o remote-SqlQuery.obj `if test -f '$(top_srcdir)/database/SqlQuery.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/SqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/SqlQuery.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-SqlQuery.Tpo $(DEPDIR)/remote-SqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/SqlQuery.cpp' object='remote-SqlQuery.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-SqlQuery.obj `if test -f '$(top_srcdir)/database/SqlQuery.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/SqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/SqlQuery.cpp'; fi` - -remote-Path.o: $(top_srcdir)/database/Path.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Path.o -MD -MP -MF $(DEPDIR)/remote-Path.Tpo -c -o remote-Path.o `test -f '$(top_srcdir)/database/Path.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Path.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Path.Tpo $(DEPDIR)/remote-Path.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Path.cpp' object='remote-Path.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Path.o `test -f '$(top_srcdir)/database/Path.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Path.cpp - -remote-Path.obj: $(top_srcdir)/database/Path.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Path.obj -MD -MP -MF $(DEPDIR)/remote-Path.Tpo -c -o remote-Path.obj `if test -f '$(top_srcdir)/database/Path.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Path.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Path.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Path.Tpo $(DEPDIR)/remote-Path.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Path.cpp' object='remote-Path.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Path.obj `if test -f '$(top_srcdir)/database/Path.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Path.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Path.cpp'; fi` - -remote-Video.o: $(top_srcdir)/database/Video.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Video.o -MD -MP -MF $(DEPDIR)/remote-Video.Tpo -c -o remote-Video.o `test -f '$(top_srcdir)/database/Video.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Video.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Video.Tpo $(DEPDIR)/remote-Video.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Video.cpp' object='remote-Video.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Video.o `test -f '$(top_srcdir)/database/Video.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Video.cpp - -remote-Video.obj: $(top_srcdir)/database/Video.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Video.obj -MD -MP -MF $(DEPDIR)/remote-Video.Tpo -c -o remote-Video.obj `if test -f '$(top_srcdir)/database/Video.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Video.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Video.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Video.Tpo $(DEPDIR)/remote-Video.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Video.cpp' object='remote-Video.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Video.obj `if test -f '$(top_srcdir)/database/Video.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Video.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Video.cpp'; fi` - -remote-Checksum.o: $(top_srcdir)/database/Checksum.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Checksum.o -MD -MP -MF $(DEPDIR)/remote-Checksum.Tpo -c -o remote-Checksum.o `test -f '$(top_srcdir)/database/Checksum.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Checksum.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Checksum.Tpo $(DEPDIR)/remote-Checksum.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Checksum.cpp' object='remote-Checksum.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Checksum.o `test -f '$(top_srcdir)/database/Checksum.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Checksum.cpp - -remote-Checksum.obj: $(top_srcdir)/database/Checksum.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Checksum.obj -MD -MP -MF $(DEPDIR)/remote-Checksum.Tpo -c -o remote-Checksum.obj `if test -f '$(top_srcdir)/database/Checksum.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Checksum.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Checksum.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Checksum.Tpo $(DEPDIR)/remote-Checksum.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/Checksum.cpp' object='remote-Checksum.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Checksum.obj `if test -f '$(top_srcdir)/database/Checksum.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/Checksum.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/Checksum.cpp'; fi` - -sql_query-CheckSqlQuery.o: $(srcdir)/CheckSqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sql_query_CXXFLAGS) $(CXXFLAGS) -MT sql_query-CheckSqlQuery.o -MD -MP -MF $(DEPDIR)/sql_query-CheckSqlQuery.Tpo -c -o sql_query-CheckSqlQuery.o `test -f '$(srcdir)/CheckSqlQuery.cpp' || echo '$(srcdir)/'`$(srcdir)/CheckSqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sql_query-CheckSqlQuery.Tpo $(DEPDIR)/sql_query-CheckSqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/CheckSqlQuery.cpp' object='sql_query-CheckSqlQuery.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sql_query_CXXFLAGS) $(CXXFLAGS) -c -o sql_query-CheckSqlQuery.o `test -f '$(srcdir)/CheckSqlQuery.cpp' || echo '$(srcdir)/'`$(srcdir)/CheckSqlQuery.cpp - -sql_query-CheckSqlQuery.obj: $(srcdir)/CheckSqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sql_query_CXXFLAGS) $(CXXFLAGS) -MT sql_query-CheckSqlQuery.obj -MD -MP -MF $(DEPDIR)/sql_query-CheckSqlQuery.Tpo -c -o sql_query-CheckSqlQuery.obj `if test -f '$(srcdir)/CheckSqlQuery.cpp'; then $(CYGPATH_W) '$(srcdir)/CheckSqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/CheckSqlQuery.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sql_query-CheckSqlQuery.Tpo $(DEPDIR)/sql_query-CheckSqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(srcdir)/CheckSqlQuery.cpp' object='sql_query-CheckSqlQuery.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sql_query_CXXFLAGS) $(CXXFLAGS) -c -o sql_query-CheckSqlQuery.obj `if test -f '$(srcdir)/CheckSqlQuery.cpp'; then $(CYGPATH_W) '$(srcdir)/CheckSqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/CheckSqlQuery.cpp'; fi` - -sql_query-SqlQuery.o: $(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sql_query_CXXFLAGS) $(CXXFLAGS) -MT sql_query-SqlQuery.o -MD -MP -MF $(DEPDIR)/sql_query-SqlQuery.Tpo -c -o sql_query-SqlQuery.o `test -f '$(top_srcdir)/database/SqlQuery.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sql_query-SqlQuery.Tpo $(DEPDIR)/sql_query-SqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/SqlQuery.cpp' object='sql_query-SqlQuery.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sql_query_CXXFLAGS) $(CXXFLAGS) -c -o sql_query-SqlQuery.o `test -f '$(top_srcdir)/database/SqlQuery.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/SqlQuery.cpp - -sql_query-SqlQuery.obj: $(top_srcdir)/database/SqlQuery.cpp -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sql_query_CXXFLAGS) $(CXXFLAGS) -MT sql_query-SqlQuery.obj -MD -MP -MF $(DEPDIR)/sql_query-SqlQuery.Tpo -c -o sql_query-SqlQuery.obj `if test -f '$(top_srcdir)/database/SqlQuery.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/SqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/SqlQuery.cpp'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sql_query-SqlQuery.Tpo $(DEPDIR)/sql_query-SqlQuery.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/database/SqlQuery.cpp' object='sql_query-SqlQuery.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sql_query_CXXFLAGS) $(CXXFLAGS) -c -o sql_query-SqlQuery.obj `if test -f '$(top_srcdir)/database/SqlQuery.cpp'; then $(CYGPATH_W) '$(top_srcdir)/database/SqlQuery.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/database/SqlQuery.cpp'; fi` - -.cpp.o: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -# Recover from deleted '.trs' file; this should ensure that -# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create -# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells -# to avoid problems with "make -n". -.log.trs: - rm -f $< $@ - $(MAKE) $(AM_MAKEFLAGS) $< - -# Leading 'am--fnord' is there to ensure the list of targets does not -# expand to empty, as could happen e.g. with make check TESTS=''. -am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) -am--force-recheck: - @: - -$(TEST_SUITE_LOG): $(TEST_LOGS) - @$(am__set_TESTS_bases); \ - am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ - redo_bases=`for i in $$bases; do \ - am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ - done`; \ - if test -n "$$redo_bases"; then \ - redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ - redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ - if $(am__make_dryrun); then :; else \ - rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ - fi; \ - fi; \ - if test -n "$$am__remaking_logs"; then \ - echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ - "recursion detected" >&2; \ - else \ - am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ - fi; \ - if $(am__make_dryrun); then :; else \ - st=0; \ - errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ - for i in $$redo_bases; do \ - test -f $$i.trs && test -r $$i.trs \ - || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ - test -f $$i.log && test -r $$i.log \ - || { echo "$$errmsg $$i.log" >&2; st=1; }; \ - done; \ - test $$st -eq 0 || exit 1; \ - fi - @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ - ws='[ ]'; \ - results=`for b in $$bases; do echo $$b.trs; done`; \ - test -n "$$results" || results=/dev/null; \ - all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ - pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ - fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ - skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ - xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ - xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ - error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ - if test `expr $$fail + $$xpass + $$error` -eq 0; then \ - success=true; \ - else \ - success=false; \ - fi; \ - br='==================='; br=$$br$$br$$br$$br; \ - result_count () \ - { \ - if test x"$$1" = x"--maybe-color"; then \ - maybe_colorize=yes; \ - elif test x"$$1" = x"--no-color"; then \ - maybe_colorize=no; \ - else \ - echo "$@: invalid 'result_count' usage" >&2; exit 4; \ - fi; \ - shift; \ - desc=$$1 count=$$2; \ - if test $$maybe_colorize = yes && test $$count -gt 0; then \ - color_start=$$3 color_end=$$std; \ - else \ - color_start= color_end=; \ - fi; \ - echo "$${color_start}# $$desc $$count$${color_end}"; \ - }; \ - create_testsuite_report () \ - { \ - result_count $$1 "TOTAL:" $$all "$$brg"; \ - result_count $$1 "PASS: " $$pass "$$grn"; \ - result_count $$1 "SKIP: " $$skip "$$blu"; \ - result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ - result_count $$1 "FAIL: " $$fail "$$red"; \ - result_count $$1 "XPASS:" $$xpass "$$red"; \ - result_count $$1 "ERROR:" $$error "$$mgn"; \ - }; \ - { \ - echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ - $(am__rst_title); \ - create_testsuite_report --no-color; \ - echo; \ - echo ".. contents:: :depth: 2"; \ - echo; \ - for b in $$bases; do echo $$b; done \ - | $(am__create_global_log); \ - } >$(TEST_SUITE_LOG).tmp || exit 1; \ - mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ - if $$success; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ - fi; \ - echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ - echo "$${col}$$br$${std}"; \ - create_testsuite_report --maybe-color; \ - echo "$$col$$br$$std"; \ - if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ - if test -n "$(PACKAGE_BUGREPORT)"; then \ - echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ - fi; \ - echo "$$col$$br$$std"; \ - fi; \ - $$success || exit 1 - -check-TESTS: - @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list - @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - trs_list=`for i in $$bases; do echo $$i.trs; done`; \ - log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ - exit $$?; -recheck: all $(check_PROGRAMS) - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - bases=`for i in $$bases; do echo $$i; done \ - | $(am__list_recheck_tests)` || exit 1; \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - log_list=`echo $$log_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ - am__force_recheck=am--force-recheck \ - TEST_LOGS="$$log_list"; \ - exit $$? -database-integrity.log: database-integrity$(EXEEXT) - @p='database-integrity$(EXEEXT)'; \ - b='database-integrity'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -sql-query.log: sql-query$(EXEEXT) - @p='sql-query$(EXEEXT)'; \ - b='sql-query'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -database-basics.log: database-basics$(EXEEXT) - @p='database-basics$(EXEEXT)'; \ - b='database-basics'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -remote.log: remote$(EXEEXT) - @p='remote$(EXEEXT)'; \ - b='remote'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -.test.log: - @p='$<'; \ - $(am__set_b); \ - $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) -@am__EXEEXT_TRUE@.test$(EXEEXT).log: -@am__EXEEXT_TRUE@ @p='$<'; \ -@am__EXEEXT_TRUE@ $(am__set_b); \ -@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ -@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ -@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ -@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) - -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) - -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: check-am install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - recheck tags tags-am uninstall uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/test/RemoteClientServer.cpp b/test/RemoteClientServer.cpp index 6b43d283..8de92039 100644 --- a/test/RemoteClientServer.cpp +++ b/test/RemoteClientServer.cpp @@ -374,6 +374,7 @@ class TestClient request.mutable_audio_collection_request()->set_type( Remote::AudioCollectionRequest::TypeGetCoverArt); request.mutable_audio_collection_request()->mutable_get_cover_art()->set_type( Remote::AudioCollectionRequest::GetCoverArt::TypeGetCoverArtTrack); request.mutable_audio_collection_request()->mutable_get_cover_art()->set_track_id( trackId ); + request.mutable_audio_collection_request()->mutable_get_cover_art()->set_size( 100 ); sendMsg(request); // Receive responses @@ -404,6 +405,8 @@ class TestClient request.mutable_audio_collection_request()->set_type( Remote::AudioCollectionRequest::TypeGetCoverArt); request.mutable_audio_collection_request()->mutable_get_cover_art()->set_type( Remote::AudioCollectionRequest::GetCoverArt::TypeGetCoverArtRelease); request.mutable_audio_collection_request()->mutable_get_cover_art()->set_release_id( releaseId ); + request.mutable_audio_collection_request()->mutable_get_cover_art()->set_size( 100 ); + sendMsg(request); // Receive responses @@ -715,10 +718,18 @@ int main() { BOOST_FOREACH(const ReleaseInfo& release, releases) { - std::vector coverArt; - client.getCoverRelease(coverArt, release.id); + std::vector coverArts; + client.getCoverRelease(coverArts, release.id); - std::cout << "Release '" << release << "', spotted " << coverArt.size() << " covers!" << std::endl; + BOOST_FOREACH(const CoverArt coverArt, coverArts) + { + std::ostringstream oss; oss << release.name << ".jpeg"; + std::ofstream out(oss.str().c_str()); + BOOST_FOREACH(unsigned char c, coverArt.data) + out.put(c); + } + + std::cout << "Release '" << release << "', spotted " << coverArts.size() << " covers!" << std::endl; } BOOST_FOREACH(const TrackInfo& track, tracks)