| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function render_doGrub { |
| |
| |
| local COLOR_NUMBER='14' |
| |
| |
| |
| |
| |
| local OPTIONS=$(render_getConfigOption "$ACTION" '2-') |
| |
| |
| |
| |
| for OPTION in $OPTIONS;do |
| |
| OPTION=$(echo -n $OPTION | cut -d'=' -f1) |
| if [[ "$OPTION" =~ "-(mapfile|verbose)" ]];then |
| cli_printMessage "`eval_gettext "The \\\$OPTION option is already used."`" |
| cli_printMessage "${FUNCDIRNAM}" "AsToKnowMoreLine" |
| fi |
| done |
| |
| |
| local PREFIX="-${COLOR_NUMBER}c" |
| |
| |
| |
| |
| if [[ "$OPTIONS" =~ '-floyd' ]];then |
| PREFIX="${PREFIX}-floyd" |
| fi |
| |
| |
| local PALETTES=$(cli_getRepoTLDir)/Identity/Themes/Motifs/$(cli_getPathComponent '--theme')/Palettes |
| |
| |
| |
| |
| local PALETTE_GPL=${PALETTES}/grub.gpl |
| |
| |
| cli_checkFiles $PALETTE_GPL 'f' |
| |
| |
| |
| |
| |
| local PALETTE_PPM=$(cli_getTemporalFile "grub.ppm") |
| |
| |
| |
| |
| |
| cli_printMessage "${FILE}.pnm" "AsSavedAsLine" |
| pngtopnm -verbose \ |
| < ${FILE}.png 2>${FILE}.log > ${FILE}.pnm |
| |
| |
| cli_printMessage "$PALETTE_GPL" 'AsPaletteLine' |
| |
| |
| render_convertGplToPpm "$PALETTE_GPL" "$PALETTE_PPM" "$COLOR_NUMBER" |
| |
| |
| |
| |
| cli_printMessage "${FILE}${PREFIX}.ppm" "AsSavedAsLine" |
| pnmremap -verbose -mapfile=$PALETTE_PPM $OPTIONS \ |
| < ${FILE}.pnm 2>>${FILE}.log > ${FILE}${PREFIX}.ppm |
| |
| |
| if [[ -f ${PALETTE_PPM} ]];then |
| rm $PALETTE_PPM |
| fi |
| |
| |
| cli_printMessage "${FILE}${PREFIX}.xpm.gz" "AsSavedAsLine" |
| ppmtoxpm \ |
| < ${FILE}${PREFIX}.ppm 2>>${FILE}.log > ${FILE}.xpm \ |
| && gzip --force ${FILE}.xpm \ |
| && mv ${FILE}.xpm.gz ${FILE}${PREFIX}.xpm.gz |
| |
| } |