/decoders/image/decoder.d

http://github.com/wilkie/djehuty · D · 33 lines · 26 code · 7 blank · 0 comment · 0 complexity · 63c7e0678343ac6d3ea10f4380a768a1 MD5 · raw file

  1. module decoders.image.decoder;
  2. import graphics.bitmap;
  3. import core.string;
  4. import core.stream;
  5. import core.color;
  6. import core.definitions;
  7. import decoders.decoder;
  8. struct ImageFrameDescription {
  9. uint time; //time till the display of the next image
  10. uint xoffset; //the x offset of the image within the main image
  11. uint yoffset; //the y offset of the image within the main image
  12. uint clearFirst; //whether or not to clear the image prior to drawing next frame
  13. Color clearColor; //the color to use when clearing
  14. }
  15. abstract class ImageDecoder : Decoder {
  16. public:
  17. StreamData decode(Stream stream, ref Bitmap view) {
  18. return StreamData.Invalid;
  19. }
  20. StreamData decodeFrame(Stream stream, ref Bitmap view, ref ImageFrameDescription imageDesc) {
  21. return StreamData.Invalid;
  22. }
  23. override string name() {
  24. return "Unknown Image Decoder";
  25. }
  26. }