Clone of mesa.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

imagesgi.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /******************************************************************************
  2. ** Filename : imageSgi.h
  3. ** UNCLASSIFIED
  4. **
  5. ** Description : Utility to read SGI image format files. This code was
  6. ** originally a SGI image loading utility provided with the
  7. ** Mesa 3D library @ http://www.mesa3d.org by Brain Paul.
  8. ** This has been extended to read all SGI image formats
  9. ** (e.g. INT, INTA, RGB, RGBA).
  10. **
  11. ** Revision History:
  12. ** Date Name Description
  13. ** 06/08/99 BRC Initial Release
  14. **
  15. ******************************************************************************/
  16. #ifndef __IMAGESGI_H
  17. #define __IMAGESGI_H
  18. #define IMAGE_SGI_TYPE_VERBATIM 0
  19. #define IMAGE_SGI_TYPE_RLE 1
  20. struct sImageSgiHeader // 512 bytes
  21. {
  22. short magic; // IRIS image file magic number (474)
  23. char type; // Storage format (e.g. RLE or VERBATIM)
  24. char numBytesPerPixelChannel; // Number of bytes per pixel channel
  25. unsigned short dim; // Number of dimensions (1 to 3)
  26. unsigned short xsize; // Width (in pixels)
  27. unsigned short ysize; // Height (in pixels)
  28. unsigned short zsize; // Number of channels (1 to 4)
  29. int minimumPixelValue; // Minimum pixel value (0 to 255)
  30. int maximumPixelValue; // Maximum pixel value (0 to 255)
  31. char padding1[4]; // (ignored)
  32. char imageName[80]; // Image name
  33. int colormap; // colormap ID (0=normal, 0=dithered,
  34. // 2=screen, 3=colormap)
  35. char padding2[404]; // (ignored)
  36. };
  37. struct sImageSgi
  38. {
  39. struct sImageSgiHeader header;
  40. unsigned char *data;
  41. };
  42. #ifndef __IMAGESGI_CPP
  43. // RGB image load utility
  44. extern struct sImageSgi *ImageSgiOpen(char const * const fileName);
  45. extern void ImageSgiClose(struct sImageSgi *image);
  46. #endif
  47. #endif /* __IMAGESGI_H */