1 /*****************************************************************************
2 * Dump an Image to a Portable Network Graphics (PNG) file
3 ****************************************************************************
4 Copyright (C) 2004 VideoLAN
5 Author: Rocky Bernstein
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
20 *****************************************************************************/
25 Dump an image to a Portable Network Graphics (PNG) file. File_name
26 is where the file goes, i_height and i_width are the height and
27 width in pixels of the image. The data for the image is stored as a
28 linear array RGB pixel entries: one byte for each of red, green,
29 and blue component. Thus row[i] will begin at rgb_image +
30 i*(i_width*3) and the blue pixel at image[i][0] would be rgb_image
33 text_ptr contains comments that can be written to the image. It can
34 be null. i_text_count is the number of entries in text_ptr.
37 void write_png(const char *file_name, png_uint_32 i_height,
38 png_uint_32 i_width, void *rgb_image,
39 /*in*/ png_text *text_ptr, int i_text_count );