lwimage.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * LWSDK Header File
  3. * Copyright 1999, NewTek, Inc.
  4. *
  5. * LWIMAGE.H -- LightWave Images
  6. */
  7. #ifndef LWSDK_IMAGE_H
  8. #define LWSDK_IMAGE_H
  9. #include <lwtypes.h>
  10. #include <lwimageio.h>
  11. #include <lwio.h>
  12. #define LWIMAGELIST_GLOBAL "LW Image List 3"
  13. #define LWIMAGEUTIL_GLOBAL "Image Utility"
  14. typedef struct st_LWImageList {
  15. LWImageID (*first) (void);
  16. LWImageID (*next) (LWImageID);
  17. LWImageID (*load) (const char *);
  18. const char * (*name) (LWImageID);
  19. const char * (*filename) (LWImageID, LWFrame);
  20. int (*isColor) (LWImageID);
  21. void (*needAA) (LWImageID);
  22. void (*size) (LWImageID, int *w, int *h);
  23. LWBufferValue (*luma) (LWImageID, int x, int y);
  24. void (*RGB) (LWImageID, int x, int y, LWBufferValue[3]);
  25. double (*lumaSpot) (LWImageID, double x, double y,
  26. double spotSize, int blend);
  27. void (*RGBSpot) (LWImageID, double x, double y,
  28. double spotSize, int blend, double[3]);
  29. void (*clear) (LWImageID);
  30. LWImageID (*sceneLoad) (const LWLoadState *);
  31. void (*sceneSave) (const LWSaveState *, LWImageID);
  32. int (*hasAlpha) (LWImageID);
  33. LWBufferValue (*alpha) (LWImageID, int x, int y);
  34. double (*alphaSpot) (LWImageID, double x, double y,
  35. double spotSize, int blend);
  36. LWPixmapID (*evaluate) (LWImageID, LWTime t);
  37. } LWImageList;
  38. typedef struct st_LWImageUtil {
  39. LWPixmapID (*create) (int w, int h, LWImageType type);
  40. void (*destroy) (LWPixmapID img);
  41. int (*save) (LWPixmapID img, int saver,const char *name);
  42. void (*setPixel) (LWPixmapID img, int x, int y, void *pix);
  43. void (*getPixel) (LWPixmapID img, int x, int y, void *pix);
  44. void (*getInfo) (LWPixmapID img, int *w, int *h, int *type);
  45. LWPixmapID (*resample) (LWPixmapID img, int w, int h, int mode);
  46. int (*saverCount) ();
  47. const char * (*saverName) (int saver);
  48. } LWImageUtil;
  49. /* resample modes */
  50. enum {
  51. LWISM_SUBSAMPLING = 0,
  52. LWISM_MEDIAN, /* for shrinking */
  53. LWISM_SUPERSAMPLING,
  54. LWISM_BILINEAR, /* for expanding */
  55. LWISM_BSPLINE, /* for expanding */
  56. LWISM_BICUBIC /* for expanding */
  57. };
  58. #endif