pixelformat.monkey2 739 B

1234567891011121314151617181920212223242526272829303132333435
  1. Namespace std.graphics
  2. #rem monkeydoc Pixel formats supported by pixmaps.
  3. | PixelFormat | Description
  4. |:--------------|:-----------
  5. | `Unknown` | Unknown pixel format.
  6. | `I8` | 8 bit intensity.
  7. | `A8` | 8 bit alpha.
  8. | `IA16` | 8 bit intensity, alpha.
  9. | `RGB24` | 8 bit red, green, blue.
  10. | `RGBA32` | 8 bit red, green, blue, alpha.
  11. #end
  12. Enum PixelFormat
  13. Unknown,I8,A8,IA16,RGB24,RGBA32
  14. End
  15. #rem monkeydoc Gets the number of bytes per pixel for a particular pixel format.
  16. #end
  17. Function PixelFormatDepth:Int( format:PixelFormat )
  18. Select format
  19. Case PixelFormat.I8 Return 1
  20. Case PixelFormat.A8 Return 1
  21. Case PixelFormat.IA16 Return 2
  22. Case PixelFormat.RGB24 Return 3
  23. Case PixelFormat.RGBA32 Return 4
  24. End
  25. Return 0
  26. End