From d577d991b97ae2b5ee1af23641bcffc3f83af5b2 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 4 Nov 2009 11:56:41 -0800 Subject: Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux. --- cd/test/lua/imagergb.wlua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 cd/test/lua/imagergb.wlua (limited to 'cd/test/lua/imagergb.wlua') diff --git a/cd/test/lua/imagergb.wlua b/cd/test/lua/imagergb.wlua new file mode 100755 index 0000000..b7c6f11 --- /dev/null +++ b/cd/test/lua/imagergb.wlua @@ -0,0 +1,35 @@ +require("iupcdaux") -- utility module used in some samples + +w = 100 +h = 100 + +image_rgb = cd.CreateImageRGB(w, h) + +size = w * h +i = 0 +while i < size do + + if i < size/2 then + image_rgb.r[i] = 255 + image_rgb.g[i] = 0 + image_rgb.b[i] = 0 + else + image_rgb.r[i] = 0 + image_rgb.g[i] = 0 + image_rgb.b[i] = 255 + end + + i = i + 1 +end + +dlg = iupcdaux.new_dialog(w, h) +cnv = dlg[1] -- retrieve the IUP canvas + +-- custom function used in action callback +-- from the iupcdaux module +function cnv:Draw(canvas) + canvas:PutImageRectRGB(image_rgb, 0, 0, w, h, 0, 0, 0, 0) +end + +dlg:show() +iup.MainLoop() -- cgit v1.2.3