• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/png.h

Go to the documentation of this file.
00001 /*
00002  * PNG image format
00003  * Copyright (c) 2003 Fabrice Bellard
00004  *
00005  * This file is part of FFmpeg.
00006  *
00007  * FFmpeg is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * FFmpeg is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with FFmpeg; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00020  */
00021 
00022 #ifndef AVCODEC_PNG_H
00023 #define AVCODEC_PNG_H
00024 
00025 #include <stdint.h>
00026 
00027 #define PNG_COLOR_MASK_PALETTE    1
00028 #define PNG_COLOR_MASK_COLOR      2
00029 #define PNG_COLOR_MASK_ALPHA      4
00030 
00031 #define PNG_COLOR_TYPE_GRAY 0
00032 #define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)
00033 #define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)
00034 #define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)
00035 #define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)
00036 
00037 #define PNG_FILTER_TYPE_LOCO   64
00038 #define PNG_FILTER_VALUE_NONE  0
00039 #define PNG_FILTER_VALUE_SUB   1
00040 #define PNG_FILTER_VALUE_UP    2
00041 #define PNG_FILTER_VALUE_AVG   3
00042 #define PNG_FILTER_VALUE_PAETH 4
00043 #define PNG_FILTER_VALUE_MIXED 5
00044 
00045 #define PNG_IHDR      0x0001
00046 #define PNG_IDAT      0x0002
00047 #define PNG_ALLIMAGE  0x0004
00048 #define PNG_PLTE      0x0008
00049 
00050 #define NB_PASSES 7
00051 
00052 extern const uint8_t ff_pngsig[8];
00053 extern const uint8_t ff_mngsig[8];
00054 
00055 /* Mask to determine which y pixels are valid in a pass */
00056 extern const uint8_t ff_png_pass_ymask[NB_PASSES];
00057 
00058 /* minimum x value */
00059 extern const uint8_t ff_png_pass_xmin[NB_PASSES];
00060 
00061 /* x shift to get row width */
00062 extern const uint8_t ff_png_pass_xshift[NB_PASSES];
00063 
00064 /* Mask to determine which pixels are valid in a pass */
00065 extern const uint8_t ff_png_pass_mask[NB_PASSES];
00066 
00067 void *ff_png_zalloc(void *opaque, unsigned int items, unsigned int size);
00068 
00069 void ff_png_zfree(void *opaque, void *ptr);
00070 
00071 int ff_png_get_nb_channels(int color_type);
00072 
00073 /* compute the row size of an interleaved pass */
00074 int ff_png_pass_row_size(int pass, int bits_per_pixel, int width);
00075 
00076 void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp);
00077 
00078 #endif /* AVCODEC_PNG_H */

Generated on Fri Sep 16 2011 17:17:41 for FFmpeg by  doxygen 1.7.1