getPixel.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. return {
  2. summary = 'Get the value of a pixel of the TextureData.',
  3. description = 'Returns the value of a pixel of the TextureData.',
  4. arguments = {
  5. {
  6. name = 'x',
  7. type = 'number',
  8. description = 'The x coordinate of the pixel to get (0-indexed).'
  9. },
  10. {
  11. name = 'y',
  12. type = 'number',
  13. description = 'The y coordinate of the pixel to get (0-indexed).'
  14. }
  15. },
  16. returns = {
  17. {
  18. name = 'r',
  19. type = 'number',
  20. description = 'The red component of the pixel, from 0.0 to 1.0.'
  21. },
  22. {
  23. name = 'g',
  24. type = 'number',
  25. description = 'The green component of the pixel, from 0.0 to 1.0.'
  26. },
  27. {
  28. name = 'b',
  29. type = 'number',
  30. description = 'The blue component of the pixel, from 0.0 to 1.0.'
  31. },
  32. {
  33. name = 'a',
  34. type = 'number',
  35. description = 'The alpha component of the pixel, from 0.0 to 1.0.'
  36. }
  37. },
  38. notes = [[
  39. The following texture formats are supported: `rgba`, `rgb`, `r32f`, `rg32f`, and `rgba32f`.
  40. ]],
  41. related = {
  42. 'TextureData:setPixel',
  43. 'Texture:replacePixels',
  44. 'TextureFormat'
  45. }
  46. }