UVImage.cs 647 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace bbiwarg.DataSource
  7. {
  8. class UVImage
  9. {
  10. private int width, height;
  11. private float[] data;
  12. public UVImage(int width, int height, float[] data)
  13. {
  14. this.width = width;
  15. this.height = height;
  16. this.data = data;
  17. }
  18. public float getU(int x, int y)
  19. {
  20. return data[2 * (y * width + x) + 0];
  21. }
  22. public float getV(int x, int y)
  23. {
  24. return data[2 * (y * width + x) + 1];
  25. }
  26. }
  27. }