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.
 
 
 
 
 
 

79 lines
2.3 KiB

  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. #define SET_FLAG_8BIT 0x00000004
  22. /* pipi_image_t: the image structure. This is probably going to be the most
  23. * complex structure in the library, but right now it only has fairly normal
  24. * stuff, like width and height and pointers to pixel areas. */
  25. struct pipi_image
  26. {
  27. int w, h, pitch;
  28. /* A list of internal image flags.
  29. * wrap: should filters wrap around at edges?
  30. * u8: are the image samples still 8-bit per channel? */
  31. int wrap, u8;
  32. /* Translation vectors for wrap around and tiling. */
  33. int wrapx1, wrapy1, wrapx2, wrapy2;
  34. /* List of all possible pixel formats and the last active one. */
  35. pipi_pixels_t p[PIPI_PIXELS_MAX];
  36. pipi_format_t last_modified;
  37. /* Private data used by the codec */
  38. pipi_format_t codec_format;
  39. void *codec_priv;
  40. };
  41. struct pipi_context
  42. {
  43. int nimages;
  44. pipi_image_t *images[1024]; /* FIXME: do dynamic allocation */
  45. };
  46. #ifdef USE_IMLIB2
  47. pipi_image_t *pipi_load_imlib2(const char *name);
  48. pipi_image_t *pipi_new_imlib2(int width, int height);
  49. void pipi_free_imlib2(pipi_image_t *img);
  50. void pipi_save_imlib2(pipi_image_t *img, const char *name);
  51. #endif
  52. #ifdef USE_OPENCV
  53. pipi_image_t *pipi_load_opencv(const char *name);
  54. pipi_image_t *pipi_new_opencv(int width, int height);
  55. void pipi_free_opencv(pipi_image_t *img);
  56. void pipi_save_opencv(pipi_image_t *img, const char *name);
  57. #endif
  58. #ifdef USE_SDL
  59. pipi_image_t *pipi_load_sdl(const char *name);
  60. pipi_image_t *pipi_new_sdl(int width, int height);
  61. void pipi_free_sdl(pipi_image_t *img);
  62. void pipi_save_sdl(pipi_image_t *img, const char *name);
  63. #endif
  64. #endif /* __PIPI_INTERNALS_H__ */