Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*******************************************************************************
- *
- * png_rgba.h : PNG file I/O in (8) bits per channel RGBA format:
- *
- * Copyright (c) Brett Hale 2008, 2012. Public Domain.
- *
- *******************************************************************************/
- #ifndef _PNG_RGBA_H
- #define _PNG_RGBA_H
- #if defined (__cplusplus) /* ISO C declaration scope: */
- #define _PNG_RGBA_INIT_DECL extern "C" {
- #define _PNG_RGBA_FINI_DECL }
- #else
- #define _PNG_RGBA_INIT_DECL
- #define _PNG_RGBA_FINI_DECL
- #endif /* defined (__cplusplus) */
- #include <stddef.h>
- #include <stdlib.h>
- #include <stdio.h> /* ISO C : standard I/O library. */
- _PNG_RGBA_INIT_DECL
- /******************************************************************************/
- /* load a PNG image using an opened file stream. return the image data
- * as a (malloc) allocated RGBA image buffer, with the width: (w), and
- * height: (h). return (0) on success: */
- /* if the operation fails, then the dimensions are set to (0), and the
- * buffer is set to (NULL). */
- /* the operation fails if the image has zero area, or if the number of
- * pixels exceeds PNG_RGBA_PIXEL_LIMIT. */
- /* asserts that 'unsigned int' has a width of at least 32 bits. */
- #define PNG_RGBA_PIXEL_LIMIT (0x1000000)
- int png_rgba_load (FILE *, unsigned *w, unsigned *h, unsigned char **);
- /******************************************************************************/
- /* save an RGBA image buffer, with the width: (w), and height: (h), as
- * a PNG image, using an opened file stream. return (0) on success: */
- /* the operation fails if the image has zero area, or if the number of
- * pixels exceeds PNG_RGBA_PIXEL_LIMIT. */
- /* asserts that 'unsigned int' has a width of at least 32 bits. */
- int png_rgba_save (FILE *, unsigned w, unsigned h, const unsigned char *);
- /******************************************************************************/
- _PNG_RGBA_FINI_DECL
- #endif /* _PNG_RGBA_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement