-- ImageEn Processing lua wrapper
-- TEST SCRIPT!
-- VERY FAST!
-- This script show some functionalites of ImageEnProc component
-- which is a part of ImageEn component set for Delphi/C++ Builder:
-- http://www.imageen.com/  
-- procBumMap is set by default (uncommented)
-- author: Siniša Petrić http://www.sigmapi-design.com, 2014

-- init images/process objects
imgA = TLuaImageWrap(inputImage)
imgB = TLuaImageWrap(outputImage)
proC = TLuaProcessWrap(procObj)

--get image size
iWidth, iHeight = imgB:GetImageSize() 
 
--1. adjust color tint
--calling: procAdjustTint(amount) 
--parameters: amount [-180, 180]
--uncomment following line to execute 
--imgB:procAdjustTint(-100)

--2. bump mapping
--calling: procBumpMap(lightX, lightY, lampX, lampY, perc, blue, green, red)
--paremeters: lightX, lightY (position), lampX, lampY (lamp size),
--            perc (percentage of original image),
--            blue, green, red (color channels value)
--uncomment following line to execute
imgB:procBumpMap( iWidth/2, iHeight/2, iWidth/2, iHeight/2, 20, 20, 250, 250)  

--3. lens
--calling: procLens(cx, cy, width, height, refraction)
--parameters: cx, cy (position), width, height (lens size), refraction
--uncomment following line to execute 
--imgB:procLens(iWidth/2, iHeight/2, 500, 500, 1.8)

--4. shift channel
--calling: procShiftChannel(offsetX, offsetY, channel, fillValue)
--parameters: offsetX, offsetY (offset), channel (b = 0, g = 1, r = 2)
--            fillValue [0, 255]      
--uncomment following line to execute 
--imgB:procShiftChannel(-2, -1, 0, 0)


proC:ShowProgress(100,100)     