MaskTools2/Mt invert: Difference between revisions

From Avisynth wiki
Jump to navigationJump to search
m category
examples
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Plugin_Filters]]
[[Category:Plugin_functions]]
[[Category:Levels and Chroma]]
[[Category:Levels and Chroma filters]]
-----------------------------------------------
-----------------------------------------------
'''Back to [[MaskTools2#Filters|MaskTools2]] ←'''
'''Back to [[MaskTools2#Filters|MaskTools2]] ←'''
Line 6: Line 6:
<br>
<br>
== Description ==
== Description ==
:Inverts the values of the pixels. This function is equivalent to mt_lut("255 x -"), but faster.  
Inverts the values of the pixels. This function is equivalent to mt_lut("255 x -"), but faster.  
<br>
<br>
== Syntax and Parameters ==
:{{Template:FuncDef|mt_invert(clip, int "Y", int "U", int"V", string "chroma", int "offX", int "offY", int "w" int "h")}}
<br>
<br>
::{{Par|Y|int|3}}
== [[Script variables|Syntax and Parameters]] ==
::{{Par|U|int|1}}
:{{Template:FuncDef|mt_invert (clip, int "Y", int "U", int"V", string "chroma", int "offX", int "offY", int "w" int "h")}}
::{{Par|V|int|1}}
::::These three values describe the actual processing mode that is to be used on each plane / channel. Here is how the modes are coded :
:::::*x = -255...0 : all the pixels of the plane will be set to -x.
:::::*x = 1 : the plane will not be processed. That means the content of the plane after the filter is pure garbage.
:::::*x = 2 : the plane of the first input clip will be copied.
:::::*x = 3 : the plane will be processed with the processing the filter is designed to do.
:::::*x = 4 (when applicable) : the plane of the second input clip will be copied.
:::::*x = 5 (when applicable) : the plane of the third input clip will be copied.
<br>
<br>
::{{Par|chroma|string|""}}
::{{Par2| |clip| }}
::::When defined, the value contained in this string will overwrite the u & v processing modes.
:::Input clip.
::::This is a nice addition proposed by mg262 that makes the filter more user friendly. Allowed values for chroma are:
:::::*"process" : set u = v = 3.
:::::*"copy" or "copy first" : set u = v = 2.
:::::*"copy second" : set u = v = 4.
:::::*"copy third" : set u = v = 5.
:::::*"xxx", where xxx is a number : set u = v = -xxx.
<br>
<br>
::{{Par|offX|int|0}}
::{{Par2|Y|int|3}}
::{{Par|offY|int|0}}
::{{Par2|U|int|1}}
::::"offx" and offy are the top left coordinates of the box where the actual processing shall occur. Everything outside that box will be garbage.
::{{Par2|V|int|1}}
:::These three values describe the actual processing mode that is to be used on each plane / channel. Here is how the modes are coded :
::::*x = -255...0 : all the pixels of the plane will be set to -x.
::::*x = 1 : the plane will not be processed. That means the content of the plane after the filter is pure garbage.
::::*x = 2 : the plane of the first input clip will be copied.
::::*x = 3 : the plane will be processed with the processing the filter is designed to do.
<br>
<br>
::{{Par|w|int|-1}}
::{{Par2|chroma|string|""}}
::{{Par|h|int|-1}}
:::When defined, the value contained in this string will overwrite the u & v processing modes.
::::w and h are the width and height of the processed box. -1 means that the box extends to the lower right corner of the video. That also means that default settings are meant to process the whole picture.
:::This is a nice addition proposed by mg262 that makes the filter more user friendly. Allowed values for chroma are:
::::*"process" : set u = v = 3.
::::*"copy" or "copy first" : set u = v = 2.
::::*"xxx", where xxx is a number : set u = v = -xxx.
<br>
::{{Par2|offX|int|0}}
::{{Par2|offY|int|0}}
:::"offX" and "offY" are the top left coordinates of the box where the actual processing shall occur. Everything outside that box will be garbage.
<br>
::{{Par2|w|int|-1}}
::{{Par2|h|int|-1}}
:::w and h are the width and height of the processed box. -1 means that the box extends to the lower right corner of the video. That also means that default settings are meant to process the whole picture.
<br>
== Examples ==
mt_invert with default settings:
[[AviSource]]("blah.avi")
mt_invert(Y=3, U=1, V=1, chroma="", w=-1, h=-1)
<br>
<br>
<br>
<br>

Latest revision as of 21:26, 12 October 2014


Back to MaskTools2



Description

Inverts the values of the pixels. This function is equivalent to mt_lut("255 x -"), but faster.

mt_invert (clip, int "Y", int "U", int"V", string "chroma", int "offX", int "offY", int "w" int "h")


clip   =
Input clip.


int  Y = 3
int  U = 1
int  V = 1
These three values describe the actual processing mode that is to be used on each plane / channel. Here is how the modes are coded :
  • x = -255...0 : all the pixels of the plane will be set to -x.
  • x = 1 : the plane will not be processed. That means the content of the plane after the filter is pure garbage.
  • x = 2 : the plane of the first input clip will be copied.
  • x = 3 : the plane will be processed with the processing the filter is designed to do.


string  chroma = ""
When defined, the value contained in this string will overwrite the u & v processing modes.
This is a nice addition proposed by mg262 that makes the filter more user friendly. Allowed values for chroma are:
  • "process" : set u = v = 3.
  • "copy" or "copy first" : set u = v = 2.
  • "xxx", where xxx is a number : set u = v = -xxx.


int  offX = 0
int  offY = 0
"offX" and "offY" are the top left coordinates of the box where the actual processing shall occur. Everything outside that box will be garbage.


int  w = -1
int  h = -1
w and h are the width and height of the processed box. -1 means that the box extends to the lower right corner of the video. That also means that default settings are meant to process the whole picture.


Examples

mt_invert with default settings:

AviSource("blah.avi")
mt_invert(Y=3, U=1, V=1, chroma="", w=-1, h=-1)




Back to MaskTools2