-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathff-dice.1
68 lines (63 loc) · 1.9 KB
/
ff-dice.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.Dd 2024-05-11
.Dt FF-DICE 1
.Os farbfeld-utils
.Sh NAME
.Nm ff-dice
.Nd farbfeld program that can dice a picture into many slices, and execute a command for each one
.Sh SYNOPSIS
.Nm
<slice width> <slice height> <?shell command?> <?env prefix?>
.Sh DESCRIPTION
.Nm
reads a
.Xr farbfeld 5
image from stdin, splits it into many slices, executes a command for each slice, and writes the
result to stdout.
.Pp
.Xr ff-hjoin 1
and
.Xr ff-vjoin 1
can be used to glue pictures together again after processing.
.Pp
In case of an error
.Nm
writes a diagnostic message to stderr.
.Sh EXIT STATUS
.Bl -tag -width Ds
.It 0
Image processed successfully.
.It 1
An error occurred.
.El
.Sh OPTIONS
The program takes up to four arguments:
- width of one slice
- height of one slice
- shell command to execute for each slice (optional)
- prefix for environment variable names (optional)
The height and width will be capped by the maximum size of the input file, so
if you want slices 300 pixels wide and the full height then you can just give
a very high number for the height.
The specified shell command is required to consume the entire input. If no
shell command is specified, it acts like "cat" was specified (although it
is more efficient).
When executing the command, the picture is given on stdin, and anything from
stdout is forwarded to this program's stdout. If the error code is nonzero,
then this program also terminates with the same error code.
Also some environment variables are set:
X = zero-based horizontal number of the slice in its row
Y = zero-based vertical number of the slice in its column
Z = zero-based slice number
W = width of this slice
H = height of this slice
(W and H are provided for convenience to avoid having to copy the input to
find this information)
.Sh EXAMPLES
$
.Nm
300 40000 'cat > SLICE_$Z.ff' < iamge.ff
.Sh SEE ALSO
.Xr ff-hjoin 1 ,
.Xr ff-vjoin 1 ,
.Xr farbfeld 5 ,
.Xr farbfeld-utils 7