il_sgi.h
Upload User: wmy0603
Upload Date: 2022-05-02
Package Size: 1808k
Code Size: 2k
Development Platform:

Visual C++

  1. //-----------------------------------------------------------------------------
  2. //
  3. // ImageLib Sources
  4. // Copyright (C) 2000-2002 by Denton Woods
  5. // Last modified: 05/25/2002 <--Y2K Compliant! =]
  6. //
  7. // Filename: src-IL/include/sgi.h
  8. //
  9. // Description: Reads from and writes to SGI graphics files.
  10. //
  11. //-----------------------------------------------------------------------------
  12. #ifndef SGI_H
  13. #define SGI_H
  14. #include "il_internal.h"
  15. typedef struct iSgiHeader
  16. {
  17. ILshort MagicNum; // IRIS image file magic number
  18. ILbyte Storage; // Storage format
  19. ILbyte Bpc; // Number of bytes per pixel channel
  20. ILushort Dim; // Number of dimensions
  21. //  1: single channel, 1 row with XSize pixels
  22. //  2: single channel, XSize*YSize pixels
  23. //  3: ZSize channels, XSize*YSize pixels
  24. ILushort XSize; // X size in pixels
  25. ILushort YSize; // Y size in pixels
  26. ILushort ZSize; // Number of channels
  27. ILint PixMin; // Minimum pixel value
  28. ILint PixMax; // Maximum pixel value
  29. ILint Dummy1; // Ignored
  30. ILbyte Name[80]; // Image name
  31. ILint ColMap; // Colormap ID
  32. ILbyte Dummy[404]; // Ignored
  33. } IL_PACKSTRUCT iSgiHeader;
  34. // Sgi format #define's
  35. #define SGI_VERBATIM 0
  36. #define SGI_RLE 1
  37. #define SGI_MAGICNUM 474
  38. // Sgi colormap types
  39. #define SGI_COLMAP_NORMAL 0
  40. #define SGI_COLMAP_DITHERED 1
  41. #define SGI_COLMAP_SCREEN 2
  42. #define SGI_COLMAP_COLMAP 3
  43. // Internal functions
  44. ILboolean iIsValidSgi(void);
  45. ILboolean iCheckSgi(iSgiHeader *Header);
  46. ILboolean iLoadSgiInternal(void);
  47. ILboolean iSaveSgiInternal(void);
  48. void iExpandScanLine(ILubyte *Dest, ILubyte *Src, ILuint Bpc);
  49. ILint iGetScanLine(ILubyte *ScanLine, iSgiHeader *Head, ILuint Length);
  50. ILint iGetScanLineFast(ILubyte *ScanLine, iSgiHeader *Head, ILuint Length, ILubyte*);
  51. void sgiSwitchData(ILubyte *Data, ILuint SizeOfData);
  52. ILboolean iNewSgi(iSgiHeader *Head);
  53. ILboolean iReadNonRleSgi(iSgiHeader *Head);
  54. ILboolean iReadRleSgi(iSgiHeader *Head);
  55. ILboolean iSaveRleSgi(ILubyte *Data, ILuint w, ILuint h, ILuint numChannels, ILuint bps);
  56. #endif//SGI_H