U-D(1)
π U-D(1) β the glowed-up manual page
okay bestie, buckle up, because this is u-d, and it's genuinely the moment. it lives in the BRL-CAD family (that's the manual name, don't forget it π) and it does exactly one thing, but it does it flawlessly.
β¨ NAME β¨
u-d β converts unsigned shorts into doubles. that's it. that's the whole personality. π¦
πΈ SYNOPSIS πΈ
u-d [-n | scale] < shorts > doubles
look at her. redirect both sides. she's not asking, she's telling π
π DESCRIPTION π
okay so here's the vibe. u-d reads a stream of 16-bit unsigned short integers from standard input and writes a stream of double-precision floating point values to standard output. she's the counterpart of d-u(1), which is the girl who does the exact opposite direction. sisters fr fr π«Ά
by default, every value gets copied through unchanged β that's a scale factor of 1.0, no notes. but if you hand her a numeric scale argument, she multiplies every single value by that factor before writing it out. a scale of zero is rejected as an error, periodt, don't even try it.
β οΈ important caveat, bestie, listen: both standard input and standard output have to be redirected. if standard input is a terminal, u-d prints a usage message and exits on you. no cap.
also the data is processed in blocks of 512 values, which means the byte ordering of the input shorts is whatever the host machine's byte ordering is. iykyk π
π₯ OPTIONS π₯
-nβ normalize the data, slay. every unsigned short gets multiplied by1/65536, which maps the full0-65535input range into the half-open interval[0.0, 1.0). iconic. this one is mutually exclusive with an explicit scale, so pick a lane π―scaleβ a floating point factor that every input value gets multiplied by. default is1.0(aka just pass the values through untouched). a value of0is an error π«
π§ EXAMPLES π§
π Example 1. Normalize 16-bit samples for further processing
u-d -n < heightfield.shorts > heightfield.d
dstats < heightfield.d
convert a file of unsigned shorts β say, a 16-bit elevation grid β into normalized doubles in the range [0.0, 1.0), then report statistics on the result with dstats(1). the way this just works ππ
β Example 2. Apply a custom scale factor
u-d 0.01 < sensor.shorts > sensor.d
multiply every input sample by 0.01 while converting to doubles β for example to rescale raw fixed-point readings into engineering units. look at her go π
π SEE ALSO π
brlcad(1), d-u(1), u-a(1), u-bw(1), u-f(1) β go read those too, they're all main character energy β
π AUTHOR π
BRL-CAD Team π
π COPYRIGHT π
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β yes, actual email, we're being so serious about this π§
okay that's the whole page, bestie!! π«Ά this iconic little number comes to you straight from BRL-CAD and it's the U-D(1) page β go forth and convert those shorts π
β¨
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms