il_pic.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //-----------------------------------------------------------------------------
  2. //
  3. // ImageLib Sources
  4. // Copyright (C) 2000-2002 by Denton Woods
  5. // Last modified: 05/21/2002 <--Y2K Compliant! =]
  6. //
  7. // Filename: src-IL/include/il_pic.h
  8. //
  9. // Description: Softimage Pic (.pic) functions
  10. //
  11. //-----------------------------------------------------------------------------
  12. #ifndef PIC_H
  13. #define PIC_H
  14. #include "il_internal.h"
  15. #ifdef _MSC_VER
  16. #pragma pack(push, packed_struct, 1)
  17. #endif
  18. typedef struct PIC_HEAD
  19. {
  20. ILint Magic; // PIC_MAGIC_NUMBER
  21. ILfloat Version; // Version of format
  22. ILbyte Comment[80]; // Prototype description
  23. ILbyte Id[4]; // 'PICT'
  24. ILshort Width; // Image width, in pixels
  25. ILshort Height; // Image height, in pixels
  26. ILfloat Ratio; // Pixel aspect ratio
  27. ILshort Fields; // Picture field type
  28. ILshort Padding; // Unused
  29. } IL_PACKSTRUCT PIC_HEAD;
  30. typedef struct CHANNEL
  31. {
  32. ILubyte Size;
  33. ILubyte Type;
  34. ILubyte Chan;
  35. void *Next;
  36. } CHANNEL;
  37. #ifdef _MSC_VER
  38. #pragma pack(pop, packed_struct)
  39. #endif
  40. // Data type
  41. #define PIC_UNSIGNED_INTEGER 0x00
  42. #define PIC_SIGNED_INTEGER 0x10 // XXX: Not implemented
  43. #define PIC_SIGNED_FLOAT 0x20 // XXX: Not implemented
  44. // Compression type
  45. #define PIC_UNCOMPRESSED 0x00
  46. #define PIC_PURE_RUN_LENGTH 0x01
  47. #define PIC_MIXED_RUN_LENGTH 0x02
  48. // CHANNEL types (OR'd)
  49. #define PIC_RED_CHANNEL 0x80
  50. #define PIC_GREEN_CHANNEL 0x40
  51. #define PIC_BLUE_CHANNEL 0x20
  52. #define PIC_ALPHA_CHANNEL 0x10
  53. #define PIC_SHADOW_CHANNEL 0x08 // XXX: Not implemented
  54. #define PIC_DEPTH_CHANNEL 0x04 // XXX: Not implemented
  55. #define PIC_AUXILIARY_1_CHANNEL 0x02 // XXX: Not implemented
  56. #define PIC_AUXILIARY_2_CHANNEL 0x01 // XXX: Not implemented
  57. ILboolean iIsValidPic(void);
  58. ILboolean iCheckPic(PIC_HEAD *Header);
  59. ILboolean iLoadPicInternal(void);
  60. ILboolean readScanlines(ILuint *image, ILint width, ILint height, CHANNEL *channel, ILuint alpha);
  61. ILuint readScanline(ILubyte *scan, ILint width, CHANNEL *channel, ILint bytes);
  62. ILboolean channelReadRaw(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes);
  63. ILboolean channelReadPure(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes);
  64. ILboolean channelReadMixed(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes);
  65. #endif//PIC_H