Module: PSD::Node::BuildPreview

Included in:
Base
Defined in:
lib/psd/nodes/build_preview.rb

Instance Method Summary collapse

Instance Method Details

#renderer(opts = {}) ⇒ Object



4
5
6
# File 'lib/psd/nodes/build_preview.rb', line 4

def renderer(opts = {})
  PSD::Renderer.new(self, opts)
end

#save_as_png(output) ⇒ Object



12
13
14
# File 'lib/psd/nodes/build_preview.rb', line 12

def save_as_png(output)
  to_png.save(output)
end

#to_pngObject



8
9
10
# File 'lib/psd/nodes/build_preview.rb', line 8

def to_png
  @png ||= renderer(render_hidden: self.layer?).to_png
end