1 |
|
.\" RCSid "$Id$" |
2 |
< |
.TH RMTXOP 1 7/8/97 RADIANCE |
2 |
> |
.TH RMTXOP 1 5/31/2014 RADIANCE |
3 |
|
.SH NAME |
4 |
|
rmtxop - concatenate, add, multiply, divide, transpose, scale, and convert matrices |
5 |
|
.SH SYNOPSIS |
9 |
|
][ |
10 |
|
.B \-f[afdc] |
11 |
|
][ |
12 |
< |
.B \-t |
12 |
> |
.B "\-C {symbols|file}" |
13 |
|
][ |
14 |
+ |
.B "\-c ce .." |
15 |
+ |
][ |
16 |
|
.B "\-s sf .." |
17 |
|
][ |
18 |
< |
.B "\-c ce .." |
18 |
> |
.B \-t |
19 |
> |
][ |
20 |
> |
.B "\-rf|\-rb" |
21 |
|
] |
22 |
|
.B m1 |
23 |
|
[ |
28 |
|
.I Rmtxop |
29 |
|
loads and concatenates or adds/multiplies/divides |
30 |
|
together component matrix files given on the command line. |
31 |
< |
Each file must have a header containing the following variables: |
31 |
> |
Each file must have a header containing the following metadata: |
32 |
|
.sp |
33 |
|
.nf |
34 |
|
NROWS={number of rows} |
35 |
|
NCOLS={number of columns} |
36 |
|
NCOMP={number of components} |
37 |
< |
FORMAT={ascii|float|double|32-bit_rle_rgbe|32-bit_rle_xyze} |
34 |
< |
.sp |
37 |
> |
FORMAT={ascii|float|double|32-bit_rle_rgbe|32-bit_rle_xyze|Radiance_spectra} |
38 |
|
.fi |
39 |
+ |
.sp |
40 |
|
The number of components indicates that each matrix element is actually |
41 |
|
composed of multiple elements, most commonly an RGB triple. |
42 |
|
This is essentially dividing the matrix into planes, where each component |
45 |
|
.I rcollate(1). |
46 |
|
A matrix may be read from the standard input using a hyphen by itself ('-') |
47 |
|
in the appropriate place on the command line. |
48 |
< |
.PP |
45 |
< |
Any of the matrix inputs may be read from a command |
48 |
> |
Similarly, any of the inputs may be read from a command |
49 |
|
instead of a file by |
50 |
|
using quotes and a beginning exclamation point ('!'). |
51 |
|
.PP |
52 |
|
Two special cases are handled for component matrices that are either |
53 |
< |
XML files containing BTDF data, or Radiance picture files. |
54 |
< |
In the first case, a BSDF library is used to load and interpret the |
55 |
< |
transmission matrix. |
53 |
> |
XML files containing BSDF data, or Radiance picture files. |
54 |
> |
In the first case, the BSDF library loads and interprets the |
55 |
> |
transmission matrix by default. |
56 |
> |
Alternatively, the front (normal-side) reflectance is selected if the |
57 |
> |
.I \-rf |
58 |
> |
option precedes the file name, or the backside reflectance if |
59 |
> |
.I \-rb |
60 |
> |
is specified. |
61 |
|
(XML files cannot be read from the standard input or from a command.)\0 |
62 |
|
In the second case, the RGBE or XYZE values are loaded in a 3-component |
63 |
|
matrix where the number of columns match the X-dimension of the picture, and |
64 |
|
the number of rows match the Y-dimension. |
65 |
|
The picture must be in standard pixel ordering, and the first row |
66 |
|
is at the top with the first column on the left. |
67 |
< |
Any exposure changes applied to the pictures beforehand |
67 |
> |
Any exposure changes that were applied to the pictures before |
68 |
|
.I rmtxop |
69 |
|
will be undone, similar to the |
70 |
< |
.I pcomb\(1) |
70 |
> |
.I pcomb(1) |
71 |
|
.I \-o |
72 |
|
option. |
73 |
+ |
Radiance spectral pictures with more than 3 components are also supported. |
74 |
+ |
These are typically produced by |
75 |
+ |
.I rtrace(1) |
76 |
+ |
or |
77 |
+ |
.I rfluxmtx(1). |
78 |
|
.PP |
79 |
< |
Before each file, the |
79 |
> |
Before each input, the |
80 |
|
.I \-t |
81 |
|
and |
69 |
– |
.I \-s |
70 |
– |
or |
82 |
|
.I \-c |
83 |
+ |
and/or |
84 |
+ |
.I \-s |
85 |
|
options may be used to modify the matrix. |
86 |
|
The |
87 |
|
.I \-t |
88 |
|
option transposes the matrix, swapping rows and columns. |
89 |
|
The |
77 |
– |
.I \-s |
78 |
– |
option applies the given scalar factor(s) to the elements of the matrix. |
79 |
– |
If only one factor is provided, |
80 |
– |
it will be used for all components. |
81 |
– |
If multiple factors are given, their number must match the number of matrix |
82 |
– |
components. |
83 |
– |
Alternatively, the |
90 |
|
.I \-c |
91 |
< |
option may be used to "transform" the element values, possibly changing |
91 |
> |
option can "transform" the element values, possibly changing |
92 |
|
the number of components in the matrix. |
93 |
|
For example, a 3-component matrix can be transformed into a single-component |
94 |
|
matrix by using |
100 |
|
yield the second new component. |
101 |
|
Note that the number of coefficients must be an even multiple of the number |
102 |
|
of original components. |
103 |
+ |
.PP |
104 |
+ |
Alternatively, a set of symbolic output components may be given to the |
105 |
+ |
.I \-c |
106 |
+ |
option, with the following definitions: |
107 |
+ |
.sp |
108 |
+ |
.nf |
109 |
+ |
R - red channel |
110 |
+ |
G - green channel |
111 |
+ |
B - blue channel |
112 |
+ |
X - CIE X channel |
113 |
+ |
Y - CIE Y channel (aka., luminance or illuminance) |
114 |
+ |
Z - CIE Z channel |
115 |
+ |
S - scotopic luminance or illuminance |
116 |
+ |
M - melanopic luminance or illuminance |
117 |
+ |
A - average component value |
118 |
+ |
.fi |
119 |
+ |
.sp |
120 |
+ |
These letters may be given in any order as a single string, and if |
121 |
+ |
.I "-c RGB" |
122 |
+ |
or |
123 |
+ |
.I "-c XYZ" |
124 |
+ |
is specified for an input picture or the |
125 |
+ |
.I "-fc" |
126 |
+ |
option is given, the output will be written as a RGBE or XYZE picture. |
127 |
+ |
Note that conversion from a float or RGBE color space applies a conversion |
128 |
+ |
of 179 lumens/watt (for CIE or melanopic output) or 412 (for scotopic output), |
129 |
+ |
and the reverse happens for conversion from XYZE input to RGB or RGBE output. |
130 |
+ |
Lower case versions of all these components are also supported, the only |
131 |
+ |
difference is that the aforementioned efficacy factors |
132 |
+ |
will be left out of the conversion. |
133 |
+ |
.PP |
134 |
+ |
If a matrix or picture file path is given to the |
135 |
+ |
.I \-c |
136 |
+ |
option, then the color space of that file will be used, instead. |
137 |
+ |
.PP |
138 |
|
The |
139 |
+ |
.I \-C |
140 |
+ |
option takes either a symbolic color space or an input file, and will be |
141 |
+ |
applied to all subsequent matrices that do not have their own associated |
142 |
+ |
.I \-c |
143 |
+ |
option. |
144 |
+ |
.PP |
145 |
+ |
Additionally, the |
146 |
|
.I \-s |
147 |
< |
and |
147 |
> |
option applies the given scalar factor(s) to the elements of the matrix. |
148 |
> |
If only one factor is provided, |
149 |
> |
it will be used for all components. |
150 |
> |
If multiple factors are given, their number must match the number of matrix |
151 |
> |
components |
152 |
> |
.I after |
153 |
> |
application of any |
154 |
|
.I \-c |
155 |
< |
options are mutually exclusive, insofar as they cannot be applied together |
156 |
< |
to the same input matrix. |
155 |
> |
option for this input matrix or picture, even if the |
156 |
> |
.I \-s |
157 |
> |
option appears first. |
158 |
|
.PP |
159 |
|
If present, the second and subsequent matrices on the command |
160 |
|
line are concatenated together, unless separated by a plus ('+'), |
193 |
|
the number of rows and columns of the prior result and the |
194 |
|
next matrix must match, and will not be changed by the operation. |
195 |
|
.PP |
196 |
< |
A final transpose or scaling/transform operation may be applied to |
196 |
> |
A final transpose or transform/scaling operation may be applied to |
197 |
|
the results by appending the |
198 |
|
.I \-t |
199 |
|
and |
145 |
– |
.I \-s |
146 |
– |
or |
200 |
|
.I \-c |
201 |
+ |
and/or |
202 |
+ |
.I \-s |
203 |
|
options after the last matrix on the command line. |
204 |
|
.PP |
205 |
|
Results are sent to the standard output. |
206 |
< |
By default, the values will be written in the lowest resolution format |
206 |
> |
By default, the values will be written in the lowest precision format |
207 |
|
among the inputs, but the |
208 |
< |
.I \-f |
208 |
> |
.I \-f[adfc] |
209 |
|
option may be used to explicitly output components |
210 |
< |
as ASCII (-fa), binary doubles (-fd), floats (-ff), or RGBE colors (-fc). |
211 |
< |
In the latter case, the actual matrix dimensions are written in the resolution |
212 |
< |
string rather than the header. |
213 |
< |
Also, matrix results written as Radiance pictures must have either one |
210 |
> |
as ASCII (-fa), binary doubles (-fd), floats (-ff), or common-exponent |
211 |
> |
colors/spectra (-fc). |
212 |
> |
In the latter case, the actual matrix dimensions are written in |
213 |
> |
the resolution string rather than the header. |
214 |
> |
Also, matrix results will be written as standard |
215 |
> |
Radiance pictures if they have either one |
216 |
|
or three components. |
217 |
|
In the one-component case, the output is written as grayscale. |
218 |
+ |
If more than 3 components are in the final matrix and |
219 |
+ |
.I -fc |
220 |
+ |
is specified, the output will be a Radiance spectral picture. |
221 |
|
.PP |
222 |
|
The |
223 |
|
.I \-v |
236 |
|
.IP "" .2i |
237 |
|
rmtxop -fa -c .265 .670 .065 image.hdr > image_lum.mtx |
238 |
|
.PP |
239 |
+ |
To render a melanopic illuminance image with |
240 |
+ |
.I rtrace\: |
241 |
+ |
.IP "" .2i |
242 |
+ |
vwrays -ff -x 1024 -y 1024 -vf myview.vf | |
243 |
+ |
rtrace -fff -cs 18 -co+ -i+ `vwrays -x 1024 -y 1024 -vf myview.vf -d` scene.oct | |
244 |
+ |
rmtxop -fc -c M - > scene_meli.hdr |
245 |
+ |
.PP |
246 |
|
To scale a matrix by 4 and add it to the transpose of another matrix: |
247 |
|
.IP "" .2i |
248 |
|
rmtxop -s 4 first.mtx + -t second.mtx > result.mtx |
273 |
|
Note that this only applies to concatenation; |
274 |
|
element-wise addition, multiplication, and division are always |
275 |
|
evaluated from left to right. |
276 |
+ |
.SH BUGS |
277 |
+ |
The |
278 |
+ |
.I rmtxop |
279 |
+ |
command currently ignores the "PRIMARIES" setting in input |
280 |
+ |
headers, and does not produce any on output, even in |
281 |
+ |
circumstances where it would make sense to. |
282 |
|
.SH AUTHOR |
283 |
|
Greg Ward |
284 |
|
.SH "SEE ALSO" |
285 |
< |
cnt(1), getinfo(1), histo(1), neaten(1), pcomb(1), rcalc(1), |
286 |
< |
rcollate(1), rcontrib(1), rfluxmtx(1), rlam(1), |
287 |
< |
rsplit(1), tabfunc(1), total(1), wrapBSDF(1) |
285 |
> |
cnt(1), dctimestep(1), getinfo(1), pcomb(1), pfilt(1), |
286 |
> |
ra_xyze(1), rcalc(1), |
287 |
> |
rcollate(1), rcomb(1), rcontrib(1), rcrop(1), rfluxmtx(1), |
288 |
> |
rtpict(1), rtrace(1), vwrays(1), wrapBSDF(1) |