Module: PSD::Layer::Exporting

Included in:
PSD::Layer
Defined in:
lib/psd/layer/exporting.rb

Instance Method Summary collapse

Instance Method Details

#export(outfile) ⇒ Object

Export the layer to file. May or may not work.


5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/psd/layer/exporting.rb', line 5

def export(outfile)
  export_position_and_channels(outfile)

  @blend_mode.write(outfile)
  @file.seek(@blend_mode.num_bytes, IO::SEEK_CUR)

  export_mask_data(outfile)
  export_blending_ranges(outfile)
  export_legacy_layer_name(outfile)
  export_extra_data(outfile)

  outfile.write @file.read(end_of_section - @file.tell)
end

#write_vector_mask(outfile) ⇒ Object


19
20
21
22
23
24
25
# File 'lib/psd/layer/exporting.rb', line 19

def write_vector_mask(outfile)
  outfile.write @file.read(8)
  # outfile.write_int 3
  # outfile.write_int @vector_tag

  @path_components.each{ |pc| pc.write(outfile); @file.seek(26, IO::SEEK_CUR) }
end