WAVELET(1)
π WAVELET(1) β the BRL-CAD girlie's guide to Haar wavelets π
okay so bestie, before we even start: this is WAVELET(1), straight out of the BRL-CAD manual set. she does Haar wavelet stuff. she's iconic. let's go β¨
β¨ NAME β¨
wavelet β literally performs a Haar wavelet decomposition or reconstruction. that's the whole job. she decomposes, she reconstructs, she leaves. π
π¦ SYNOPSIS π¦
wavelet {-d | -r} [-1 | -2] [-t _datatype_] [-# _channels_] [-w _width_] [-n _scanlines_] [-s _squaresize_] [-W _out_size_] [-S _out_size_] [-R _avg_size_] [-D _level_] < datastream > wavelets
read it like a sentence, bestie: pick -d or -r (you have to pick one, no cap), then sprinkle on whatever flags you need, feed it a datastream on stdin, and the wavelets come out on stdout. π«Ά
πΈ DESCRIPTION πΈ
so the wavelet command performs a Haar wavelet transform on a raw binary dataset that it reads from standard input, and then writes the transformed result to standard output. that's the vibe. π
she can go two ways:
- decompose β break a signal down into successively coarser "average" terms plus "detail" coefficients
- reconstruct β build the original signal back up from one of those decompositions
and the way that decomposition and reconstruction are inverse operations? obsessed. π they literally undo each other.
the transform operates on interleaved, fixed-width samples β which means it works directly on image formats like pix(5) and bw(5) by treating each pixel as one sample with however many channels that format has. no conversion era needed. πΌοΈ
heads up though: a two-dimensional transform requires a square dataset. square only. no rectangles allowed, sorry babe. π
and now the β¨dramatic warningβ¨ β because the Haar transform sums and differences sample values, results can overflow narrow integer types. that's not a vibe. for lossless decomposition and reconstruction, convert the data to the next larger data type first using the -t option. protect your data. protect your peace. ππ
π OPTIONS π
-dβ perform a decomposition. the breaking-it-down era.-rβ perform a reconstruction. the putting-it-back-together era.-1β do a one-dimensional transform (per-scanline, horizontal). this is the default, so if you say nothing she's already on it. πββοΈ-2β do a two-dimensional transform (interleaved horizontal and vertical). the dataset must be square β do not test her on this. β¬-t_datatype_ β specify the data type of the samples, which is also the type used for the wavelet arithmetic. the letter is the first character of the C type:c(char),s(short),i(int),l(long),f(float),d(double). the default ischar. π-#_channels_ β number of values per sample point. like, use-# 3to transform apix(5)file so the red, green, and blue channels each get transformed individually. default is3. π-w_width_ β number of samples per scanline. default is512. π-n_scanlines_ β number of scanlines in the dataset. default is512. π§΅-s_squaresize_ β sets the width and the number of scanlines to the same value at once, i.e. a square dataset. two-for-one, we love efficiency. β¬-W_out_size_ β width of the average image in the output. normally a full decomposition reduces this to1, but you can specify a power-of-two value where decomposition or reconstruction should stop. the output then holds an averaged image of the given size, with the rest of the data stored as detail coefficients. π-S_out_size_ β same as-W, but expressed as the square size of a two-dimensional transform limit. πͺ-R_avg_size_ β resume a transform from a decomposition that left off with an average image of size _avg_size_. the "pick up where we left off" flag, iykyk. β―οΈ-D_level_ β set the debug output level. diagnostic info about data type, channels, width, height, and limit gets written to standard error. nosy but useful. π
π§ EXAMPLES π§
β Example 1. Display a horizontal decomposition
wavelet -d -# 3 -s 512 < img.pix | pix-fb
this decomposes each scanline of a 512x512 color pix(5) image and displays the result on a framebuffer with pix-fb(1). each scanline shows a shrinking "average" toward the left, with the detail coefficients hanging out on the right. visual slay. π₯
β Example 2. Two-dimensional decomposition with a stopping size
wavelet -d -2 -# 3 -s 1024 -S 64 < img.pix > img.wlt
performs a 2D decomposition of a 1024x1024 color image, stopping once the average has been reduced to 64x64. the output image holds a 64x64 version of the original in the lower-left corner, with detail terms filling the remainder β all ready to be inverted with:
wavelet -r -2 -s 1024 -R 64
round trip complete. she ate. π β¨
π SEE ALSO π
brlcad(1), pix-fb(1), pix(5), bw(5) β go read those too, bestie, they're all part of the family π«Ά
π AUTHOR π
BRL-CAD Team β the icons behind the whole thing π
π COPYRIGHT π
This software is Copyright (c) 1999-2026 by the United States Government as represented by U.S. Army Research Laboratory. periodt. π
π BUG REPORTS π
found a bug? a problem? a little gremlin in the code? reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. do not suffer in silence, that's not the vibe. π§
and that's the page, babe π this was WAVELET(1) from the BRL-CAD manual set β that's the source, that's the version tag on the footer, and no, there's no date stamp on this one, don't @ me. πΈπ¦β¨
π¦ 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