setPixel.lua 1.3 KB

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