Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

93 Zeilen
2.4 KiB

  1. /*
  2. * libpipi Pathetic image processing interface 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. struct pipi_histogram
  23. {
  24. int r_present, g_present, b_present, y_present;
  25. unsigned int a[256];
  26. unsigned int r[256];
  27. unsigned int g[256];
  28. unsigned int b[256];
  29. unsigned int y[256];
  30. };
  31. /* pipi_image_t: the image structure. This is probably going to be the most
  32. * complex structure in the library, but right now it only has fairly normal
  33. * stuff, like width and height and pointers to pixel areas. */
  34. struct pipi_image
  35. {
  36. int w, h, pitch;
  37. /* A list of internal image flags.
  38. * wrap: should filters wrap around at edges?
  39. * u8: are the image samples still 8-bit per channel? */
  40. int wrap, u8;
  41. /* Translation vectors for wrap around and tiling. */
  42. int wrapx1, wrapy1, wrapx2, wrapy2;
  43. /* List of all possible pixel formats and the last active one. */
  44. pipi_pixels_t p[PIPI_PIXELS_MAX];
  45. pipi_format_t last_modified;
  46. /* Private data used by the codec */
  47. pipi_format_t codec_format;
  48. void *codec_priv;
  49. int (*codec_free)(pipi_image_t *);
  50. };
  51. struct pipi_context
  52. {
  53. int nimages;
  54. pipi_image_t *images[1024]; /* FIXME: do dynamic allocation */
  55. };
  56. #ifdef USE_IMLIB2
  57. pipi_image_t *pipi_load_imlib2(const char *name);
  58. int pipi_save_imlib2(pipi_image_t *img, const char *name);
  59. #endif
  60. #ifdef USE_OPENCV
  61. pipi_image_t *pipi_load_opencv(const char *name);
  62. int pipi_save_opencv(pipi_image_t *img, const char *name);
  63. #endif
  64. #ifdef USE_SDL
  65. pipi_image_t *pipi_load_sdl(const char *name);
  66. int pipi_save_sdl(pipi_image_t *img, const char *name);
  67. #endif
  68. #ifdef USE_GDI
  69. pipi_image_t *pipi_load_gdi(const char *name);
  70. int pipi_save_gdi(pipi_image_t *img, const char *name);
  71. #endif
  72. pipi_image_t *pipi_load_oric(const char *name);
  73. int pipi_save_oric(pipi_image_t *img, const char *name);
  74. #endif /* __PIPI_INTERNALS_H__ */