Questions tagged [mask]

An image mask is a bitmap that specifies an area to paint, but not the color. In effect, an image mask acts as a stencil to specify where to place color on the page. Quartz uses the current fill color to paint an image mask.

A mask is a format expression mainly used in formatting user input in forms.

Common examples of this are date input fields that accepts only numbers and format the typed input with the needed characters:

User enters      Field contents
1                1
12               12
123              12/3
1231             12/31
...              ...
12312012         12/31/2012
2841 questions
31
votes
3 answers

How to mask UIViews in iOS

I've seen similar questions, but haven't found workable answers. I want to mask a UIView using a grey image (need to convert to alpha scale for masking). The UIView has background. It should be easy to mask an image, but I want to mask any…
subchap
  • 847
  • 2
  • 10
  • 15
30
votes
9 answers

Animating a CALayer's mask size change

I have a UIView subclass which uses a CAShapeLayer mask on its CALayer. The mask uses a distinct shape, with three rounded corners and a cut out rectangle in the remaining corner. When I resize my UIView using a standard animation block, the UIView…
Alex Repty
  • 1,060
  • 1
  • 9
  • 17
30
votes
5 answers

Cut Out Shape with Animation

I want to do something similar to the following: How to mask an image in IOS sdk? I want to cover the entire screen with translucent black. Then, I want to cut a circle out of the translucent black covering so that you can see through clearly. I'm…
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
29
votes
3 answers

Can you overlay a transparent css3 gradient over a background image?

I'm trying to put a css3 gradient over the top of a background image. Using the code below puts a background image on top of my gradient, but i'm trying to do it the other way around, so the gradient acts as a mask on…
Pineapple Sunset
  • 317
  • 1
  • 4
  • 8
29
votes
15 answers

Phone mask with jQuery and Masked Input Plugin

I have a problem masking a phone input with jQuery and Masked Input Plugin. There are 2 possible formats: (XX)XXXX-XXXX (XX)XXXXX-XXXX Is there any way to mask it accepting both cases? EDIT: I tried: $("#phone").mask("(99) 9999-9999");…
JHispa
  • 323
  • 1
  • 4
  • 6
28
votes
2 answers

How to mask credit card numbers in log files with Log4J?

Our web app needs to be made PCI compliant, i.e. it must not store any credit card numbers. The app is a frontend to a mainframe system which handles the CC numbers internally and - as we have just found out - occasionally still spits out a full CC…
Péter Török
  • 114,404
  • 31
  • 268
  • 329
25
votes
6 answers

How to Apply Mask to Image in OpenCV?

I want to apply a binary mask to a color image. Please provide a basic code example with proper explanation of how the code works. Also, is there some option to apply a mask permanently so all functions operate only within the mask?
fdh
  • 5,256
  • 13
  • 58
  • 101
24
votes
2 answers

Mask a 3d array with a 2d mask in numpy

I have a 3-dimensional array that I want to mask using a 2-dimensional array that has the same dimensions as the two rightmost of the 3-dimensional array. Is there a way to do this without writing the following loop? import numpy as np nx = 2 nt =…
Chiel
  • 6,006
  • 2
  • 32
  • 57
23
votes
5 answers

Is there way to match IP with IP+CIDR straight from SELECT query?

Something like SELECT COUNT(*) AS c FROM BANS WHERE typeid=6 AND (SELECT ipaddr,cidr FROM BANS) MATCH AGAINST 'this_ip'; So you don't first fetch all records from DB and then match them one-by one. If c > 0 then were matched. BANS table: id int…
raspi
  • 5,962
  • 3
  • 34
  • 51
23
votes
6 answers

Masked Input Using EditText Widget in Android

Is there a way I can specify an input mask to the EditText control in Android? I want be able to specify something like ### - ## - #### for a Social Security Number. This will cause any invalid input to be rejected automatically (example, I type…
Buzzy
  • 3,618
  • 4
  • 30
  • 41
23
votes
2 answers

Numpy inverse mask

I want to inverse the true/false value in my numpy masked array. So in the example below i don't want to mask out the second value in the data array, I want to mask out the first and third value. Below is just an example. My masked array is created…
ustroetz
  • 5,802
  • 16
  • 47
  • 74
22
votes
7 answers

Remove literals from input mask after form submit?

this question has already been asked but the solutions where not clear. Im using Josh Bush's MaskedInput plugin for jQuery What im trying to achieve is: E.g: a phone input with the mask $("#txtPhone").mask("(99)9999-9999"); EQUALS:…
Wednesday Man
  • 359
  • 2
  • 3
  • 12
22
votes
4 answers

CABasicAnimation - transform scale keep in center

Trying to animatie an ellipse masked on a UIView to be scale transformed remaining in the center position. I have found CALayer - CABasicAnimation not scaling around center/anchorPoint, and followed by adding a bounds property to the maskLayer…
Leon Storey
  • 3,274
  • 2
  • 25
  • 40
19
votes
2 answers

OpenGL - mask with multiple textures

I have implemented masking in OpenGL according to the following concept: The mask is composed of black and white colors. A foreground texture should only be visible in the white parts of the mask. A background texture should only be visible in the…
red
  • 833
  • 1
  • 7
  • 13
19
votes
1 answer

How to implement highlighting on UIImage like UIButton does when tapped?

I need to replicate the effect that the UIButton does on an image when tapped, the highlighting. See: The original PNG is a square with alpha background. When I set it as UIButton's image it automatically apply an effect on the non-alpha pixels of…
Felipe Cypriano
  • 2,727
  • 22
  • 32