Home
RecentChanges

Search:

» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Download
»Learn to script
»FAQ
»Manual
»Discussion fora
»Project page
»External filters
»FeedBack

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth

 

Avisynth 
Logo

BoxCompare

One of my commonly-used functions. Maybe someone will find it useful.

# BoxCompare
#
#   Compares up to 4 clips at once, with optional descriptive text overlaid.
#
#
#
# PARAMETERS:
#   "ul", "ur", "ll", "lr" : Upper-left clip, upper-right clip, etc.
#							 If any of these is omitted, it will be filled in
#							 by blank space.  At least ul is required, though.
#
#							 Source clips must have the same height & colorspace,
#                            as well as the same width if more than 2 are compared.
#
#	"ulTxt", "urTxt", "llTxt", "lrTxt" : Optional text descriptions for each
#										 clip.
#
# USAGE:
#   # Compare three clips, leaving the lower-left quadrant blank
#   # Output clip is 
#   BoxCompare(clip1, clip2, lr = clip3)
#
#   # Compare two clips (one row side by side, equivalent to StackHorizontal) with
	# text overlaid on one of them.
#   BoxCompare(clip1, clip2, urTxt = "clip 2")
#
# 
Function BoxCompare(clip ul, clip "ur", clip "ll", clip "lr", 
	\				string "ulTxt", string "urTxt", string "llTxt", string "lrTxt")
{
	doLower = Defined(ll) || Defined(lr)

	ur = Defined(ur)
		\ ? ur
		\ : BlankClip(ul)
	ll = Defined(ll)
		\ ? ll
		\ : BlankClip(ul)
	lr = Defined(lr)
		\ ? lr
		\ : BlankClip(ul)
	
	ul = Defined(ulTxt) 
		\ ? ul.Subtitle(ulTxt)
		\ : ul
	ur = Defined(urTxt) 
		\ ? ur.Subtitle(urTxt)
		\ : ur
	ll = Defined(llTxt) 
		\ ? ll.Subtitle(llTxt)
		\ : ll
	lr = Defined(lrTxt) 
		\ ? lr.Subtitle(lrTxt)
		\ : lr
		
	out = (doLower)
		\ ? StackVertical( StackHorizontal(ul, ur), StackHorizontal(ll, lr) )
		\ : StackHorizontal(ul, ur)
	return out
}

SourceForge Logo

 


Edit this document | View document history
Document last modified Fri, 28 Jan 2005 15:36:24