Method: PSD::SelectiveColor#parse

Defined in:
lib/psd/layer/info/selective_color.rb

#parseObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/psd/layer/info/selective_color.rb', line 12

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

  @correction_mode = @file.read_short == 0 ? :relative : :absolute
  @cyan_correction = []
  @magenta_correction = []
  @yellow_correction = []
  @black_correction = []

  10.times do |i|
    # First record is all 0 and is ignored by Photoshop
    @file.seek(8, IO::SEEK_CUR) and next if i == 0

    @cyan_correction    << @file.read_short
    @magenta_correction << @file.read_short
    @yellow_correction  << @file.read_short
    @black_correction   << @file.read_short
  end
end