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.9 KiB

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