Ningow

Stacker

Dec 14th, 2020
37
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function init()
  2.     setName("Stacker")
  3.     setDesc("Stacks 2 images using black as transparency")
  4.     setSize(80,8+24+64)
  5.     addOutput(24+32)
  6.     addInput("",24+32-24)
  7.     addInput("",24+32+24)
  8. end
  9. -- Ugly way to use channels
  10. function apply()
  11.     math.randomseed (getValue(5,0,0,1))
  12.     x = 0
  13.     y = 0
  14.     tileSize = getTileSize()
  15.     for i=0, tileSize*tileSize-1 do
  16.         x = i%tileSize
  17.         y = math.floor(i/tileSize)
  18.         outr, outg, outb = getValue(1,x,y,1)
  19.         a = outr + outg + outb
  20.         --if a > 0 then
  21.             setPixel(0,x,y,outr,outg,outb)
  22.         --end
  23.        
  24.         outr, outg, outb = getValue(0,x,y,1)
  25.         b = outr + outg + outb
  26.         if b > 0 then
  27.             setPixel(0,x,y,outr,outg,outb)
  28.         end
  29.     end
  30. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×