BW-D(1)
π bw-d(1) β BRL-CAD π
okay bestie, welcome to the bw-d(1) page β this is the BRL-CAD era of turning black-and-white bytes into double-precision binary, and itβs lowkey iconic. π¦
β¨ NAME β¨
bw-d β convert black-and-white unsigned bytes to double-precision binary. literally what it says on the tin, no cap. π
π SYNOPSIS π
hereβs the whole mood:
bw-d [-n | scale] < unsigned_chars > doubles
π¦ DESCRIPTION π¦
okay so bw-d reads a stream of unsigned 8-bit bytes from standard input β think the pixel values of a bw(5) black-and-white image β and writes a stream of machine-native double-precision (8-byte) binary floating point values to standard output. itβs giving raw binary pipeline princess. β¨
By default, every byte is copied to its corresponding double value unchanged, from 0 to 255. If a numeric scale argument is supplied, every value is multiplied by that factor before output. The -n option is the shorthand glow-up: it normalizes the data by scaling the 0-255 input range to the 0.0-1.0 floating point range. π«Ά
Because the output is raw binary, bw-d refuses to run when standard input is a terminal. yes, itβs protecting you from a terminal full of mystery bytes, bestie π. The inverse conversion β from binary doubles back to unsigned bytes β is performed by d-bw(1).
β οΈ heads up: this command is deprecated and is scheduled for removal. it prints a deprecation warning on startup. so enjoy the vibe, but donβt build your whole personality on it, fr fr. π
π OPTIONS π
-nβ normalize the data by scaling the0-255input byte range to the0.0-1.0output range (equivalent to a scale of1/255). very clean, very demure β¨scaleβ multiply every input byte by this floating point factor before writing it. defaults to1.0(a straight0-255copy). Cannot be combined with-n. pick a lane, bestie π-h,-?β print a usage message and exit. the βhelp me help youβ icon behavior π«Ά
π EXAMPLES π
π Example 1. Normalize a black-and-white image to the 0.0-1.0 range
bw-d -n < image.bw > image.d
Converts every pixel byte in image.bw to a double in the range 0.0 to 1.0, producing a normalized binary double stream suitable for signal processing tools such as dmod(1) or dstats(1). slay for signal processing. π₯
π§ Example 2. Scale and round-trip through the double pipeline
bw-d 0.5 < image.bw | dmod -a 0.1 | d-bw > brighter.bw
Converts the image to doubles at half intensity, adds a constant offset with dmod(1), and converts the result back to a black-and-white byte stream with d-bw(1). a full round-trip glow-up, no cap. π
π SEE ALSO π
go read these too, bestie:
π AUTHOR π
BRL-CAD Team β iconic. periodt. π
πΈ COPYRIGHT πΈ
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. yes bestie, 1989-2026, we love a long-running era. π
π¦ BUG REPORTS π¦
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β donβt suffer in silence, bestie. π¬
okay thatβs the whole page! source/version footer vibes: BRL-CAD, manual page BW-D(1) β and thereβs no date printed in this footer, just those two, so thatβs the cute sign-off, mwah πβ¨
π¦ 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