wxMask(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxMask β€” the Erlang module, bestie edition πŸ’–

okay so this is the manual page for wxMask(3), which lives in the Erlang module definition section of the wx docs. it's giving ✨bitmap masking✨ and honestly? iconic.


🌸 NAME 🌸

wxMask β€” this class encapsulates a monochrome mask bitmap, where the masked area is black and the unmasked area is white. no cap, that's the whole vibe. πŸ–€πŸ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” when you associate one of these with a bitmap and draw it in a device context, the unmasked area of the bitmap gets drawn, and the masked area does not get drawn. it's literally just "show this, hide that." main character energy for pixels. πŸ’…

⚠️ note, bestie: a mask can also be associated with a bitmap that has an alpha channel β€” BUT drawing those bitmaps under wxMSW may be slow. so if drawing performance matters to you at all, pls avoid that. fr fr. 🐌😭

See also, queen:

  • wxBitmap
  • wxDC:blit/6
  • wxMemoryDC

also, wxWidgets docs pointer: wxMask β€” go look it up if you want the C++ side of the story. πŸ“šβœ¨


πŸŽ€ DATA TYPES πŸŽ€

wxMask() :: wx:wx_object().

that's it. that's the type. short, sweet, slay. πŸ’–


πŸ‘‘ FUNCTIONS πŸ‘‘

🌈 create/2

create(This, Bitmap) -> boolean()
                  when This :: wxMask(), Bitmap :: wxBitmap:wxBitmap().

Constructs a mask from a monochrome bitmap. simple as that. πŸ–€πŸ€


🌈 create/3

create(This, Bitmap, Index) -> boolean()
                when
                    This :: wxMask(),
                    Bitmap :: wxBitmap:wxBitmap(),
                    Index :: integer();
            (This, Bitmap, Colour) -> boolean()
                when
                    This :: wxMask(),
                    Bitmap :: wxBitmap:wxBitmap(),
                    Colour :: wx:wx_colour().

two ways to do the thing, pick your fighter: constructs a mask from a bitmap and a colour that indicates the background. 🎨✨


🌈 destroy/1

destroy(This :: wxMask()) -> ok.

Destroys the object. bye bestie, we hardly knew ye πŸ˜­πŸ‘‹


🌈 new/0

new() -> wxMask().

Default constructor. no notes, just vibes. 🫢


🌈 new/1

new(Bitmap) -> wxMask() when Bitmap :: wxBitmap:wxBitmap().

Constructs a mask from a monochrome bitmap. same energy as create/2 but make it a constructor. πŸ’«


🌈 new/2

new(Bitmap, Index) -> wxMask()
            when Bitmap :: wxBitmap:wxBitmap(), Index :: integer();
        (Bitmap, Colour) -> wxMask()
            when
                Bitmap :: wxBitmap:wxBitmap(), Colour ::
wx:wx_colour().

yep, and again with a colour: constructs a mask from a bitmap and a colour that indicates the background. πŸŽ¨πŸ’–


🧚 reminder to my darling reader: an alpha-channel bitmap can be masked too, but under wxMSW that drawing may be slow. protect your frame rate, babe. 🫢

that's the whole page!! go mask something gorgeous πŸ’…βœ¨

this lil masterpiece came to you from Ericsson AB, version wx 2.6, dated wxMask(3). mwah, bye bestie πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from