31 #ifndef PNGPP_IMAGE_HPP_INCLUDED
32 #define PNGPP_IMAGE_HPP_INCLUDED
51 template<
typename pixel >
58 typedef pixel_traits< pixel >
traits;
95 image(
size_t width,
size_t height)
105 explicit image(std::string
const& filename)
114 template<
class transformation >
116 transformation
const& transform)
118 read(filename.c_str(), transform);
125 explicit image(
char const* filename)
134 template<
class transformation >
135 image(
char const* filename, transformation
const& transform)
137 read(filename, transform);
144 explicit image(std::istream& stream)
153 template<
class transformation >
154 image(std::istream& stream, transformation
const& transform)
163 void read(std::string
const& filename)
172 template<
class transformation >
173 void read(std::string
const& filename, transformation
const& transform)
175 read(filename.c_str(), transform);
182 void read(
char const* filename)
191 template<
class transformation >
192 void read(
char const* filename, transformation
const& transform)
194 std::ifstream stream(filename, std::ios::binary);
195 if (!stream.is_open())
199 stream.exceptions(std::ios::badbit);
207 void read(std::istream& stream)
216 template<
class transformation >
217 void read(std::istream& stream, transformation
const& transform)
226 template<
class istream >
236 template<
class istream,
class transformation >
237 void read_stream(istream& stream, transformation
const& transform)
240 pixcon.read(stream, transform);
246 void write(std::string
const& filename)
248 write(filename.c_str());
256 std::ofstream stream(filename, std::ios::binary);
257 if (!stream.is_open())
261 stream.exceptions(std::ios::badbit);
276 template<
class ostream >
280 pixgen.write(stream);
457 template<
typename base_impl >
475 return reinterpret_cast< byte*
>
489 image_info_ref_holder,
497 true > >(info, pixels)
517 image_info_ref_holder,
525 true > >(info, pixels)
536 #endif // PNGPP_IMAGE_HPP_INCLUDED