673f99 Update svg_convertPngToSyslinux.sh.

Authored and Committed by areguera 13 years ago
Scripts/Functions/Render/Backends/Svg/svg_convertPngToSyslinux.sh CHANGED
@@ -1,54 +1,48 @@
1
1
#!/bin/bash
2
2
#
3
- # render_svg_convertPngToSyslinux.sh -- This function provides post-rendition
3
+ # svg_convertPngToSyslinux.sh -- This function provides post-rendition
4
4
# action used to produce LSS16 images, the images used by isolinux.
5
5
#
6
- # This function uses three different formats to handle the same color
7
- # information. Initially, the color information is defined with GIMP
8
- # (The GNU Image Manipulation Program) as a palette of color. This
9
- # palette of colors contains 16 colors only and is saved in a file
10
- # named `syslinux.gpl.
6
+ # Initially, the color information is defined with GIMP (The GNU Image
7
+ # Manipulation Program) as a `.gpl' palette of color. This palette of
8
+ # colors contains 16 colors only and is saved in a file named
9
+ # `syslinux.gpl. The `syslinux.gpl' file is used to build two other
10
+ # files: the `syslinux.ppm' file and the `syslinux.hex' file. The
11
+ # `syslinux.ppm' provides the color information needed to reduce the
12
+ # full color PNG image, produced as result of SVG base-rendition, to
13
+ # the amount of colors specified (i.e., 16 colors). Later, with the 16
14
+ # color PNG image already created, the `syslinux.hex' file is used to
15
+ # build the LSS16 image.
11
16
#
12
- # The `syslinux.gpl' file is used to build two other files: the
13
- # `syslinux.ppm' file and the `syslinux.hex' file. The `syslinux.ppm'
17
+ # In order to produce images in LSS16 format correctly, it is required
18
+ # that both the `syslinux.ppm' and `syslinux.hex' files do contain the
14
- # file is used to reduce a full color PNG image to the amount of
15
- # colors it specifies (i.e., 16 colors). Later, with the 16 color
16
- # image already created, the `syslinux.hex' file is used to build the
17
- # LSS16 image.
18
- #
19
- # In order to produce images in LSS16 format correctly, it is needed
20
- # that both the `syslinux.ppm' and `syslinux.hex' files contain the
21
19
# same color information. This is, both `syslinux.ppm' and
22
- # `syslinux.hex' shoud represent the same color values and the same
20
+ # `syslinux.hex' must represent the same color values and in the same
23
21
# color index.
24
22
#
25
- # This function save you the work of preparing both `syslinux.ppm' and
26
- # `syslinux.hex'. Instead, you only need to prepare the `syslinux.gpl'
27
- # file with the color information you want to produce images.
28
- #
29
23
# In order for this function to work, the `syslinux.gpl' file should
30
24
# have a format similar to the following:
31
25
#
32
- # GIMP Palette
33
- # Name: TreeFlower-4-Syslinux
34
- # Columns: 16
35
- # #
36
- # 10 22 40 0a1628
37
- # 9 28 52 091c34
38
- # 16 34 63 10223f
39
- # 20 37 67 142543
40
- # 15 39 74 0f274a
41
- # 12 45 85 0c2d55
42
- # 20 43 78 142b4e
43
- # 255 255 255 ffffff
44
- # 21 51 95 15335f
45
- # 41 52 70 293446
46
- # 32 76 141 204c8d
47
- # 77 90 107 4d5a6b
48
- # 143 154 167 8f9aa7
49
- # 128 179 255 80b3ff
50
- # 194 200 202 c2c8ca
51
- # 231 241 255 e7f1ff
26
+ # GIMP Palette
27
+ # Name: CentOS-TreeFlower-4-Syslinux
28
+ # Columns: 16
29
+ # #
30
+ # 32 76 141 204c8d
31
+ # 37 82 146 255292
32
+ # 52 94 153 345e99
33
+ # 73 110 162 496ea2
34
+ # 91 124 172 5b7cac
35
+ # 108 136 180 6c88b4
36
+ # 120 146 186 7892ba
37
+ # 131 158 193 839ec1
38
+ # 255 255 255 ffffff
39
+ # 146 170 200 92aac8
40
+ # 162 182 209 a2b6d1
41
+ # 183 199 219 b7c7db
42
+ # 204 216 230 ccd8e6
43
+ # 221 229 238 dde5ee
44
+ # 235 241 245 ebf1f5
45
+ # 246 251 254 f6fbfe
52
46
#
53
47
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
54
48
#
@@ -70,7 +64,7 @@
70
64
# $Id$
71
65
# ----------------------------------------------------------------------
72
66
73
- function render_svg_convertPngToSyslinux {
67
+ function svg_convertPngToSyslinux {
74
68
75
69
# Define number of colors the images will be produced on.
76
70
local COLORS='16'
@@ -113,10 +107,11 @@ function render_svg_convertPngToSyslinux {
113
107
local PALETTE_GPL=${MOTIF_DIR}/Palettes/syslinux.gpl
114
108
115
109
# Verify GPL palette existence. If it doesn't exist copy the one
116
- # provided by the design model and expand translation markers in
117
- # it.
110
+ # provided by the design model through subversion (to keep track
111
+ # of the change) and expand translation markers in the copied
112
+ # instance.
118
113
if [[ ! -f $PALETTE_GPL ]];then
119
- cp ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/syslinux.gpl ${PALETTE_GPL}
114
+ svn cp ${MODEL_BASEDIR}/${FLAG_THEME_MODEL}/Palettes/syslinux.gpl ${PALETTE_GPL}
120
115
cli_replaceTMarkers ${PALETTE_GPL}
121
116
fi
122
117
@@ -147,10 +142,10 @@ function render_svg_convertPngToSyslinux {
147
142
cli_printMessage "$PALETTE_GPL" --as-palette-line
148
143
149
144
# Create PPM palette using GPL palette.
150
- render_svg_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS"
145
+ ${RENDER_BACKEND}_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS"
151
146
152
147
# Create HEX palette using GPL palette.
153
- render_svg_convertGplToHex "$PALETTE_GPL" "$PALETTE_HEX" "$COLORS"
148
+ ${RENDER_BACKEND}_convertGplToHex "$PALETTE_GPL" "$PALETTE_HEX" "$COLORS"
154
149
155
150
# Reduce colors as specified in PPM palette. Here we use the PPM
156
151
# palette to enforce the color position in the image index and the