Class: PSD::Mask
- Inherits:
-
BinData::Record
- Object
- BinData::Record
- PSD::Mask
- Defined in:
- lib/psd/mask.rb
Overview
Represents the mask for a single layer
Instance Method Summary collapse
- #disabled ⇒ Object
-
#has_data? ⇒ Boolean
Is there a mask defined?.
-
#height ⇒ Object
Height of the mask.
- #invert ⇒ Object
- #relative ⇒ Object
-
#width ⇒ Object
Width of the mask.
Instance Method Details
#disabled ⇒ Object
37 38 39 |
# File 'lib/psd/mask.rb', line 37 def disabled (flags & (0x01 << 1)) > 0 end |
#has_data? ⇒ Boolean
Is there a mask defined?
19 20 21 |
# File 'lib/psd/mask.rb', line 19 def has_data? mask_size > 0 end |
#height ⇒ Object
Height of the mask
29 30 31 |
# File 'lib/psd/mask.rb', line 29 def height bottom - top end |
#invert ⇒ Object
41 42 43 |
# File 'lib/psd/mask.rb', line 41 def invert (flags & (0x01 << 2)) > 0 end |
#relative ⇒ Object
33 34 35 |
# File 'lib/psd/mask.rb', line 33 def relative flags & 0x01 end |
#width ⇒ Object
Width of the mask
24 25 26 |
# File 'lib/psd/mask.rb', line 24 def width right - left end |