DepthImage.cs 684 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace bbiwarg
  7. {
  8. class DepthImage
  9. {
  10. private int width, height;
  11. private ushort[] data;
  12. public DepthImage(int width, int height, ushort[] data)
  13. {
  14. this.width = width;
  15. this.height = height;
  16. this.data = data;
  17. }
  18. public int getWidth()
  19. {
  20. return width;
  21. }
  22. public int getHeight()
  23. {
  24. return height;
  25. }
  26. public ushort getDepth(int x, int y)
  27. {
  28. return data[y * width + x];
  29. }
  30. }
  31. }