getPixel.lua 1.2 KB

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