pixmap-imp.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright (C) 2004-2024 Artifex Software, Inc.
  2. //
  3. // This file is part of MuPDF.
  4. //
  5. // MuPDF is free software: you can redistribute it and/or modify it under the
  6. // terms of the GNU Affero General Public License as published by the Free
  7. // Software Foundation, either version 3 of the License, or (at your option)
  8. // any later version.
  9. //
  10. // MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
  11. // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. // FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. // details.
  14. //
  15. // You should have received a copy of the GNU Affero General Public License
  16. // along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
  17. //
  18. // Alternative licensing terms are available from the licensor.
  19. // For commercial licensing, see <https://www.artifex.com/> or contact
  20. // Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
  21. // CA 94129, USA, for further information.
  22. #ifndef FITZ_PIXMAP_IMP_H
  23. #define FITZ_PIXMAP_IMP_H
  24. void fz_drop_pixmap_imp(fz_context *ctx, fz_storable *pix);
  25. void fz_premultiply_pixmap(fz_context *ctx, fz_pixmap *pix);
  26. typedef struct fz_scale_cache fz_scale_cache;
  27. fz_scale_cache *fz_new_scale_cache(fz_context *ctx);
  28. void fz_drop_scale_cache(fz_context *ctx, fz_scale_cache *cache);
  29. fz_pixmap *fz_scale_pixmap_cached(fz_context *ctx, const fz_pixmap *src, float x, float y, float w, float h, const fz_irect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y);
  30. void fz_subsample_pixblock(unsigned char *s, int w, int h, int n, int factor, ptrdiff_t stride);
  31. fz_irect fz_pixmap_bbox_no_ctx(const fz_pixmap *src);
  32. void fz_decode_indexed_tile(fz_context *ctx, fz_pixmap *pix, const float *decode, int maxval);
  33. void fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char *src, int n, int depth, size_t stride, int scale);
  34. fz_pixmap *fz_new_pixmap_from_8bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);
  35. fz_pixmap *fz_new_pixmap_from_1bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);
  36. fz_pixmap *fz_new_pixmap_from_float_data(fz_context *ctx, fz_colorspace *cs, int w, int h, float *sp);
  37. #ifdef HAVE_VALGRIND
  38. int fz_valgrind_pixmap(const fz_pixmap *pix);
  39. #else
  40. #define fz_valgrind_pixmap(pix) do {} while (0)
  41. #endif
  42. /*
  43. Convert a region of the src pixmap into the dst pixmap
  44. via an optional proofing colorspace, prf.
  45. We assume that we never map from a DeviceN space to another
  46. DeviceN space here.
  47. */
  48. fz_pixmap *fz_copy_pixmap_area_converting_seps(fz_context *ctx, fz_pixmap *src, fz_pixmap *dst, fz_colorspace *prf, fz_color_params color_params, fz_default_colorspaces *default_cs);
  49. #endif