In computer science, a mask or bitmask is data that is used for bitwise operations, particularly in a bit field. Using a mask, multiple bits in a byte, nibble, word etc. can be set either on, off or inverted from on to off (or vice versa) in a single bitwise operation.
- 1Common bitmask functions
- 2Uses of bitmasks
Common bitmask functions[edit]
Fluid Mask 3 - Photo Cutout Software by VertusTech. Image Masking & Photo Manipulation. Standalone and Photoshop plug-in. Download the 30 day Free Trial! The Call Masking functionality of Freshcaller, lets you make calls from your business call center but disguised as a personal number. You can use this functionality to make your business seem personal and local to your customers. Mask your helpline number.
Masking bits to 1
[edit]
To turn certain bits on, the bitwise
OR
operation can be used, following the principle that Y OR 1 = 1
and Y OR 0 = Y
. Therefore, to make sure a bit is on, OR
can be used with a 1
. To leave a bit unchanged, OR
is used with a 0
.Example: Masking on the higher nibble (bits 4, 5, 6, 7) the lower nibble (bits 0, 1, 2, 3) unchanged.
Masking bits to 0
[edit]
More often in practice bits are 'masked off' (or masked to
0
) than 'masked on' (or masked to 1
). When a bit is AND
ed with a 0, the result is always 0, i.e. Y AND 0 = 0
. To leave the other bits as they were originally, they can be AND
ed with 1
, since Y AND 1 = Y
.Example: Masking off the higher nibble (bits 4, 5, 6, 7) the lower nibble (bits 0, 1, 2, 3) unchanged.
Querying the status of a bit[edit]
It is possible to use bitmasks to easily check the state of individual bits regardless of the other bits. To do this, turning off all the other bits using the bitwise
AND
is done as discussed above and the value is compared with 1
. If it is equal to 0
, then the bit was off, but if the value is any other value, then the bit was on. What makes this convenient is that it is not necessary to figure out what the value actually is, just that it is not 0
.Example: Querying the status of the 4th bit
Toggling bit values[edit]
So far the article has covered how to turn bits on and turn bits off, but not both at once. Sometimes it does not really matter what the value is, but it must be made the opposite of what it currently is. This can be achieved using the
XOR
(exclusive or) operation. XOR
returns 1
if and only if an odd number of bits are 1
. Therefore, if two corresponding bits are 1
, the result will be a 0
, but if only one of them is 1
, the result will be 1
. Therefore inversion of the values of bits is done by XOR
ing them with a 1
. If the original bit was 1
, it returns 1 XOR 1 = 0
. If the original bit was 0
it returns 0 XOR 1 = 1
. Also note that XOR
masking is bit-safe, meaning that it will not affect unmasked bits because Y XOR 0 = Y
, just like an OR
.Example: Toggling bit values
To write arbitrary 1s and 0s to a subset of bits, first write 0s to that subset, then set the high bits:
Uses of bitmasks[edit]
Arguments to functions[edit]
In programming languages such as C, bit fields are a useful way to pass a set of named boolean arguments to a function. For example, in the graphics API OpenGL, there is a command,
glClear()
which clears the screen or other buffers. It can clear up to four buffers (the color, depth, accumulation, and stencil buffers), so the API authors could have had it take four arguments. But then a call to it would look likewhich is not very descriptive. Instead there are four defined field bits,
GL_COLOR_BUFFER_BIT
, GL_DEPTH_BUFFER_BIT
, GL_ACCUM_BUFFER_BIT
, and GL_STENCIL_BUFFER_BIT
and glClear()
is declared asThen a call to the function looks like this
Internally, a function taking a bitfield like this can use binary
and
to extract the individual bits. For example, an implementation of glClear()
might look like:The advantage to this approach is that function argument overhead is decreased. Since the minimum datum size is one byte, separating the options into separate arguments would be wasting seven bits per argument and would occupy more stack space. Instead, functions typically accept one or more 32-bit integers, with up to 32 option bits in each. While elegant, in the simplest implementation this solution is not type-safe. A
GLbitfield
is simply defined to be an unsigned int
, so the compiler would allow a meaningless call to glClear(42)
or even glClear(GL_POINTS)
. In C++ an alternative would be to create a class to encapsulate the set of arguments that glClear could accept and could be cleanly encapsulated in a library (see the external links for an example).Inverse masks[edit]
Masks are used with IP addresses in IP ACLs (Access Control Lists) to specify what should be permitted and denied. To configure IP addresses on interfaces, masks start with 255 and have the large values on the left side: for example, IP address 209.165.202.129 with a 255.255.255.224 mask. Masks for IP ACLs are the reverse: for example, mask 0.0.0.255. This is sometimes called an inverse mask or a wildcard mask. When the value of the mask is broken down into binary (0s and 1s), the results determine which address bits are to be considered in processing the traffic. A 0 indicates that the address bits must be considered (exact match); a 1 in the mask is a 'don't care'. This table further explains the concept.
Mask example:
network address (traffic that is to be processed) 10.1.1.0
mask 0.0.0.255
network address (binary) 00001010.00000001.00000001.00000000
mask (binary) 00000000.00000000.00000000.11111111
Based on the binary mask, it can be seen that the first three sets (octets) must match the given binary network address exactly (00001010.00000001.00000001). The last set of numbers is made of 'don't cares' (.11111111). Therefore, all traffic that begins with 10.1.1. matches since the last octet is 'don't care'. Therefore, with this mask, network addresses 10.1.1.1 through 10.1.1.255 (10.1.1.x) are processed.
Subtract the normal mask from 255.255.255.255 in order to determine the ACL inverse mask. In this example, the inverse mask is determined for network address 172.16.1.0 with a normal mask of 255.255.255.0.
255.255.255.255 - 255.255.255.0 (normal mask) = 0.0.0.255 (inverse mask)
ACL equivalents
The source/source-wildcard of 0.0.0.0/255.255.255.255 means 'any'.
The source/wildcard of 10.1.1.2/0.0.0.0 is the same as 'host 10.1.1.2'
Image masks[edit]
Number Masking Softwares For Computer
Raster graphicsprites (left) and masks (right)
In computer graphics, when a given image is intended to be placed over a background, the transparent areas can be specified through a binary mask. This way, for each intended image there are actually two bitmaps: the actual image, in which the unused areas are given a pixel value with all bits set to 0s, and an additional mask, in which the correspondent image areas are given a pixel value of all bits set to 0s and the surrounding areas a value of all bits set to 1s. In the sample at right, black pixels have the all-zero bits and white pixels have the all-one bits.
At run time, to put the image on the screen over the background, the program first masks the screen pixel's bits with the image mask at the desired coordinates using the bitwise AND operation. This preserves the background pixels of the transparent areas while resets with zeros the bits of the pixels which will be obscured by the overlapped image.
Then, the program renders the image pixel's bits by combining them with the background pixel's bits using the bitwise OR operation. This way, the image pixels are appropriately placed while keeping the background surrounding pixels preserved. The result is a perfect compound of the image over the background.
This technique is used for painting pointing device cursors, in typical 2-D videogames for characters, bullets and so on (the sprites), for GUIicons, and for video titling and other image mixing applications.
Although related (due to being used for the same purposes), transparent colors and alpha channels are techniques which do not involve the image pixel mixage by binary masking.
The best online music game EVER! Keep the rhythm to chart topping tracks and rock the party! Description: The best online music game EVER! Keep the rhythm to chart topping tracks and rock the party! Whether you like Adventure or Racing, Classic Arcade or Action, Strategy Puzzles or Dress Up games, we have something for you. Play Beat em up Games on Y8.com. Beat the enemy on a 1 on 1 boxing or martial arts mart and be the winner by TKO. The best of the BeatEmUp Genre only at Y8.com. Nov 17, 2009 The best online music game EVER! Got your speakers on? Select the song you want to play in the main menu and use your keyboard to hit the right keys at the right time for the highest score. Keep the rhythm and rock the party! By clicking 'Add Up Beat to Your Website', you agree to the Webmaster Terms and Conditions. Add Up Beat to Your Website Help. Up beat game.
Hash tables[edit]
To create a hashing function for a hash table, often a function is used that has a large domain. To create an index from the output of the function, a modulo can be taken to reduce the size of the domain to match the size of the array; however, it is often faster on many processors to restrict the size of the hash table to powers of two sizes and use a bitmask instead.
An example of both modulo and masking in C:
See also[edit]
External links[edit]
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Mask_(computing)&oldid=914805212'
|
Advertisement
More by: relevance | popularity | freeware | mobile | title |
1 | Spooky Sounds - MorphVOX Add-on |
---|---|
Scare your friends online with Spooky Sounds for MorphVOX Voice Masking Software. Now you can blast you buddies with bone-chilling sound effects. Choose from 18 effects including screams, creaks and evil laughs. Scare your friends online with Spooky .. | |
Size: 1.0 MB, Price: Free, License: Freeware, Author: Screaming Bee LLC (screamingbee.com) |
2 | Soundmasker |
---|---|
Sound Masker is a complete replacement for hardware noise masking products. You can mix and match combinations and playback the output in realtime, or alternatively record to wav or mp3 for portable sound masking. Sound Masker generates various types .. | |
Size: 8.0 MB, Price: USD $19.95 , License: Shareware, Author: Vectormedia Software (vectormediasoftware.com) |
3 | Soundmasker Deluxe |
---|---|
Sound Masker is a complete replacement for hardware noise masking products. You can mix and match combinations and playback the output in realtime, or alternatively record to wav or mp3 for portable sound masking. Sound Masker is a complete replacement .. | |
Size: 16.1 MB, Price: USD $29.95 , License: Shareware, Author: Vectormedia Software (vectormediasoftware.com) |
4 | Tinnitus Masker Deluxe |
---|---|
Tinnitus Masker Deluxe allows you to choose exactly which sounds you find best mask your tinnitus and mix them together to create realtime masking relief via headphones or alternatively record to wav or mp3 to create custom portable masking relief. Tinnitus .. | |
Size: 7.7 MB, Price: USD $29.95 , License: Shareware, Author: Vectormedia Software (vectormediasoftware.com) | |
Cd, Cds, Generator, Home, Masker, Masking, Mp3, Noise, Pink, Recorder, Wav, White |
5 | SapphireIMEI |
---|---|
Read the device's IMEI and IMSI numbers. With our IMEI Mobile Developer Library (DLL Component) If you are rolling out your application on Smartphone, Pocket PC phone edition or Windows Mobile device, you may wish to record the device’s International .. | |
Size: 85.0 KB, Price: USD $349.00 , License: Shareware, Author: Sapphire Solutions Ltd. (sapphire-solutions.co.uk) | |
C#, Evb, Imei, Imsi, Mobile, Pocket |
6 | Recomposit |
---|---|
Providing chromakey and inside/outside edge matting, Recomposit can help solve the photo masking problem. Chromakey works for blue and green screen, and in/outside masking also known as trimap mating Cut Out objects from its background by Recomposit. | |
Size: 4.5 MB, Price: USD $59.00 , License: Shareware, Author: Stepok Image Lab (stepok.net) | |
Blue Screen, Chromakey, Cut Out, Green Screen, Matting, Photo Mask, Photo Masking Software |
7 | Pocket PC Forensic Utility |
---|---|
Mobile Forensic software display read/unread text messages IMEI number phone book contact numbers along with name. Mobile phone investigator observe deeply and pull out all relevant content including Contact details, Phone model, IMEI (International .. | |
Size: 1.1 MB, Price: USD $79.00, INR 3380 , License: Shareware, Author: File Recovery Utilities (filesrecovery.org) | |
Contact, Db, Details, Display, Extract, Forensic, Hp, Imate, Imei, Imsi, Inbox, Investigate, Ipaq, Messages, Mobile, Model, Monitor, Number, Os, Outbox |
8 | PDA Forensics Tool |
---|---|
PDA forensics tool is capable to show you every Smartphone details like database records, operating system registry information, folders content, memory status, mobile details likes IMEI number, contact numbers etc with easy to use interface. Smartphone .. | |
Size: 1.2 MB, Price: USD $79.00, INR 3496 , License: Shareware, Author: Freeware utilities (rootdata.org) | |
Analysis, Analyze, Application, Call History, Detail, Device, Extract, Forensic, Hardware, Imei Number, Investigate, Manufacturer, Mobile, Monitoring, Palmtop, Pda, Phonebook, Pocket Pc, Registry, Smart Phone |
9 | InstantMask |
---|---|
InstantMask is a simple easy to use and powerful background removal and image masking tool. It lets you remove background with few mouse clicks and moves. You mark the object with one marker and background with another and the program does the rest. .. | |
Size: 5.3 MB, Price: Free, License: Freeware, Author: CPSSoftware (clipping-path-studio.com) | |
Background Removal, Image Masking, Masking, Photo Editor, Picture Editor |
10 | Mobile Phone Investigation Software |
---|---|
Mobile phone investigation software provides facility to examine and display mobile model number, IMEI number, battery status, manufacturer name, memory capacity, SIM IMSI number, signal quality and phonebook capacity. Mobile phone investigation software .. | |
Size: 720.0 KB, Price: USD $4869.00 , License: Free to try, Author: Password Recovery (a-granted.com) | |
Analysis, Battery, Cell, Code, Create, Detail, File, Forensic, Format, Imei, Imsi, Investigation, Manufacture, Mfc, Mobile, Number, Pda, Phone, Program, Retrieve |
11 | Data Masking Suite |
---|---|
Easy Data Masking - simple to install, flexible, and self-explanatory. Easy Data Masking - simple to install, flexible, and self-explanatory. Create test data and mask sensitive data. Orpheus Data Masking Suite is exceptionally easy .. | |
Size: 3.6 MB, Price: Free, License: Freeware, Author: orpheus-it.com (orpheus-it.com) | |
Masking, Obfuscation, Protect, Sanitization, Sensitive |
12 | Venetian Mask |
---|---|
Venetian Mask is a handy, easy to use image-masking software designed to revolve around the new user-friendly and interactive use of the standard 'magic wand' tool. Venetian Mask is a handy, easy to use image-masking software designed to revolve .. | |
Size: 0, Price: Free, License: Freeware, Author: Gert De Roost (sourceforge.net) | |
Adjust, Edit, Edit, Editor, Image-masking, Image, Mask, Venetian |
13 | Artizen HDR |
---|---|
Web Safe Colors, CMYK, sRGB, and RGB), Generate DHTML Pages, Web Galleries, Rotating, Resizing, (Optionally Unlimited) Undo/Redo, Editable Vector Shapes, Powerful Masking Tools, 200+ Layers Support, 17 Layer Blend Modes, 60+ Image Retouching Tools, .. | |
Size: 9.0 MB, Price: Free, License: Freeware, Author: Supporting Computers Inc. (supportingcomputers.net) | |
16 Bit, 32 Bit, Cmyk, Dynamic Range, Fstop, Gif, Hdr, Hdri, Html, Image Editor, Jpeg, Layers, Masking, Paths, Pfm, Png, Reinhard, Text, Tone Mapping, Vectors |
14 | Translucator |
---|---|
Using Translucator you can make a result that is unavailable with other masking programs like Adobe Magic Extractor, Corel Knock-Out, Microsoft Expression and so on. Features at glance • Ability to cut translucent .. | |
Size: 3.0 MB, Price: USD $29.95 , License: Shareware, Author: ImageSkill (imageskill.com) | |
Alpha Channel, Background Eraser, Collage, Layer, Magic Extractor, Mask, Masking, Object Extraction, Object Selection, Opacity, Plug-in, Translucator, Translucent, Transparency |
15 | PC Mesh Anonymous Web Surfing |
---|---|
PC Mesh Anonymous Web Surfing is an Internet utility to let users surf the Web anonymously by masking their IP address. PC Mesh Anonymous Web Surfing is an Internet utility to let users surf the Web anonymously by masking their IP address. .. | |
Size: 954.6 KB, Price: USD $39.95 , License: Shareware, Author: PC Mesh (pcmesh.com) | |
Anonymous, Anonymously, Browse, Browsing, Internet, Online, Privacy, Proxy, Surf, Surfing, Web |
16 | Mobile phone inspector |
---|---|
Cell phone investigation software is available with source code based on VC++ and MFC, works for the complete inspection of mobile phone information like manufacturer name, IMEI number, phonebook, battery status, memory capacity, SMS etc. Mobile phone .. | |
Size: 689.0 KB, Price: USD $4869.00, INR 208541 , License: Shareware, Author: Laptop Data Recovery (p-dd.co.uk) | |
Activesync, Byte Code, Cell Phone, Configuration, Detect, Device, Dll, Embedded, Forensic, Hardware, Inspector, Manager, Mfc, Mobile, Motorola, Nokia, Pda, Phone, Pocket Pc, Samsung |
17 | Background Remover |
---|---|
Unlike the knowing masking tools Background Remover is not implemented as a brush. You only need to mark very roughly an object and background colors and choose the cutting out tool from a toolbar. Excellent and perfect object extraction is achieved .. | |
Size: 19.2 MB, Price: USD $49.00, EUR 39 , License: Shareware, Author: ImageSkill Software (imageskill.com) | |
Alpha Channel, Background Eraser, Background Erasing, Background Remover, Background Removing, Collage, Cutting Objects, Imageskill, Layer, Mask, Masking Object, Object Segmentation, Object Selection, Objects Extraction, Plugin, Transparency |
18 | Tinnitus Masker Pro : Tinnitus Relief Software |
---|---|
Tinnitus Masker Pro allows you to choose from 14 different sounds and change their parameters so you can achieve the best masking effect for your tinnitus symptoms. Tinnitus Masker Pro allows you to choose from 14 different sounds and change their parameters .. | |
Size: 6.2 MB, Price: USD $30.00 , License: Commercial, Author: Vectormedia Software (vectormediasoftware.com) |
19 | Password Generator Professional |
---|---|
Use Flexible Masking Patterns Use masked mode to fine tune your results. Enjoy Word List and Dictionary Support Grab words from files, modify and use them as you please. Make Easy To Remember .. | |
Size: 3.2 MB, Price: USD $29.95, EUR 23.95 , License: Shareware, Author: Kristanix Software (kristanixsoftware.com) | |
Commandline, Dictionary, Generate Password, Generate Serial, Masking, Random Number, Serial Number |
20 | PDA Investigation software |
---|---|
PDA analyzer utility retrieve information from pocket PC such as registry records, database records, model number, call history, memory usage, saved SMS, contact numbers, mobile manufacturer name, OS architecture, IMEI number of windows mobile phone. | |
Size: 1.2 MB, Price: USD $79.00 , License: Free to try, Author: Password Recovery (a-granted.com) | |
Analysis, Application, Device, Examine, Extract, Forensic, Hardware, Imei, Information, Investigate, Manufacturer, Mobile, Number, Palmtop, Pda, Phone, Phonebook, Pocket, Program, Registry |
21 | Water and Leafs |
---|---|
Water and Leafs Easy to Edit/Add 100 % Vector Masking Work Re sizable Just copy and paste it into your flash movie. Water and Leafs Easy to Edit/Add 100 % Vector Masking Work Re sizable Just copy and paste it into your flash movie. | |
Size: 100.0 KB, Price: USD $4.00 , License: Commercial, Author: Flash Components (flashcomponents.net) | |
Actionscript 2, Actionscript 3, Audio, Flash Component, Flash Components, Flash Extensions, Gallery, Menu, Slideshow, Template, Video, Xml |
22 | Edit Toolbox for Mac OS |
---|---|
More than 50 modules that can be combined together thru masking and channels to creat your own imaging effect. More than 50 modules that can be combined together thru masking and channels to creat your own imaging effect. Combine it through or virtual .. | |
Size: 60.2 MB, Price: Free, License: Freeware, Author: human software (humansoftware.com) | |
Edit Toolbox |
![Softwares Softwares](/uploads/1/2/6/2/126205831/611542708.jpg)
23 | Portraiture Plugin for Photoshop for Mac OS |
---|---|
Eliminates the tedious labor of selective masking and pixel-by-pixel treatments to deliver accurate, natural-looking skin retouching in seconds! Eliminates the tedious labor of selective masking and pixel-by-pixel treatments to deliver accurate, natural-looking .. | |
Size: 4.0 MB, Price: Free, License: Freeware, Author: Imagenomic (imagenomic.com) | |
For, Photoshop, Plugin, Portraiture |
Number Masking Softwares For Pc
24 | LBE PAN Masker |
---|---|
Multiple masking configurations allow you to search and replace different account number formats in one process. PANs may have embedded spaces or newlines and they will still be processed. Simple configuration file allows you to specify effectively .. | |
Size: 2.1 MB, Price: USD $6395.00 , License: Shareware, Author: Leigh Business Enterprises Ltd. (primaryaccountnumbermasking.com) | |
Account, Card, Card, Credit, Data, Dss, Industry, Masking, Masking, Numbers, Pan, Payment, Pci, Primary, Security, Standard |
25 | Topaz ReMask |
---|---|
Topaz ReMask is a Photoshop plugin designed to enhance the masking and extraction workflow of photographers and designers. Topaz ReMask is a Photoshop plugin designed to enhance the masking and extraction workflow of photographers and designers. Other .. | |
Size: 19.9 MB, Price: USD $69.99 , License: Shareware, Author: Topaz Labs, LLC. (downloads.topazlabs.com) | |
Create, Create, Creator, Cut-away, Extract, Mask, Object, Opacity, Photo |
More by: relevance | popularity | freeware | mobile | title |