Class: PSD::Mask

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/psd/mask.rb

Overview

Represents the mask for a single layer

Instance Method Summary collapse

Instance Method Details

#disabledObject



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?

Returns:

  • (Boolean)


19
20
21
# File 'lib/psd/mask.rb', line 19

def has_data?
  mask_size > 0
end

#heightObject

Height of the mask



29
30
31
# File 'lib/psd/mask.rb', line 29

def height
  bottom - top
end

#invertObject



41
42
43
# File 'lib/psd/mask.rb', line 41

def invert
  (flags & (0x01 << 2)) > 0
end

#relativeObject



33
34
35
# File 'lib/psd/mask.rb', line 33

def relative
  flags & 0x01
end

#widthObject

Width of the mask



24
25
26
# File 'lib/psd/mask.rb', line 24

def width
  right - left
end