Class: PSD::Exposure

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

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

#exposureObject (readonly)

Returns the value of attribute exposure


9
10
11
# File 'lib/psd/layer/info/exposure.rb', line 9

def exposure
  @exposure
end

#gammaObject (readonly)

Returns the value of attribute gamma


9
10
11
# File 'lib/psd/layer/info/exposure.rb', line 9

def gamma
  @gamma
end

#offsetObject (readonly)

Returns the value of attribute offset


9
10
11
# File 'lib/psd/layer/info/exposure.rb', line 9

def offset
  @offset
end

Class Method Details

.should_parse?(key) ⇒ Boolean

Returns:

  • (Boolean)

5
6
7
# File 'lib/psd/layer/info/exposure.rb', line 5

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

Instance Method Details

#parseObject


11
12
13
14
15
16
17
18
# File 'lib/psd/layer/info/exposure.rb', line 11

def parse
  @file.seek 2, IO::SEEK_CUR

  # Why this shit is big endian is beyond me. Thanks Adobe.
  @exposure = @file.read(4).unpack('g')[0]
  @offset = @file.read(4).unpack('g')[0]
  @gamma = @file.read(4).unpack('g')[0]
end