Open Source Tomb Raider Engine
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.

png.h 910B

1234567891011121314151617181920212223242526272829303132
  1. /*!
  2. * \file include/utils/png.h
  3. * \brief PNG image reader
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _UTILS_PNG_H_
  8. #define _UTILS_PNG_H_
  9. /*!
  10. * \brief Load a PNG image file into an RGBA buffer
  11. * \param filename path of file to read
  12. * \param image place where allocated buffer of size (width * height * 4) will be allocated
  13. * \param width place where image width will be stored
  14. * \param height place where image height will be stored
  15. * \returns 0 on success
  16. */
  17. int pngLoad(const char *filename, unsigned char **image, unsigned int *width, unsigned int *height);
  18. /*!
  19. * \brief Create a PNG image file from an RGBA buffer
  20. * \param filename path of file to create
  21. * \param image buffer of size (width * height * 4)
  22. * \param width image width
  23. * \param height image height
  24. * \returns 0 on success
  25. */
  26. int pngSave(const char *filename, unsigned char *image, unsigned int width, unsigned int height);
  27. #endif