Class: Frameit::MacEditor
- Inherits:
-
Editor
- Object
- Editor
- Frameit::MacEditor
show all
- Defined in:
- frameit/lib/frameit/mac_editor.rb
Overview
Responsible for framing Mac Screenshots
Instance Attribute Summary
Attributes inherited from Editor
#debug_mode, #frame, #frame_path, #image, #screenshot, #space_to_device
Instance Method Summary
collapse
Methods inherited from Editor
#frame!, #initialize, #rotation_for_device_orientation, #should_skip?
Instance Method Details
#generate_background ⇒ Object
31
32
33
|
# File 'frameit/lib/frameit/mac_editor.rb', line 31
def generate_background
MiniMagick::Image.open(fetch_config['background']) end
|
#is_complex_framing_mode? ⇒ Boolean
27
28
29
|
# File 'frameit/lib/frameit/mac_editor.rb', line 27
def is_complex_framing_mode?
true end
|
#load_frame ⇒ Object
23
24
25
|
# File 'frameit/lib/frameit/mac_editor.rb', line 23
def load_frame
nil end
|
#prepare_image ⇒ Object
7
8
9
10
|
# File 'frameit/lib/frameit/mac_editor.rb', line 7
def prepare_image
image = super
image.resize("#{offset['width']}x") if offset['width']
end
|
#put_device_into_background(background) ⇒ Object
12
13
14
15
16
17
18
19
20
21
|
# File 'frameit/lib/frameit/mac_editor.rb', line 12
def put_device_into_background(background)
self.top_space_above_device = offset['titleHeight']
@image = background.composite(image, "png") do |c|
c.compose("Over")
c.geometry(offset['offset'])
end
return image
end
|