Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

67 wiersze
1.3 KiB

  1. /*
  2. * libpipi Pathetic image processing interface library
  3. * Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org>
  4. * 2008 Jean-Yves Lamoureux <jylam@lnxscene.org>
  5. * All Rights Reserved
  6. *
  7. * $Id$
  8. *
  9. * This library is free software. It comes without any warranty, to
  10. * the extent permitted by applicable law. You can redistribute it
  11. * and/or modify it under the terms of the Do What The Fuck You Want
  12. * To Public License, Version 2, as published by Sam Hocevar. See
  13. * http://sam.zoy.org/wtfpl/COPYING for more details.
  14. */
  15. /*
  16. * accessors.c: accessors for various informations about images
  17. */
  18. #include "config.h"
  19. #include "common.h"
  20. #include <stdio.h>
  21. #include <stdlib.h>
  22. #include <string.h>
  23. #include <math.h>
  24. #include "pipi.h"
  25. #include "pipi_internals.h"
  26. int pipi_get_image_width(pipi_image_t *img)
  27. {
  28. return img->w;
  29. }
  30. int pipi_get_image_height(pipi_image_t *img)
  31. {
  32. return img->h;
  33. }
  34. int pipi_get_image_pitch(pipi_image_t *img)
  35. {
  36. return img->pitch;
  37. }
  38. int pipi_get_image_last_modified(pipi_image_t *img)
  39. {
  40. return img->last_modified;
  41. }
  42. char formats[][100] =
  43. {
  44. "Unknow",
  45. "RGBA_C",
  46. "BGR_C",
  47. "RGBA_F",
  48. "Y_F",
  49. "MASK_C",
  50. "LOL",
  51. };
  52. const char* pipi_get_format_name(int format)
  53. {
  54. if(format>PIPI_PIXELS_MAX) return "Invalid";
  55. else return formats[format];
  56. }