home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / programs / documentation / lightwave / sdk / include / image.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-01  |  2.2 KB  |  68 lines

  1. /*
  2.  * LWSDK Header File
  3.  * Copyright 1995  NewTek, Inc.
  4.  */
  5. #ifndef TOOLS_IMAGE_H
  6. #define TOOLS_IMAGE_H
  7.  
  8. #include <moni.h>
  9.  
  10. typedef unsigned char            ImageValue;
  11. typedef union un_ImageProtocol  *ImageProtocolID;
  12. typedef struct st_ImLoaderLocal {
  13.     void             *priv_data;
  14.     int               result;
  15.     const char       *filename;
  16.     Monitor          *monitor;
  17.     ImageProtocolID (*begin) (void *, int type);
  18.     void            (*done) (void *, ImageProtocolID);
  19. } ImLoaderLocal;
  20. typedef struct st_ImSaverLocal {
  21.     void            *priv_data;
  22.     int              result;
  23.     int              type;
  24.     const char      *filename;
  25.     Monitor         *monitor;
  26.     int            (*sendData) (void *, ImageProtocolID, int);
  27. } ImSaverLocal;
  28. typedef struct st_ColorProtocol {
  29.     int              type;
  30.     void            *priv_data;
  31.     void           (*setSize) (void *, int, int, int);
  32.     int            (*sendLine) (void *, int, const ImageValue *,
  33.                     const ImageValue *);
  34.     int            (*done) (void *, int);
  35. } ColorProtocol;
  36. typedef struct st_IndexProtocol {
  37.     int              type;
  38.     void            *priv_data;
  39.     void           (*setSize) (void *, int, int, int);
  40.     void           (*numColors) (void *, int);
  41.     void           (*setMap) (void *, int, const ImageValue[3]);
  42.     int            (*sendLine) (void *, int, const ImageValue *,
  43.                     const ImageValue *);
  44.     int            (*done) (void *, int);
  45. } IndexProtocol;
  46. typedef union un_ImageProtocol {
  47.     int              type;
  48.     ColorProtocol    color;
  49.     IndexProtocol    index;
  50. } ImageProtocol;
  51. #define IMG_RGB24       0
  52. #define IMG_GREY8       1
  53. #define IMG_INDEX8      2
  54. #define IPSTAT_OK                0
  55. #define IPSTAT_NOREC             1
  56. #define IPSTAT_BADFILE           2
  57. #define IPSTAT_ABORT             3
  58. #define IPSTAT_FAILED           99
  59. #define IMGF_ALPHA               1
  60. #define IMGF_REVERSE             2
  61. #define IP_SETSIZE(p,w,h,f)     (*(p)->setSize) ((p)->priv_data,w,h,f)
  62. #define IP_NUMCOLORS(p,n)       (*(p)->numColors) ((p)->priv_data,n)
  63. #define IP_SETMAP(p,i,val)      (*(p)->setMap) ((p)->priv_data,i,val)
  64. #define IP_SENDLINE(p,ln,d,a)   (*(p)->sendLine) ((p)->priv_data,ln,d,a)
  65. #define IP_DONE(p,err)          (*(p)->done) ((p)->priv_data,err)
  66.  
  67. #endif
  68.