Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

66 lignes
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 <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <math.h>
  23. #include "pipi.h"
  24. #include "pipi_internals.h"
  25. int pipi_get_image_width(pipi_image_t *img)
  26. {
  27. return img->w;
  28. }
  29. int pipi_get_image_height(pipi_image_t *img)
  30. {
  31. return img->h;
  32. }
  33. int pipi_get_image_pitch(pipi_image_t *img)
  34. {
  35. return img->pitch;
  36. }
  37. int pipi_get_image_last_modified(pipi_image_t *img)
  38. {
  39. return img->last_modified;
  40. }
  41. char formats[][100] =
  42. {
  43. "Unknow",
  44. "RGBA_C",
  45. "BGR_C",
  46. "RGBA_F",
  47. "Y_F",
  48. "MASK_C",
  49. "LOL",
  50. };
  51. const char* pipi_get_format_name(int format)
  52. {
  53. if(format>PIPI_PIXELS_MAX) return "Invalid";
  54. else return formats[format];
  55. }