ApplyZone

概要

指定した矩形領域だけにフィルタを適用する。

mask=trueなら、指定矩形領域以外の範囲にフィルタを適用。

作者

Avisynthを絶賛ιょぅょ Part15の160さん

関数

function ApplyZone(clip clip
\, string "filter", string "op", int "level", int "threshold", bool "use_chroma"
\, int "x", int "y", int "w", int "h", bool "fast", bool "mask")
{
Assert(clip.IsYUY2(), "ApplyZone: requires YUY2 input.")
op =default(op, "add")
level = default(level, 255)
threshold = default(threshold, 255)
use_chroma = default(use_chroma, true)
x = default(x, 0)
y = default(y, 0)
w = default(w, clip.width() - x)
h = default(h, clip.height() - y)
fast = default(fast, true)
mask = default(mask, false)
copy = mask ? clip.Crop(x,y,w,h) : NOP
new = (fast && mask==false) ? clip.Crop(x, y, w, h) : Eval("clip."+filter)
new = mask ? new : fast ? Eval("new."+filter) : new.Crop(x, y, w, h)
return mask ?
\ Layer(clip, new, op, level, 0, 0, threshold, use_chroma).Layer(copy, "add", 255, x, y)
\ : Layer(clip, new, op, level, x, y, threshold, use_chroma)
}

書式

ApplyZone(clip clip
\, string "filter", string "op", int "level", int "threshold", bool "use_chroma"
\, int "x", int "y", int "w", int "h", bool "fast", bool "mask")

引数

  • filter
    • 適用するフィルタ。
  • op
    • Layerフィルタのop。
  • level
    • Layerフィルタのlevel。
  • threshold
    • Layerフィルタのthreshold。
  • use_chroma
    • Layerフィルタのuse_chroma。
  • x
  • y
  • w
    • 矩形領域の幅。
  • h
    • 矩形領域の高さ。
  • fast
    • Cropを優先することによって処理を高速化するかどうかの選択。デフォルトはtrue。
      • true: Cropで矩形領域を切り抜いたあとに、filterを適用。falseより高速。
      • false: filter適用後に、Cropで矩形領域を切り抜く。
  • mask
    • 指定矩形領域にフィルタを適用するか、領域外にフィルタを適用するかの選択。デフォルトはfalse。
      • true: 指定矩形領域を除いてフィルタ適用。
      • false: 指定矩形領域にフィルタ適用。

使用例

ApplyZone(filter="NR()", x=100, y=200, w=200, h=100, fast=false) 

備考

最終更新日時: 2014-03-11 (火) 03:44:22 (3691d)