src/base/pngwriter.cc
/**
 * Write callback to use with libpng APIs
 *
 * @param pngPtr  pointer to the png_struct structure
 * @param data    pointer to the data being written
 * @param length  number of bytes being written
 */
Write callback to use with libpng APIs
@param pngPtr  pointer to the png_struct structure
@param data    pointer to the data being written
@param length  number of bytes being written
Write callback to use with libpng APIs @param pngPtr pointer to the png_struct structure @param data pointer to the data being written @param length number of bytes being written
static void
writePng(png_structp pngPtr, png_bytep data, png_size_t length)
{
    std::ostream* strmPtr = reinterpret_cast<std::ostream*>(
        png_get_io_ptr(pngPtr)
    );
    strmPtr->write(reinterpret_cast<const char *>(data), length);
}
static void writePng ( png_structp pngPtr , png_bytep data , png_size_t length ) { std :: ostream * strmPtr = reinterpret_cast < std :: ostream * > ( png_get_io_ptr ( pngPtr ) ) ; strmPtr -> write ( reinterpret_cast < const char * > ( data ) , length ) ; }
Write callback to use with libpng APIs
 @param pngPtr  pointer to the png_struct structure
 @param data    pointer to the data being written
 @param length  number of bytes being written
Write callback to use with libpng APIs @param pngPtr pointer to the png_struct structure @param data pointer to the data being written @param length number of bytes being written
// Here we get our IO pointer back from the write struct // and we cast it into a ostream* type. // Write length bytes to data