VidDisplayEngine.cs 903 B

1234567891011121314151617181920212223242526272829303132333435
  1. namespace fis.Vid
  2. {
  3. class VidDisplayEngine:IDisplayEngine
  4. {
  5. private readonly VinnoImageData _imageData;
  6. public int ImageCount { get; }
  7. public byte[] BasicData { get; }
  8. public byte[] ExtendedData { get; }
  9. public VidDisplayEngine(string filePath)
  10. {
  11. _imageData = new VinnoImageData(filePath, OperationMode.Open);
  12. ImageCount = _imageData.ImageCount;
  13. BasicData = _imageData.Probe?.ToBytes();
  14. ExtendedData = _imageData.ExtendedData;
  15. }
  16. public void Close()
  17. {
  18. _imageData.Dispose();
  19. }
  20. public byte[] GetImageData(int index)
  21. {
  22. var vinnoImage = _imageData.GetImage(index);
  23. if (vinnoImage != null)
  24. {
  25. return vinnoImage.ToBytes();
  26. }
  27. return new byte[0];
  28. }
  29. }
  30. }