summaryrefslogtreecommitdiff
path: root/test/lua/render.lua
diff options
context:
space:
mode:
authorscuri <scuri>2008-10-17 06:10:15 +0000
committerscuri <scuri>2008-10-17 06:10:15 +0000
commit5a422aba704c375a307a902bafe658342e209906 (patch)
tree5005011e086bb863d8fb587ad3319bbec59b2447 /test/lua/render.lua
First commit - moving from LuaForge to SourceForge
Diffstat (limited to 'test/lua/render.lua')
-rw-r--r--test/lua/render.lua50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/lua/render.lua b/test/lua/render.lua
new file mode 100644
index 0000000..b57f906
--- /dev/null
+++ b/test/lua/render.lua
@@ -0,0 +1,50 @@
+require"imlua"
+require"imlua_process"
+
+local image = im.ImageCreate(500, 500, im.RGB, im.BYTE)
+
+im.ProcessRenderRandomNoise(image)
+image:Save("render_noise.bmp", "BMP")
+
+im.ProcessRenderConstant(image, { 128.0, 0.0, 255.0 })
+image:Save("render_constant.bmp", "BMP")
+
+im.ProcessRenderWheel(image, 100, 200)
+image:Save("render_wheel.bmp", "BMP")
+
+im.ProcessRenderTent(image, 300, 200)
+image:Save("render_tent.bmp", "BMP")
+
+im.ProcessRenderRamp(image, 0, 500, 0)
+image:Save("render_ramp.bmp", "BMP")
+
+im.ProcessRenderBox(image, 200, 200)
+image:Save("render_box.bmp", "BMP")
+
+im.ProcessRenderSinc(image, 100.0, 100.0)
+image:Save("render_sinc.bmp", "BMP")
+
+im.ProcessRenderGaussian(image, 100.0)
+image:Save("render_gaussian.bmp", "BMP")
+
+im.ProcessRenderLapOfGaussian(image, 100.0)
+image:Save("render_lapofgaussian.bmp", "BMP")
+
+im.ProcessRenderCosine(image, 100.0, 100.0)
+image:Save("render_cosine.bmp", "BMP")
+
+im.ProcessRenderGrid(image, 100.0, 100.0)
+image:Save("render_grid.bmp", "BMP")
+
+im.ProcessRenderChessboard(image, 100.0, 100.0)
+image:Save("render_chess.bmp", "BMP")
+
+im.ProcessRenderCone(image, 200)
+image:Save("render_cone.bmp", "BMP")
+
+local render_func = function (x, y, d, param)
+ return math.mod(x + y, 256)
+end
+
+im.ProcessRenderOp(image, render_func, "test", {}, 0)
+image:Save("render_func.bmp", "BMP")