Class: PSD::BrightnessContrast

Inherits:
LayerInfo show all
Defined in:
lib/psd/layer/info/brightness_contrast.rb

Overview

NOTE: this only has the correct values when the “Use Legacy” checkbox is checked. If the ‘CgEd’ info key is present, these values will all be 0. Use that info block instead.

Instance Attribute Summary collapse

Attributes inherited from LayerInfo

#data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LayerInfo

#initialize, #skip

Constructor Details

This class inherits a constructor from PSD::LayerInfo

Instance Attribute Details

#brightnessObject (readonly)

Returns the value of attribute brightness.



12
13
14
# File 'lib/psd/layer/info/brightness_contrast.rb', line 12

def brightness
  @brightness
end

#contrastObject (readonly)

Returns the value of attribute contrast.



12
13
14
# File 'lib/psd/layer/info/brightness_contrast.rb', line 12

def contrast
  @contrast
end

#lab_colorObject (readonly)

Returns the value of attribute lab_color.



12
13
14
# File 'lib/psd/layer/info/brightness_contrast.rb', line 12

def lab_color
  @lab_color
end

#mean_valueObject (readonly)

Returns the value of attribute mean_value.



12
13
14
# File 'lib/psd/layer/info/brightness_contrast.rb', line 12

def mean_value
  @mean_value
end

Class Method Details

.should_parse?(key) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/psd/layer/info/brightness_contrast.rb', line 8

def self.should_parse?(key)
  key == 'brit'
end

Instance Method Details

#parseObject



14
15
16
17
18
19
# File 'lib/psd/layer/info/brightness_contrast.rb', line 14

def parse
  @brightness = @file.read_short
  @contrast = @file.read_short
  @mean_value = @file.read_short
  @lab_color = @file.read_boolean
end