UVImage.cs 799 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace bbiwarg.Images
  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 int getWidth()
  19. {
  20. return width;
  21. }
  22. public int getHeight()
  23. {
  24. return height;
  25. }
  26. public float getU(int x, int y)
  27. {
  28. return data[2 * (y * width + x) + 0];
  29. }
  30. public float getV(int x, int y)
  31. {
  32. return data[2 * (y * width + x) + 1];
  33. }
  34. }
  35. }