Class: Pageflow::LinkmapPage::ColorMapFile
Constant Summary
collapse
- SOURCE_FILE_OPTIONS =
Prevent anti aliasing. Otherwise, when processing color map images, borders between areas are blurred.
'-filter point'.freeze
- PALETTE_PATH =
Pageflow::LinkmapPage::Engine.root
.join('lib', 'pageflow', 'linkmap_page', 'images', 'palette.png').freeze
- CONVERT_OPTIONS =
[
'-quality 70',
'-interlace Plane',
'-dither None',
'-colors 64',
"-remap #{PALETTE_PATH}",
].join(' ').freeze
GeneratedImageFile::GEOMETRY
Instance Method Summary
collapse
#failed?, #prerequisite_files, #publish!, #ready?, #retry!, #retryable?
Instance Method Details
#bounding_box_for_color(color) ⇒ Object
79
80
81
|
# File 'app/models/pageflow/linkmap_page/color_map_file.rb', line 79
def bounding_box_for_color(color)
attachment_colors[color]
end
|
#height ⇒ Object
63
64
65
|
# File 'app/models/pageflow/linkmap_page/color_map_file.rb', line 63
def height
attachment_height
end
|
#present_colors ⇒ Object
75
76
77
|
# File 'app/models/pageflow/linkmap_page/color_map_file.rb', line 75
def present_colors
attachment_colors ? attachment_colors.keys : []
end
|
#processed_attachment ⇒ Object
71
72
73
|
# File 'app/models/pageflow/linkmap_page/color_map_file.rb', line 71
def processed_attachment
attachment.styles[:remapped]
end
|
#sprite_url ⇒ Object
55
56
57
|
# File 'app/models/pageflow/linkmap_page/color_map_file.rb', line 55
def sprite_url
attachment.url(:sprite)
end
|
#url ⇒ Object
67
68
69
|
# File 'app/models/pageflow/linkmap_page/color_map_file.rb', line 67
def url
attachment.url(:remapped)
end
|
#width ⇒ Object
59
60
61
|
# File 'app/models/pageflow/linkmap_page/color_map_file.rb', line 59
def width
attachment_width
end
|