LibGd 2.4.0-dev
GD Graphics library
Loading...
Searching...
No Matches
gd_io_stream.h File Reference

C++ standard library iostream specializations of gdIOCtx. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Detailed Description

C++ standard library iostream specializations of gdIOCtx.

Note that all of the methods defined in this header are internal to the libgd library, except for the constructors. Only the constructors are needed by a user of the libgd API. This file does not use or need gdpp.h, but if GD::Image is used, then C++ coding becomes even simpler, and the classes below become entirely hidden implementation details. Example usage, convert png to gif: #include <fstream> #include "gd_io_stream.h" std::ifstream in("image.png", std::ios_base::in | std::ios_base::binary ); if (in.good()) { istreamIOCtx _in_ctx(in); gdImagePtr im_in = gdImageCreateFromPngCtx ( & _in_ctx); std::ofstream out("image.gif", std::ios_base::out | std::ios_base::binary ); ostreamIOCtx _out_ctx(out); gdImageGifCtx(im_in, & _out_ctx); } gdImageDestroy(im_in);