Class: PSD::ContentGenerator

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

Overview

This is the new way that Photoshop stores the brightness/contrast data. If this data is present, DO NOT use the legacy BrightnessContrast info block.

Instance Attribute Summary

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

Class Method Details

.should_parse?(key) ⇒ Boolean

Returns:

  • (Boolean)

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

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

Instance Method Details

#autoObject


38
39
40
# File 'lib/psd/layer/info/content_generator.rb', line 38

def auto
  @data['Auto']
end

#brightnessObject


18
19
20
# File 'lib/psd/layer/info/content_generator.rb', line 18

def brightness
  @data['Brgh']
end

#contrastObject


22
23
24
# File 'lib/psd/layer/info/content_generator.rb', line 22

def contrast
  @data['Cntr']
end

#lab_colorObject


30
31
32
# File 'lib/psd/layer/info/content_generator.rb', line 30

def lab_color
  @data['Lab ']
end

#mean_valueObject


26
27
28
# File 'lib/psd/layer/info/content_generator.rb', line 26

def mean_value
  @data['means']
end

#parseObject


12
13
14
15
16
# File 'lib/psd/layer/info/content_generator.rb', line 12

def parse
  # Version
  @file.seek 4, IO::SEEK_CUR
  @data = Descriptor.new(@file).parse
end

#use_legacyObject


34
35
36
# File 'lib/psd/layer/info/content_generator.rb', line 34

def use_legacy
  @data['useLegacy']
end