Module: PSD::Node::BuildPreview
Instance Method Summary
collapse
#mask_to_png, #save_as_png, #to_png_with_mask
Instance Method Details
#build_png(png = nil) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/psd/nodes/build_preview.rb', line 12
def build_png(png=nil)
png ||= create_canvas
children.reverse.each do |c|
next unless c.visible?
if c.group?
if c.blending_mode == 'passthru'
c.build_png(png)
else
compose! c, png, c.build_png, 0, 0
end
else
compose! c, png, c.image.to_png_with_mask, c.left.to_i, c.top.to_i
end
end
png
end
|
#orig_to_png ⇒ Object
6
|
# File 'lib/psd/nodes/build_preview.rb', line 6
alias :orig_to_png :to_png
|
#to_png ⇒ Object
7
8
9
10
|
# File 'lib/psd/nodes/build_preview.rb', line 7
def to_png
return build_png if group?
layer.image.to_png
end
|