View Single Post
Old 19th February 2019, 14:39   #14  |  Link
spoRv
Registered User
 
Join Date: Nov 2016
Posts: 151
Thanks for the idea, Frank62!

New versions:

Code:
function deconstruct(clip clip) {
w=clip.width/4
h=clip.height/4
clip

separatefields
a=selectevery(2,0)
b=selectevery(2,1)
a=turn180(a).swapuv
interleave(a,b)
weave

a01=crop(0  ,0  ,w,h).fliphorizontal
a02=crop(w  ,0  ,w,h).invert("br")
a03=crop(w*2,0  ,w,h).invert
a04=crop(w*3,0  ,0,h).turn180
a05=crop(0  ,h  ,w,h).invert
a06=crop(w  ,h  ,w,h).flipvertical
a07=crop(w*2,h  ,w,h).invert
a08=crop(w*3,h  ,0,h).invert("rg")
a09=crop(0  ,h*2,w,h).swapuv
a10=crop(w  ,h*2,w,h).turn180	
a11=crop(w*2,h*2,w,h).swapuv	
a12=crop(w*3,h*2,0,h).turn180
a13=crop(0  ,h*3,w,0).swapuv
a14=crop(w  ,h*3,w,0).invert("gb")
a15=crop(w*2,h*3,w,0).flipvertical
a16=crop(w*3,h*3,0,0).fliphorizontal

stackvertical(\
stackhorizontal(a12,a05,a08,a15),\
stackhorizontal(a06,a10,a01,a09),\
stackhorizontal(a11,a16,a14,a04),\
stackhorizontal(a03,a13,a07,a02))

Invert("BG").turn180.SwapUV
separatefields
a=selectevery(2,0)
b=selectevery(2,1)
a=turn180(a).invert
interleave(a,b)
weave
}

function reconstruct(clip clip) {
w=clip.width/4
h=clip.height/4
clip

separatefields
a=selectevery(2,0)
b=selectevery(2,1)
a=turn180(a).invert
interleave(a,b)
weave
SwapUV.turn180.Invert("GB")

a12=crop(0  ,0  ,w,h).turn180
a05=crop(w  ,0  ,w,h).invert
a08=crop(w*2,0  ,w,h).invert("gr")
a15=crop(w*3,0  ,0,h).flipvertical
a06=crop(0  ,h  ,w,h).flipvertical
a10=crop(w  ,h  ,w,h).turn180	
a01=crop(w*2,h  ,w,h).fliphorizontal
a09=crop(w*3,h  ,0,h).swapuv
a11=crop(0  ,h*2,w,h).swapuv
a16=crop(w  ,h*2,w,h).fliphorizontal
a14=crop(w*2,h*2,w,h).invert("bg")	
a04=crop(w*3,h*2,0,h).turn180	
a03=crop(0  ,h*3,w,0).invert
a13=crop(w  ,h*3,w,0).swapuv
a07=crop(w*2,h*3,w,0).invert	
a02=crop(w*3,h*3,0,0).invert("rb")

stackvertical(\
stackhorizontal(a01,a02,a03,a04),\
stackhorizontal(a05,a06,a07,a08),\
stackhorizontal(a09,a10,a11,a12),\
stackhorizontal(a13,a14,a15,a16))

separatefields
a=selectevery(2,0)
b=selectevery(2,1)
a=turn180(a).swapuv
interleave(a,b)
weave
}
It is quite shuffled now!
spoRv is offline   Reply With Quote