UStencil(3U)

πŸ’– UStencil πŸ’–

okay bestie, welcome to the InterViews Reference Manual entry for UStencil β€” yes that's the 3U section, we're in the Unidraw zone now, and honestly? it's giving structured graphic displaying a bitmap. πŸŽ€


✨ NAME ✨

UStencil β€” a structured graphic that displays a bitmap. iconic behavior tbh πŸ’…


🌸 SYNOPSIS 🌸

#include <Unidraw/Graphic/stencil.h>

like that's it, that's the whole vibe check, just include it and go πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so a UStencil is a Graphic that displays a bitmapped image, periodt. ✨

Two Bitmap objects β€” an image and a mask β€” are what define a stencil's appearance. no cap, it takes both.

here's the tea on how it paints 🎨: the stencil potentially paints foreground color where image has a true value, and background color where image is false β€” but only pixels that have a corresponding true value in mask are thus affected. so the mask is the bouncer at the club, fr fr. πŸšͺ✨

the stencil's origin coincides with the origins of the image and mask bitmaps. alignment matters bestie

and the mask's bounding box defines the stencil's extent. so like, the mask decides how big the whole thing is. πŸ‘‘


πŸ’… PUBLIC OPERATIONS πŸ’…

  • UStencil(Bitmap* image, Bitmap* mask = nil, Graphic* = nil) β€” Construct a UStencil, supplying an image and an optional mask bitmap and an optional graphic from which to obtain an initial set of graphics state. 🫢

and here's the cute part: specifying nil for mask is equivalent to supplying a mask of the same size and shape as image that contains all true values. so it's like "no mask? bet, everything shows." 🌈

  • void GetOriginal(Bitamp*&, Bitmap*&) β€” Return the bitmap parameters supplied in the constructor. it gives you back what you put in, bestie. πŸ”₯

πŸŽ€ SEE ALSO πŸŽ€

  • Bitmap(3I)
  • Graphic(3U)

go read those too, they're lowkey essential, iykyk πŸ’œ


ngl, remember: mask defaults to nil, and that nil is not "nothing shows" β€” it's "everything shows, same size and shape as image, all true values." don't get it twisted. 😭

and that's the whole page, bestie!! πŸ“ this was brought to you by Unidraw, dated 2 February 1991 (yes we're serving vintage, the manpage ate and left no crumbs πŸ’€βœ¨), filed under UStencil(3U). mwah, study it, slay it, see you in the group chat πŸ§šπŸ’–