673f99
Update svg_convertPngToSyslinux.sh.
@@ -1,54 +1,48 @@
|
|
1
1
|
|
2
2
|
#
|
3
|
-
#
|
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
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
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
|
-
#
|
13
|
-
# `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'
|
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
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
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
|
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
|
117
|
-
#
|
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
|
-
|
145
|
+
${RENDER_BACKEND}_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLORS"
|
151
146
|
|
152
147
|
# Create HEX palette using GPL palette.
|
153
|
-
|
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
|