Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
3.2 KiB

  1. /*---------------------------------------------------------------------------
  2. rpng - simple PNG display program readpng.h
  3. ---------------------------------------------------------------------------
  4. Copyright (c) 1998-2007 Greg Roelofs. All rights reserved.
  5. This software is provided "as is," without warranty of any kind,
  6. express or implied. In no event shall the author or contributors
  7. be held liable for any damages arising in any way from the use of
  8. this software.
  9. The contents of this file are DUAL-LICENSED. You may modify and/or
  10. redistribute this software according to the terms of one of the
  11. following two licenses (at your option):
  12. LICENSE 1 ("BSD-like with advertising clause"):
  13. Permission is granted to anyone to use this software for any purpose,
  14. including commercial applications, and to alter it and redistribute
  15. it freely, subject to the following restrictions:
  16. 1. Redistributions of source code must retain the above copyright
  17. notice, disclaimer, and this list of conditions.
  18. 2. Redistributions in binary form must reproduce the above copyright
  19. notice, disclaimer, and this list of conditions in the documenta-
  20. tion and/or other materials provided with the distribution.
  21. 3. All advertising materials mentioning features or use of this
  22. software must display the following acknowledgment:
  23. This product includes software developed by Greg Roelofs
  24. and contributors for the book, "PNG: The Definitive Guide,"
  25. published by O'Reilly and Associates.
  26. LICENSE 2 (GNU GPL v2 or later):
  27. This program is free software; you can redistribute it and/or modify
  28. it under the terms of the GNU General Public License as published by
  29. the Free Software Foundation; either version 2 of the License, or
  30. (at your option) any later version.
  31. This program is distributed in the hope that it will be useful,
  32. but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. GNU General Public License for more details.
  35. You should have received a copy of the GNU General Public License
  36. along with this program; if not, write to the Free Software Foundation,
  37. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  38. ---------------------------------------------------------------------------*/
  39. #ifndef TRUE
  40. # define TRUE 1
  41. # define FALSE 0
  42. #endif
  43. #ifndef MAX
  44. # define MAX(a,b) ((a) > (b)? (a) : (b))
  45. # define MIN(a,b) ((a) < (b)? (a) : (b))
  46. #endif
  47. #ifdef DEBUG
  48. # define Trace(x) {fprintf x ; fflush(stderr); fflush(stdout);}
  49. #else
  50. # define Trace(x) ;
  51. #endif
  52. typedef unsigned char uch;
  53. typedef unsigned short ush;
  54. typedef unsigned long ulg;
  55. /* prototypes for public functions in readpng.c */
  56. void readpng_version_info(void);
  57. int readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight);
  58. int readpng_get_bgcolor(uch *bg_red, uch *bg_green, uch *bg_blue);
  59. uch *readpng_get_image(double display_exponent, int *pChannels,
  60. ulg *pRowbytes);
  61. void readpng_cleanup(int free_image_data);