Quote: "I imagine judging will be quite tough since there are so many that produce awesome transitions but are so different than one another"
You are sooooo right! I just sit here thinking "woahhh!" From the very simple to the highly complex, there isn't a single one that I don't like.
If you want to look at a few, or make it easier to view your own, here's some code...
Create a folder, and also a subfolder called "masks"
Save the code below as a project in the main folder. It should be set to 800*600, 32 bit.
Put any masks in the "masks" subfolder. You also need a text file called "masks.txt" in this folder. Add each mask name to this text file, one per line
To remove masks from the "slideshow", use an * in front of their name in masks.txt. This way, you can add and remove them without recompiling all the time.
Default editor users will probably have to remove the comments to make it work...sorry! I took a lot out, but there's more.
global pixpitch
global maskImage
maskImage = 100
global maskMemblock
maskMemblock = 10
dim maskStage(255)
set display mode 800,600,32
` Try setting the SYNC RATE to 0 and see just how fast this effect can be!
sync on: SYNC RATE 100
set text opaque
load image "Image1.jpg", 1, 1
load image "Image2.jpg",2,1
make memblock from image 1,1
make memblock from image 2,2
lock pixels
pixpitch = get pixels pitch()
unlock pixels
open to read 1, "masksmasks.txt"
while not file end(1)
read string 1, file$
if left$(file$,1) <> "*"
if file exist("masks" + file$)
cls 0: sync
center text 400,280, "Loading " + file$ + "..."
sync
loadMask("masks" + file$,11)
memblockWipe(1,11)
delay()
memblockWipe(2,11)
delay()
endif
endif
endwhile
close file 1
function memblockWipe(newImage, mask)
sh = screen height()
sw = screen width()
sd = screen depth()
sb = sw * (sd / 8)
pointer = 0
for n = 0 to 255
lock pixels
for m = pointer to pointer + (maskStage(n) - 1)
` We must convert the mask pixel number into a position in the screen memory
pixel = memblock dword(mask, m * 4)
pixelline = pixel / sw
pixelcolumn = pixel - (pixelline * sw)
screenPosition = (pixelline * pixpitch) + (pixelcolumn * (sd / 8))
newImagePosition = (pixelline * sb) + (pixelcolumn * (sd / 8))
copy memory get pixels pointer() + screenposition, get memblock ptr(newImage) + newImagePosition + 12, sd / 8
next m
inc pointer, maskStage(n)
unlock pixels
text 5,5, str$(screen fps())
sync
next n
`************************************************************
endfunction
function delay()
time = timer()
while timer() < time + 1000
text 5,5, str$(screen fps())
sync
endwhile
endfunction
function LoadMask(image$, memblock)
remstart
@C This function will load an 800 * 600 image into a memblock
@C It will extract the red channel as the transition mask, and order
@C the pixels according to their red pixel value, starting at 0.
remend
` Load the mask image and make a memblock from it
load image image$, maskImage, 1
if memblock exist(maskMemblock) then delete memblock maskMemblock
make memblock from image maskMemblock, maskImage
delete image maskImage
` Make the memblock that will store the mask data (800 * 600 points)...
if memblock exist(memblock) then delete memblock memblock
make memblock memblock, 480000 * 4
` Bytes per pixel...
sb = memblock dword(maskMemblock, 8) / 8
print "Loading Mask Data (~5 seconds)..." : Sync : Sync
` Iterate through the image data 256 times
` Each iteration, add the pixel positions to the mask data memblock
` After this operation, we will have the pixels stored in the order
` that we wish to fade them out onscreen.
` We also need to record the number of pixels at each of the 255 stages
` in order to display the effect correctly
` We store these values in array maskStage()
nextByte = 0
for n = 0 to 255
pixelcount = 0
for m = 0 to 479999
if memblock byte(maskMemblock, (m*sb) + 14) = n
write memblock dword memblock, nextByte, (m)
inc nextByte, 4
inc pixelCount, 1
endif
next m
maskStage(n) = pixelCount
next n
endfunction