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.

pipi_internals.h 2.2 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * libpipi Proper image processing implementation library
  3. * Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This library is free software. It comes without any warranty, to
  9. * the extent permitted by applicable law. You can redistribute it
  10. * and/or modify it under the terms of the Do What The Fuck You Want
  11. * To Public License, Version 2, as published by Sam Hocevar. See
  12. * http://sam.zoy.org/wtfpl/COPYING for more details.
  13. */
  14. /*
  15. * pipi_internals.h: internal types
  16. */
  17. #ifndef __PIPI_INTERNALS_H__
  18. #define __PIPI_INTERNALS_H__
  19. #define SET_FLAG_GRAY 0x00000001
  20. #define SET_FLAG_WRAP 0x00000002
  21. /* pipi_image_t: the image structure. This is probably going to be the most
  22. * complex structure in the library, but right now it only has fairly normal
  23. * stuff, like width and height and pointers to pixel areas. */
  24. struct pipi_image
  25. {
  26. int w, h, pitch;
  27. /* A list of internal image flags.
  28. * wrap: should filters wrap around at edges?
  29. * u8: are the image samples still 8-bit per channel? */
  30. int wrap, u8;
  31. /* Translation vectors for wrap around and tiling. */
  32. int wrapx1, wrapy1, wrapx2, wrapy2;
  33. /* List of all possible pixel formats and the last active one. */
  34. pipi_pixels_t p[PIPI_PIXELS_MAX];
  35. pipi_format_t last_modified;
  36. /* Private data used by the codec */
  37. pipi_format_t codec_format;
  38. void *codec_priv;
  39. };
  40. struct pipi_context
  41. {
  42. int nimages;
  43. pipi_image_t *images[1024]; /* FIXME: do dynamic allocation */
  44. };
  45. #ifdef USE_IMLIB2
  46. pipi_image_t *pipi_load_imlib2(const char *name);
  47. pipi_image_t *pipi_new_imlib2(int width, int height);
  48. void pipi_free_imlib2(pipi_image_t *img);
  49. void pipi_save_imlib2(pipi_image_t *img, const char *name);
  50. #endif
  51. #ifdef USE_OPENCV
  52. pipi_image_t *pipi_load_opencv(const char *name);
  53. pipi_image_t *pipi_new_opencv(int width, int height);
  54. void pipi_free_opencv(pipi_image_t *img);
  55. void pipi_save_opencv(pipi_image_t *img, const char *name);
  56. #endif
  57. #ifdef USE_SDL
  58. pipi_image_t *pipi_load_sdl(const char *name);
  59. pipi_image_t *pipi_new_sdl(int width, int height);
  60. void pipi_free_sdl(pipi_image_t *img);
  61. void pipi_save_sdl(pipi_image_t *img, const char *name);
  62. #endif
  63. #endif /* __PIPI_INTERNALS_H__ */