vapoursynth-cranexpr 0.3.0__py3-none-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vapoursynth/plugins/cranexpr/cranexpr.dll +0 -0
- vapoursynth/plugins/cranexpr/cranexpr.v2.dll +0 -0
- vapoursynth/plugins/cranexpr/cranexpr.v3.dll +0 -0
- vapoursynth/plugins/cranexpr/manifest.vs +2 -0
- vapoursynth_cranexpr-0.3.0.dist-info/METADATA +109 -0
- vapoursynth_cranexpr-0.3.0.dist-info/RECORD +7 -0
- vapoursynth_cranexpr-0.3.0.dist-info/WHEEL +4 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vapoursynth-cranexpr
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: VapourSynth expr plugin built on top of Cranelift.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.12
|
|
7
|
+
Requires-Dist: vapoursynth>=74
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# cranexpr
|
|
11
|
+
|
|
12
|
+
cranexpr is like [`std.Expr`](https://www.vapoursynth.com/doc/functions/video/expr.html)
|
|
13
|
+
but built on top of [Cranelift](https://cranelift.dev/). It's a [VapourSynth](https://www.vapoursynth.com/)
|
|
14
|
+
plugin that allows one to evaluate an expression per pixel.
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
|
|
18
|
+
Median of 3 clips:
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
core.cranexpr.Expr([x, y, z], "x y min x y max z min max")
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Flip a clip horizontally:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
core.cranexpr.Expr([x], "width X - 1 - Y x[]")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3x3 box blur:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
core.cranexpr.Expr([x], "x[-1,-1] x[0,-1] x[1,-1] x[-1,0] x x[1,0] x[-1,1] x[0,1] x[1,1] + + + + + + + + 9 /")
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Features
|
|
37
|
+
|
|
38
|
+
- Arithmetic: `+`, `-`, `*`, `/`, `%`, `pow`, `exp`, `log`, `sqrt`.
|
|
39
|
+
- Trigonometry: `sin`, `cos`, `tan`, `atan2`.
|
|
40
|
+
- Comparison: `>`, `<`, `=`.
|
|
41
|
+
- Bitwise: `bitand`, `bitor`, `bitxor`, `bitnot`.
|
|
42
|
+
- Clamping: `min`, `max`, `clip` (alias: `clamp`).
|
|
43
|
+
- Rounding: `floor`, `round`.
|
|
44
|
+
- Ternary (if/else): `?`.
|
|
45
|
+
- `sgn`: Returns the sign of a value (-1 if negative, 1 if positive, 0 if zero).
|
|
46
|
+
- Constants:
|
|
47
|
+
- `width`: Width of the plane.
|
|
48
|
+
- `height`: Height of the plane.
|
|
49
|
+
- `N`: Current frame number.
|
|
50
|
+
- `pi`: π.
|
|
51
|
+
- Stack manipulation:
|
|
52
|
+
- `dropN`, `drop`: drops the top N values from the stack. `drop` is equivalent
|
|
53
|
+
to `drop1`.
|
|
54
|
+
- `dupN`, `dup`: allows a value N steps up in the stack to be duplicated. The
|
|
55
|
+
top value of the stack has index 0 meaning that `dup` is equivalent to
|
|
56
|
+
`dup0`.
|
|
57
|
+
- `swapN`, `swap`: allows a value N steps up in the stack to be swapped. The
|
|
58
|
+
top value of the stack has index 0 meaning that `swap` is equivalent to
|
|
59
|
+
`swap1`. This is because `swapN` always swaps with the topmost value at
|
|
60
|
+
index 0.
|
|
61
|
+
- Variables:
|
|
62
|
+
- `var!`: Pops the top value from the stack and stores it in a variable named
|
|
63
|
+
`var`.
|
|
64
|
+
- `var@`: Pushes the value of the variable `var` onto the stack.
|
|
65
|
+
- Frame property access: `clip.PropertyName`.
|
|
66
|
+
- Accesses a numeric frame property from the given clip.
|
|
67
|
+
- If the property is missing, its value will be `NaN`.
|
|
68
|
+
- If the property is not a numeric frame property, its value will be the first
|
|
69
|
+
byte.
|
|
70
|
+
- Relative pixel access: `clip[relX, relY]:[mode]`.
|
|
71
|
+
- Accesses a pixel relative to the current coordinate (`X`, `Y`). `relX` and
|
|
72
|
+
`relY` must be integer constants.
|
|
73
|
+
- If no suffix is provided, the edge behavior is determined by the filter's
|
|
74
|
+
`boundary` parameter.
|
|
75
|
+
- `:c`: Forces clamped boundary.
|
|
76
|
+
- `:m`: Forces mirrored boundary.
|
|
77
|
+
- Absolute pixel access: `absX absY clip[]:[mode]`.
|
|
78
|
+
- Accesses a pixel at an absolute coordinate. It pops `absY` then `absX` from
|
|
79
|
+
the stack. These coordinates can be computed by expressions.
|
|
80
|
+
- If the coordinates are not integers, they will be rounded half to even.
|
|
81
|
+
- **Example:** `X 2 / Y x[]` reads the pixel at half the current X
|
|
82
|
+
coordinate from the first clip, using the default clamp mode.
|
|
83
|
+
- **Boundary Suffixes:**
|
|
84
|
+
- `:c`: Forces clamped boundary.
|
|
85
|
+
- `:m`: Forces mirrored boundary.
|
|
86
|
+
- Supports any number of input clips. `srcN` may be used to access the `N`-th
|
|
87
|
+
input clip. Shorthand aliases `x`, `y`, `z`, `a`, `b`, `c`, etc. map to
|
|
88
|
+
`src0`, `src1`, `src2`, `src3`, `src4`, `src5`, etc., up to `w` being `src25`.
|
|
89
|
+
Beyond that, use `srcN`.
|
|
90
|
+
|
|
91
|
+
## API
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
cranexpr.Expr(
|
|
95
|
+
clips: Sequence[vs.VideoNode],
|
|
96
|
+
expr: str | list[str],
|
|
97
|
+
format: int | None = None,
|
|
98
|
+
boundary: Literal[0, 1] = 0,
|
|
99
|
+
) -> vs.VideoNode
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- `clips` — Input video nodes.
|
|
103
|
+
- `expr` — Reverse Polish Notation (RPN) expression(s) for each plane. The
|
|
104
|
+
expression given for the previous plane is used if the list contains fewer
|
|
105
|
+
expressions than the input clip has planes. This means that a single
|
|
106
|
+
expression will be applied to all planes by default.
|
|
107
|
+
- `format` — By default the output format is the same as the first input clip's
|
|
108
|
+
format. This can be overridden by setting this parameter.
|
|
109
|
+
- `boundary` — Boundary mode. `0` for clamping, `1` for mirroring.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
vapoursynth/plugins/cranexpr/cranexpr.dll,sha256=jclrxjhbZg6JdnGRj7zQyCnmumSJkdcVGnZxc6KXfQk,5209600
|
|
2
|
+
vapoursynth/plugins/cranexpr/cranexpr.v2.dll,sha256=I_kvGDy1aqYFaRM_NICSYtPS_MXN4NAKdNT1T0f_Q3M,5188096
|
|
3
|
+
vapoursynth/plugins/cranexpr/cranexpr.v3.dll,sha256=S1i409rFf_AOACK0XUYEU5WDaYY6Iyk4WfdWkvOK3NE,5212160
|
|
4
|
+
vapoursynth/plugins/cranexpr/manifest.vs,sha256=8j6gOfReDgO9X5KJyxLGIBe9Tc42ki6sPSpKuryGs0U,37
|
|
5
|
+
vapoursynth_cranexpr-0.3.0.dist-info/METADATA,sha256=GjmAGjvDad8V0yULUre3wJg5u2_1vaJMSdQU0aPRfNY,4149
|
|
6
|
+
vapoursynth_cranexpr-0.3.0.dist-info/WHEEL,sha256=EiJLBSKnreoFowmF0huSw9SFCuj77125fxFuv7BHuOI,90
|
|
7
|
+
vapoursynth_cranexpr-0.3.0.dist-info/RECORD,,
|