What's the terminology for bitmasks?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

What's the terminology for bitmasks?

Post by JellyFish »

There are two sides to a bitwise operation, one I believe is called the bitmask, and the other I don't know the name of. What is the name of it?

Code: Select all

$bitmask & $unknown;
What I'm asking is, what's the name of the integer that is being searched for in $bitmask? Also, is bitmask the correct name for the integer that holds all the different $unknowns that can go into it? Have I got it backwards, is it $bitmap & $bitmask? Is bitmap even a term in this context?

What are the correct terminologies for bitmasks?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: What's the terminology for bitmasks?

Post by josh »

User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Re: What's the terminology for bitmasks?

Post by JellyFish »

Actually I'm asking what the terminology is for the operands are in the context of bitmasks, not the term for & the operator. I wondering what I would call the integer that holds all of the other integers, and visa versa? I guess you would call it the bitmask or mask because it masks all the other integers. But would you call all the other integers?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: What's the terminology for bitmasks?

Post by alex.barylski »

I would say bitmap and bitmask, yes.

bitmap is the entire map of pixels that compose an image, whereas the mask is a section of the bitmap you typically want to extract or remove, hence mask. Think of masking off a section of wall (or a car) you wish to paint around or over top of.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: What's the terminology for bitmasks?

Post by Jenk »

JellyFish wrote:
Actually I'm asking what the terminology is for the operands are in the context of bitmasks, not the term for & the operator. I wondering what I would call the integer that holds all of the other integers, and visa versa? I guess you would call it the bitmask or mask because it masks all the other integers. But would you call all the other integers?
They are not integers, they are bits. Hence bitmasking, because you are masking bits.

When in this context, those "integers that contain integers" are not integers. They are the simplest form of binary string (i.e. 3 instead of "11" or 5 instead of "101" etc.)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: What's the terminology for bitmasks?

Post by Christopher »

JellyFish wrote:Actually I'm asking what the terminology is for the operands are in the context of bitmasks, not the term for & the operator. I wondering what I would call the integer that holds all of the other integers, and visa versa? I guess you would call it the bitmask or mask because it masks all the other integers. But would you call all the other integers?
A bitmask is something that you apply to a variable, like a divisor or addend. The variable you apply it to could have different names depending on context. It could be flags, a binary integer, etc. So I don't think there is one name for all contexts.

The term bitmap sound like multi-byte or multi-word binary data where the data may not be on byte/word boundaries. Compare that to an array which is map of scalars and not arbitrary bit length values.
(#10850)
Post Reply