--- ray/doc/man/man1/rcrop.1 2022/03/15 00:25:50 1.1 +++ ray/doc/man/man1/rcrop.1 2022/03/17 17:08:27 1.5 @@ -1,4 +1,4 @@ -.\" RCSid "$Id: rcrop.1,v 1.1 2022/03/15 00:25:50 greg Exp $" +.\" RCSid "$Id: rcrop.1,v 1.5 2022/03/17 17:08:27 greg Exp $" .TH RCROP 1 3/14/2022 RADIANCE .SH NAME rcrop - crop RADIANCE matrix or picture @@ -20,6 +20,16 @@ Note that rows are numbered from 0 at the top of a mat and columns are changing fastest in the input, which can have any number of components per matrix element. .PP +The input must have a valid header, including dimensions and format, +and a header will always be produced. +This is similar behavior to +.I rmtxop(1). +If the input header is missing, one can usually be added with an +appropriate call to +.I rcollate(1). +If an output header is not desired, it can be removed using +.I getinfo(1). +.PP One cannot specify crop boundaries outside the matrix dimension limits. If a 0 value is specified for the number of rows to copy, then all rows will be copied, starting from row0. @@ -37,12 +47,19 @@ However, one must remember that rows correspond to Y coordinates, and the orientation is reversed from a standard picture, where Y=0 is the bottom scanline. .PP -If no input file is given, data will be taken from the standard input. -If no output file is specified, data will be copied to the standard output. All matrix formats are supported, including text (ASCII), binary float and double. +The +.I rcrop +tool also works on encoded normal vector files produced by +.I rcode_norm(1) +and encoded depth files produced by +.I rcode_depth(1). Data is copied verbatim, i.e., there is no internal conversion to another representation, although white space may change in text files. +.PP +If no input file is given, data will be taken from the standard input. +If no output file is specified, data will be copied to the standard output. .SH EXAMPLES To crop a matrix down to 15 rows by 19 columns, starting at row 10 and column 12: @@ -57,7 +74,16 @@ To crop a picture to (X by Y) = (1500 by 1000), starting from upper-left corner: .IP "" .2i rcrop 0 0 1000 1500 orig.hdr cropped.hdr +.PP +Two ways of computing the inner product of row 15 in matrix 1 by +column 27 in matrix 2 and extracting the result without a header, +the second command being more efficient: +.IP "" .2i +rmtxop -fa mat1.mtx mat2.mtx | rcrop 15 27 1 1 | getinfo - +.IP "" .2i +rmtxop -fa '!rcrop 15 0 1 0 mat1.mtx' '!rcrop 0 27 0 1 mat2.mtx' | getinfo - .SH AUTHOR Greg Ward .SH "SEE ALSO" -evalglare(1), pcompos(1), rcalc(1), rcollate(1), rfluxmtx(1), rmtxop(1) +evalglare(1), pcompos(1), rcalc(1), rcode_depth(1), +rcode_norm(1), rcollate(1), rfluxmtx(1), rmtxop(1), rsplit(1)