View Single Post
Old 24th July 2012, 19:18   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
RT_Stats, Short description: EDIT: Many additions missing, see later posts. (again hit 16kb limit)
Code:
RT_GraphLink(clip source, clip c1, ... , clip cn, bool b1, ... , bool bn) Equiv "Echo()" in 2.6a4
The clips, c1 to cn are by default forcibly linked into the filter graph. 

RT_Debug(string s1, ... , string sn,bool "name"=true)
Takes one or more strings, outputs the combined string to OutputDebugString()

RT_Call(String Cmd,bool "Hide"=false,bool "Debug"=false)
Run an external program using supplied command.

RT_YankChain(clip,int "n"=current_frame,int "delta"=0)
Process frame (n + delta) of a clip ie forcibly process the filter graph chain for frame n + delta.

RT_GetProcessName(bool "parent"=false,bool "debug"=false)
Returns string, name of current process.

RT_StrAddStr(String, String s1, ... , String sn)
Function to concatenate 2 or more strings.

RT_TxtAddStr(String, String s1, ... , String sn)
Function to concatenate 2 or more strings with Chr(10) line separators.

RT_TxtQueryLines(String)
String, the multiline string that you require a line count from.
Returns the number of Newline [Chr(10)] separated lines in a multiline string.

RT_TxtGetLine(String, Int "Line"=0)
Extract a single line from a multiline Newline[Chr(10)] separated string.

RT_StrReplace(string source,string find,string replace,bool "sig"=True)
Takes a source string, searches for all occurrences of find string and replaces the found strings with the replace string.

RT_StrReplaceDeep(string source,string find,string replace,bool "sig"=True)
Takes a source string, searches for all occurrences of find string and replaces the found strings with the replace string.
Can use "" in replace string (only in replace) to delete the found substrings from the source string.
Differs from RT_StringReplace in that if length of replace < length of find string will rescan after a replacement to see if
the replaced string combines with currently existing string to create another find string, If length replace >= find, then calls
RT_StringReplace instead. Useful to replace eg "  " with " ", (two spaces with 1 space), where more than two consecutive
spaces would end up with more than one consecutive resulting space if using plain RT_StrReplace.

RT_StrReplaceMulti(string source,string find,string replace,bool "sig"=True)
Takes a source string, searches for all occurrences of find substrings and replaces the found substrings with the replace substrings.
Find string and Replace string are both multiline [Chr(10) separated] strings, both of n lines where find[i] and replace[i]
are matched pairs, ie the first line of a multiline find is replaced by the first line of a multiline found, etc.
Can use "" in replace string (only in replace) to delete the found substrings from the source string.
Differs from RT_StrReplace, in that both find and replace strings are multiline strings and MUST match in number of lines.
Cannot use either carriage return [Chr(13)] or newline [Chr(10)] in find or replace as these are interpreted as end of current line,
you would need to use RT_StrReplace() instead.

RT_QuoteStr(string)
Encloses supplied string arg in double quotes.

RT_TxtSort(String,int 'mode'=0)
Function to sort a Chr(10) separated multiline string, 12 modes.

RT_FileQueryLines(String)
Returns number of lines in a text file.

RT_TxtWriteFile(String,String,bool "append"=false)
The first arg is a string of text that you want to write to a file.
The second arg is the output filename.

RT_ReadTxtFromFile(String ,Int "Lines"=0,Int "Start"=0)
String Filename, Name of text file to load into a string.

RT_WriteFileList(String,String,bool "append"=false)
Writes to a file, a list of filenames matching a wildacard eg "D:\Pics\*.BMP|JP*G|PNG"

RT_Hex(int , int "width"=0)
First arg is an integer to convert to a hexadecimal string.
Width, (0, 0 -> 8) is the minimum width of the returned string.

RT_HexValue(String,"pos"=1)
Returns an int conversion of the supplied hexadecimal string.

RT_NumberString(int ,int "base"=10, int "width"=0)
Converts a number (base 2->36) into a string. 

RT_NumberValue(String,int "base"=10,"pos"=1)
Returns an int conversion of the supplied number base string.
Base, (10, 2 -> 36) is the number base that the string uses.

RT_BitNOT(int)
Returns the integer result of a bitwise NOT operation on it's int argument.

RT_BitAND(int, int)
Returns the integer result of a bitwise AND operation on the two int arguments.

RT_BitOR(int, int)
Returns the integer result of a bitwise OR operation on the two int arguments.

RT_BitXOR(int, int)
Returns the integer result of a bitwise XOR operation on the two int arguments.

RT_BitLSL(int, int)
Returns the integer result of a Logical Shift Left on the first integer, by a shift count of the second int.
An Arithmetic Shift Left and a Logical Shift Left, are essentially the same.

RT_BitLSR(int, int)
Returns the integer result of a Logical Shift Right on the first integer, by a shift count of the second int.
Logical shift right will shift zeros into the high bits.

RT_BitASL(int, int)
Returns the integer result of an Arithmetic Shift Left on the first integer, by a shift count of the second int.
An Arithmetic Shift Left and a Logical Shift Left, are essentially the same.

RT_BitASR(int, int)
Returns the integer result of an Arithmetic Shift Right on the first integer, by a shift count of the second int.
Arithmetic shift right will shift into the high bits, zeros for a +ve number and ones for a -ve number, so -ve
numbers will stay -ve and +ve stay +ve.

RT_BitTST(int, int)
Returns the bool result of a bit test on first integer, the bit number is given in the second int.
A zero in the bit returns False and a 1 returns True.

RT_BitCLR(int, int)
Returns the integer result of a bit clear (make 0) on first integer, the bit number is given in the second int.

RT_BitSET(int, int)
Returns the integer result of a bit Set (make 1) on first integer, the bit number is given in the second int.

RT_BitCHG(int, int)
Returns the integer result of a bit change (0->1, 1->0) on first integer, the bit number is given in the second int.

RT_BitROR(int, int)
Returns the integer result of a bit Rotate Right on first integer, the bit rotate count is given in the second int.

RT_BitROL(int, int)
Returns the integer result of a bit Rotate Left on first integer, the bit rotate count is given in the second int.

RT_BitSetCount(int)
Return an int, the count of the number of set bits (1's) in arg int.

RT_Undefined()
Returns same as undefined() in v2.6. Defined(RT_Undefined()) would return false.

RT_FloatAsRGBA(float)
Given a float arg, returns an int formatted as for use as a color to eg BlankClip.
Can later be recovered from that clip using RT_RGB32AsFloat().

RT_RGB32AsFloat(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0)
Given an RGB32 clip that had a pixel value created via RT_FloatAsRGBA(), gets that pixel and returns as the
original float given to RT_FloatAsRGBA.

RT_RGB32AsInt(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0)
Given an RGB32 clip that had a pixel value created from an Int, gets that pixel and returns as the
original Int.

RT_RgbChanAve(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0, int "h"=0,bool "interlaced"=false,int "chan"=0)
Return the float average value (0.0 -> 255.0) for an RGB channel in frame(n+delta) for area x,y,w,h. (RGB 24/32).

RT_AverageLuma(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,int "Matrix"=(width<=720?2:3))
Returns FLOAT value average luma (0.0 -> 255.0) in frame(n+delta) for area x,y,w,h.

RT_YPlaneMin(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,
  float "threshold"=0.0,int "Matrix"=)
Returns int value minimum luma (0 -> 255) in frame(n+delta) for area x,y,w,h.
Threshold is a percentage, stating how many percent of the pixels are allowed below minimum. The threshold is optional and defaults to 0.0

RT_YPlaneMax(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,
  float "threshold"=0.0,int "Matrix"=)
Returns int value maximum luma (0 -> 255) in frame(n+delta) for area x,y,w,h.
Threshold is a percentage, stating how many percent of the pixels are allowed above maximum. The threshold defaults to 0.0

RT_YPlaneMinMaxDifference(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,
    bool "interlaced"=false,float "threshold"=0.0,int "Matrix"=)
Returns int value luma range (maximum - minimum difference) (0 -> 255) in frame(n+delta) for area x,y,w,h.
Threshold is a percentage, stating how many percent of the pixels are allowed below minimum or above maximum. The threshold defaults to 0.0

RT_YPlaneMedian(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,int "Matrix"=)
Returns int value luma median [equiv RT_YPlaneMin(threshold=50.0)] (0 -> 255) in frame(n+delta) for area x,y,w,h.
Threshold is a percentage, stating how many percent of the pixels are allowed above or below minimum. The threshold is optional and defaults
to 0.0

RT_YPlaneStdev(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,int "Matrix"=)
Returns FLOAT value luma Standard Deviation (0.0 -> 255.0) in frame(n+delta) for area x,y,w,h.

RT_YDifference(clip,int "n"=current_frame,int "delta"=1,int "x"=0,int "y"=0,int "w"=0,int "h"=0,int "x2"=x,int "y2"=y,
  bool "interlaced"=false,int "Matrix"=)
Returns FLOAT value luma difference (0.0 -> 255.0) between frame n area x,y,w,h, and frame (n+delta) area x2,y2,w,h.
Note, by default it will be equivalent to YDifferenceToNext as delta defaults to 1 and x,y,w,h defaults full frame.
Note, 'x2' and 'y2' default to 'x' and 'y' respectively.

RT_LumaDifference(clip,clip2,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,
    int "n2"=current_frame,int "delta2"=0,int "x2"=x,int "y2"=y,bool "interlaced"=false,int "Matrix"=)
Returns FLOAT value luma difference (0.0 -> 255.0) between clip frame (n+delta) area x,y,w,h, and clip2 frame (n2+delta2) area x2,y2,w,h.
Note, 'x2' and 'y2' default to 'x' and 'y' respectively.

RT_YInRange(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,int "Matrix"=,
    int "lo"=128,int "hi"=lo)
Returns float value (0.0 -> 1.0) being the amount of pixels in the range "lo" to "hi" (inclusive), 1.0 is equivalent to 100%.
Implemented as requested by Martin53 (thank you), NOTE, differs from other funcs that return range 0.0 to 255.0.
NOTE, "hi" defaults to "lo".

RT_LumaCorrelation(clip,clip2,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,int "n2"=current_frame,
    int "delta2"=0,int "x2"=x,int "y2"=y,bool "interlaced"=false,int "Matrix"=(width>=720?2:3))
Returns FLOAT value luma correlation (-1.0 -> 1.0) between clip frame (n+delta) area x,y,w,h, and clip2 frame (n2+delta2) area x2,y2,w,h.
Note, 'x2' and 'y2' default to 'x' and 'y' respectively.

RT_GetLastError()
 Return a error number describing previous system error (if available). Perhaps use after eg RT_Call.

RT_GetLastErrorString()
 Return a string describing previous system error (if available).

RT_StrPad(String,Int n,string "c"=" ")
Pads an unnamed string to at least int n (unnamed) length with first character of string c (Default SPACE).

RT_GetWorkingDir()
 Return current Working directory, directory of script, or dir set by SetWorkingDir().

RT_GetFullPathName(string "name")
 Creates an absolute or full path name for the specified relative path 'name'.

RT_FilenameSplit(string filename,int "get"=15)
 Splits the un-named filename string into component parts selected by 'get' bit flags arg and returns the parts joined together.

RT_GetFileExtension(string s)
 Returns filename extension from the supplied filename, including '.' prefix.

RT_FileDelete(string fn)
 Delete unnamed file fn.

RT_VarExist(string)
 Given the name (string) of the variable that you want to test for existence, returns true if exists, else false.

RT_Ord(string)
 Returns same as 'Ord' in v2.6, the ASCII code for the 1st letter in string (0 if empty string "").

RT_Timer()
 Returns time in seconds since start of process.

RT_Ystats(clip,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,bool "interlaced"=false,
      float "threshold"=0.0,int "Matrix"=(width<=720?2:3),int "lo"=128,int "hi"=lo,int "flgs"=127,string "prefix"="YS_")
  Returns multiple results as for above single frame Luma sampling functions as Global Variables (prefixed with the prefix string arg).

RT_GetSAR(clip,dar float)
  Gets Sample (pixel) Aspect Ratio from DAR Display Aspect Ratio.

RT_GetDAR(clip,sar float)
  Gets DAR Display Aspect Ratio from SAR, Sample (pixel) Aspect Ratio.

RT_SignalDAR(float) # See Megui wiki (name change from SetDAR)
  Signal DAR to MEGUI. Sets global vars MeGUI_darX and MeGUI_darY which are read during MEGUI loading of AVS file.

RT_GetCropDAR(clip,float DAR,float "X"=0,float "Y"=0,Float"W"=0,float "H"=0)
  Call prior to Crop/Resize with (possibly fractional) cropping to calc resultant DAR, X,Y,W,H are cropping coords

RT_QueryLumaMinMax(clip c,int "Samples"=24,float "Ignore"=0.2,String "Prefix"="QLMM",bool "DEBUG"=false,int "X"=0,int "Y"=0,int "W"=0,int "H"=0, \
     int "Matrix"=(width<=720?2:3))
  Prescan function to get Luma Min,Max for clip scanning Samples frames area x,y,w,h.

Function RT_QueryBorderCrop(clip c,int "Samples"=24,Float "Thresh"=-32,bool "Laced"=true,int "XMod",int "YMod",int "WMod",int "HMod",  \
    bool "Relative"=false, String "Prefix"="QBCrop",int "RLBT"=15,bool "DEBUG"=false,float "Ignore"=0.2,int "Matrix"=(width<=720?2:3), \
    Float "ScanPerc"=49.0,int "Baffle"=4, bool "ScaleAutoThreshRGB"=true,bool "ScaleAutoThreshYUV"=false)
 Prescan function to get coords for eg cropping black borders by sampling Samples frames.

Function RT_YInRangeLocate(clip c,int "n"=current_frame,int "Delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,int "Baffle"=8,float "Thresh"=0.0, \
    int "Lo"=128,int "Hi"=255,Int "Matrix"=(width<=720?2:3),String "Prefix"="YIRL_",bool "Debug"=false)
 Clip function to scan frame n+delta for an area where percentage of pixels in luma range Lo to Hi (inclusive) breaks a threshold over at least Baffle
 consecutive number of scanlines (all four sides).

RT_FindStr(String S,string Substr,bool "Sig"=True,int "Pos"=1)
 Finds unnamed string Substr in unnamed string S.
 Optional bool Sig: Default=True, does case significant comparison, insignificant if false.
 Optional int Pos: Default=1, is start position in string S to find string Substr. If Pos smaller than 1 or greater than length of string s,
  then will return 0, Not Found. 
 Returns position (1 relative) of found string within the FULL LENGTH string S, or 0 if not found.
 Differs from Avisynth FindStr in Sig and Pos args and in that if either string S or string Substr is "" then will ALWAYS return 0, 'Not Found'.

ADDED IN v1.16

RT_LumaSceneChange(clip,clip2,int "n"=current_frame,int "delta"=0,int "x"=0,int "y"=0,int "w"=0,int "h"=0,
    int "n2"=current_frame,int "delta2"=0,int "x2"=x,int "y2"=y,bool "interlaced"=false,int "Matrix"=(width<=720?2:3))
  Returns FLOAT value (0.0 -> 255.0) scene change detection between clip frame (n+delta) area x,y,w,h, and clip2 frame (n2+delta2) area x2,y2,w,h.
  Note, 'x2' and 'y2' default to 'x' and 'y' respectively.
  Is implemented sort of like:- mt_lutxy(mt_polish("((x-y)/4)^2")).AverageLuma() where x=(n+delta) and y=(n2+delta2).
List of All function names current @ v1.23 here:
http://forum.doom9.org/showthread.ph...48#post1643148
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 8th September 2013 at 14:12.
StainlessS is offline   Reply With Quote