<html><!-- Created using the cpp_pretty_printer from the dlib C++ library. See http://dlib.net for updates. --><head><title>dlib C++ Library - save_png_abstract.h</title></head><body bgcolor='white'><pre> <font color='#009900'>// Copyright (C) 2011 Davis E. King (davis@dlib.net) </font><font color='#009900'>// License: Boost Software License See LICENSE.txt for the full license. </font><font color='#0000FF'>#undef</font> DLIB_SAVE_PnG_ABSTRACT_ <font color='#0000FF'>#ifdef</font> DLIB_SAVE_PnG_ABSTRACT_ <font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../pixel.h.html'>../pixel.h</a>" <font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../image_processing/generic_image.h.html'>../image_processing/generic_image.h</a>" <font color='#0000FF'>namespace</font> dlib <b>{</b> <font color='#009900'>// ---------------------------------------------------------------------------------------- </font> <font color='#0000FF'>template</font> <font color='#5555FF'><</font> <font color='#0000FF'>typename</font> image_type <font color='#5555FF'>></font> <font color='#0000FF'><u>void</u></font> <b><a name='save_png'></a>save_png</b> <font face='Lucida Console'>(</font> <font color='#0000FF'>const</font> image_type<font color='#5555FF'>&</font> image, <font color='#0000FF'>const</font> std::string<font color='#5555FF'>&</font> file_name <font face='Lucida Console'>)</font>; <font color='#009900'>/*! requires - image_type == an image object that implements the interface defined in dlib/image_processing/generic_image.h or a matrix expression - image.size() != 0 ensures - writes the image to the file indicated by file_name in the PNG (Portable Network Graphics) format. - image[0][0] will be in the upper left corner of the image. - image[image.nr()-1][image.nc()-1] will be in the lower right corner of the image. - This routine can save images containing any type of pixel. However, save_png() can only natively store the following pixel types: rgb_pixel, rgb_alpha_pixel, uint8, and uint16. All other pixel types will be converted into one of these types as appropriate before being saved to disk. throws - image_save_error This exception is thrown if there is an error that prevents us from saving the image. - std::bad_alloc !*/</font> <font color='#009900'>// ---------------------------------------------------------------------------------------- </font> <b>}</b> <font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_SAVE_PnG_ABSTRACT_ </font> </pre></body></html>