function.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef MUPDF_FITZ_FUNCTION_H
  2. #define MUPDF_FITZ_FUNCTION_H
  3. #include "mupdf/fitz/system.h"
  4. #include "mupdf/fitz/context.h"
  5. #include "mupdf/fitz/store.h"
  6. #include "mupdf/fitz/colorspace.h"
  7. /*
  8. * The generic function support.
  9. */
  10. typedef struct fz_function_s fz_function;
  11. void fz_eval_function(fz_context *ctx, fz_function *func, const float *in, int inlen, float *out, int outlen);
  12. fz_function *fz_keep_function(fz_context *ctx, fz_function *func);
  13. void fz_drop_function(fz_context *ctx, fz_function *func);
  14. size_t fz_function_size(fz_context *ctx, fz_function *func);
  15. void fz_print_function(fz_context *ctx, fz_output *out, fz_function *func);
  16. enum
  17. {
  18. FZ_FN_MAXN = FZ_MAX_COLORS,
  19. FZ_FN_MAXM = FZ_MAX_COLORS
  20. };
  21. /*
  22. Structure definition is public so other classes can
  23. derive from it. Do not access the members directly.
  24. */
  25. struct fz_function_s
  26. {
  27. fz_storable storable;
  28. size_t size;
  29. int m; /* number of input values */
  30. int n; /* number of output values */
  31. void (*evaluate)(fz_context *ctx, fz_function *func, const float *in, float *out);
  32. void (*print)(fz_context *ctx, fz_output *out, fz_function *func);
  33. };
  34. #endif