Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Apr 2010
Posts: 175
|
mt_lutxy
Hi,
I can't get started with this function... mt_lutxy mt_lutxy : clip clip1, clip clip2, string expr("x"), string yexpr("x"), string uexpr("x"), string vexpr("x") It applies a two-parameters function defined by expr to all the pixels. The function is written is reverse polish notation. If yexpr, uexpr or vexpr isn't defined, expr is used instead. 1) How pixels of the clip 2 are used for calculation ? - expr("x") I guess the other expressions applies to Y, U, V ? mt_lutxy(o,g,"x x y - abs "+string(z)+" / 1 "+string(pow)+" / ^ "+string(z)+" * "+string(str)+ \ " * x y - 2 ^ x y - 2 ^ "+string(ldmp)+" + / * x y - x y - abs 0.001 + / * +",U=2,V=2) Ok, i know what reverse polish notation is, but i'm unable to understand this. It would be nice to have at least 1 example somewhere, to start with, explaining how the function is working on a simple task.... x y looks like Cartesian coordinates... what does x x y ? * x y - 2 ^ x y - 2 where comes clip2 in calculation ... ? reverse notation, why is the * before the x, y : * x y - x y ? TIA, L |
![]() |
![]() |
![]() |
#3 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,430
|
For each pixel, the output value is calculated from the relevant expression, with x as the value of the pixel in clip1 and y the pixel in clip2.
For RPN, see http://en.wikipedia.org/wiki/Reverse_Polish_notation. Note also the functions mt_polish and mt_infix for converting between RPN and 'normal' (infix) expression form. |
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: Apr 2010
Posts: 175
|
Ok, but why is it so confusing ?
because this is not RPN : (o,g,"x x y - abs "+string(z)+" The first "x" must belong to the syntax of the function, but seems also be a part of an RPN expression. But for being RPN, it would need 2 operators behind, where there is only 1. Also, there are 2 levels of quotes, around variables and around expressions ! The "abs" statement, applies to a parameter inside quotes, which usually enclose strings variables. And finally, x y usually refer to coordinated along X and Y axis in a plan... Last edited by lisztfr9; 12th May 2012 at 09:53. Reason: typo |
![]() |
![]() |
![]() |
#5 | Link | ||
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,430
|
Quote:
You cannot in general make sense of a fragment of RPN without considering the whole string. The operator that goes with a particular operand may be much further on in the string. Quote:
|
||
![]() |
![]() |
![]() |
#6 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,807
|
For anyone wanting to play with RPN, there is a FreeWare RPN calculator Excalibur v2.00
(from 2006), have not as yet played with it much but it looks quite good. Below from text on SoftPedia (home site no longer on-line). Code:
Excalibur description A full featured RPN-only calculator The Excalibur application was designed to be a full featured RPN-only calculator. This is a serious calculator for serious users. Excalibur takes up a small amount of resources for all it does so well. Here are some key features of "Excalibur": · Powerful RPN entry. 300 Functions (scientific, business, conversion, computer science, physics, complex numbers, geometry, vectors, etc). Full 4 or 8-level stack. · International support for different comma and decimal point formats. Programmable, macros, registers, custom button banks, etc.
__________________
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 ??? |
![]() |
![]() |
![]() |
#8 | Link | |
Anime addict
Join Date: Feb 2009
Location: Spain
Posts: 674
|
Quote:
Regards
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite |
|
![]() |
![]() |
![]() |
#9 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,430
|
Quote:
Note that you can get away with never learning RPN at all and just use mt_polish("...") instead for your expressions. I don't know why more people don't use it in published scripts - it's much easier to understand. |
|
![]() |
![]() |
![]() |
#10 | Link |
Anime addict
Join Date: Feb 2009
Location: Spain
Posts: 674
|
Thanks Gavino.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite |
![]() |
![]() |
![]() |
#12 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,430
|
Quote:
string() is unnecessary as mt_polish already returns a string. ScriptClip() is also unnecessary unless the other variable involves some run-time function. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|