release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Search | Go
Wiki > Main > PluginIndex > PluginLua > PluginLuaRLImage

PluginLuaRLImage library

Introduction

Rlimage Adds a sane way to access each pixel of image data

Functions

Function Arguments Comments
img:clear ([color],[x1],[y1],[x2],[y2]) set whole image or a portion to a particular value
img:invert ([x1],[y1],[x2],[y2]) inverts whole image or a portion
img:marshal ([x1],[y1],[x2],[y2],[funct]) calls funct for each point defined by rect of x1,y1 x2,y2 returns value and allows setting value of each point
return nil to terminate early
img:points ([x1],[y1],[x2],[y2],[dx],[dy]) returns iterator function that steps delta-x and delta-y pixels each call
returns value of pixel each call but doesn't allow setting to a new value
compare to lua pairs method
img:copy (src,[x1],[y1],[x2],[y2],[w],[h],[clip][operation][clr/funct]) copies all or part of an image straight copy or special operation
optionally calls funct for each point defined by rect of x1, y1, w, h and x2, y2, w, h for dest and src images
returns value of dst and src and allows setting value of each point
return nil to terminate early
img:line (x1, y1, x2, y2, color) draws a line
img:ellipse (x1, y1, x2, y2, color, [fillcolor] draws an ellipse
rb.new_image ([w], [h]) if width or height omitted screen width/height will be used

Examples

see rlimg.lua in 'plugins/demos/lua_scripts'

-- WilliamWilgus? - 02 Aug 2019
r3 - 04 Aug 2019 - 14:58:32 - WilliamWilgus?

Copyright by the contributing authors.