commit consoleet-utils for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package consoleet-utils for openSUSE:Factory checked in at 2024-10-01 17:20:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/consoleet-utils (Old) and /work/SRC/openSUSE:Factory/.consoleet-utils.new.29891 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "consoleet-utils" Tue Oct 1 17:20:10 2024 rev:8 rq:1204924 version:1.7 Changes: -------- --- /work/SRC/openSUSE:Factory/consoleet-utils/consoleet-utils.changes 2024-06-28 15:49:45.931953897 +0200 +++ /work/SRC/openSUSE:Factory/.consoleet-utils.new.29891/consoleet-utils.changes 2024-10-01 17:20:36.771728133 +0200 @@ -1,0 +2,6 @@ +Tue Oct 1 12:17:12 UTC 2024 - Jan Engelhardt <jengelh@inai.de> + +- Update to release 1.7 + * palcomp: add "blend", "loadreg", "savereg" commands + +------------------------------------------------------------------- Old: ---- consoleet-utils-1.6.tar.asc consoleet-utils-1.6.tar.zst New: ---- _scmsync.obsinfo build.specials.obscpio consoleet-utils-1.7.tar.asc consoleet-utils-1.7.tar.zst ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ consoleet-utils.spec ++++++ --- /var/tmp/diff_new_pack.jdcmeY/_old 2024-10-01 17:20:38.391795680 +0200 +++ /var/tmp/diff_new_pack.jdcmeY/_new 2024-10-01 17:20:38.407796347 +0200 @@ -17,7 +17,7 @@ Name: consoleet-utils -Version: 1.6 +Version: 1.7 Release: 0 Summary: Utilities for manipulating terminal fonts and colors License: GPL-3.0-or-later AND MIT ++++++ _scmsync.obsinfo ++++++ mtime: 1727785045 commit: 01df7ac6ffb87e7a47f7bd04b0a5342fe93dcb98c6b3282e3e9262d02378f99c url: https://src.opensuse.org/jengelh/consoleet-utils revision: master ++++++ consoleet-utils-1.6.tar.zst -> consoleet-utils-1.7.tar.zst ++++++ ++++ 1977 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/consoleet-utils-1.6/build-aux/missing new/consoleet-utils-1.7/build-aux/missing --- old/consoleet-utils-1.6/build-aux/missing 2023-07-24 01:11:29.756691078 +0200 +++ new/consoleet-utils-1.7/build-aux/missing 2024-10-01 14:09:13.753081442 +0200 @@ -1,9 +1,11 @@ #! /bin/sh -# Common wrapper for a few potentially missing GNU programs. +# Common wrapper for a few potentially missing GNU and other programs. -scriptversion=2018-03-07.03; # UTC +scriptversion=2024-06-07.14; # UTC -# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells + +# Copyright (C) 1996-2024 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -54,18 +56,20 @@ -v, --version output version information and exit Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man +aclocal autoconf autogen autoheader autom4te automake autoreconf +bison flex help2man lex makeinfo perl yacc Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. -Send bug reports to <bug-automake@gnu.org>." +Report bugs to <bug-automake@gnu.org>. +GNU Automake home page: <https://www.gnu.org/software/automake/>. +General help using GNU software: <https://www.gnu.org/gethelp/>." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" + echo "missing (GNU Automake) $scriptversion" exit $? ;; @@ -108,7 +112,7 @@ program_details () { case $1 in - aclocal|automake) + aclocal|automake|autoreconf) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" @@ -123,6 +127,9 @@ echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; + *) + : + ;; esac } @@ -137,48 +144,55 @@ printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + autoheader_deps="'acconfig.h'" + automake_deps="'Makefile.am'" + aclocal_deps="'acinclude.m4'" case $normalized_program in + aclocal*) + echo "You should only need it if you modified $aclocal_deps or" + echo "$configure_deps." + ;; autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' + echo "You should only need it if you modified $configure_deps." + ;; + autogen*) + echo "You should only need it if you modified a '.def' or '.tpl' file." + echo "You may want to install the GNU AutoGen package:" + echo "<$gnu_software_URL/autogen/>" ;; autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" + echo "You should only need it if you modified $autoheader_deps or" echo "$configure_deps." - program_details 'autoheader' ;; automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" + echo "You should only need it if you modified $automake_deps or" echo "$configure_deps." - program_details 'aclocal' ;; - autom4te*) + autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' + ;; + autoreconf*) + echo "You should only need it if you modified $aclocal_deps or" + echo "$automake_deps or $autoheader_deps or $automake_deps or" + echo "$configure_deps." ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." @@ -189,6 +203,12 @@ echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; + perl*) + echo "You should only need it to run GNU Autoconf, GNU Automake, " + echo " assorted other tools, or if you modified a Perl source file." + echo "You may want to install the Perl 5 language interpreter:" + echo "<$perl_URL>" + ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" @@ -197,6 +217,7 @@ echo "case some other package contains this missing '$1' program." ;; esac + program_details "$normalized_program" } give_advice "$1" | sed -e '1s/^/WARNING: /' \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/consoleet-utils-1.6/configure.ac new/consoleet-utils-1.7/configure.ac --- old/consoleet-utils-1.6/configure.ac 2024-06-27 19:25:20.612257587 +0200 +++ new/consoleet-utils-1.7/configure.ac 2024-10-01 14:07:20.546947092 +0200 @@ -1,4 +1,4 @@ -AC_INIT([consoleet-utils], [1.6]) +AC_INIT([consoleet-utils], [1.7]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AC_PROG_INSTALL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/consoleet-utils-1.6/doc/changelog.rst new/consoleet-utils-1.7/doc/changelog.rst --- old/consoleet-utils-1.6/doc/changelog.rst 2024-06-27 19:24:06.922473042 +0200 +++ new/consoleet-utils-1.7/doc/changelog.rst 2024-10-01 14:08:18.376674672 +0200 @@ -1,3 +1,8 @@ +1.7 (2024-10-01) +================ + +* palcomp: add "blend", "loadreg", "savereg" commands + 1.6 (2024-06-27) ================ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/consoleet-utils-1.6/doc/palcomp.1 new/consoleet-utils-1.7/doc/palcomp.1 --- old/consoleet-utils-1.6/doc/palcomp.1 2024-06-01 17:33:57.509822843 +0200 +++ new/consoleet-utils-1.7/doc/palcomp.1 2024-06-29 14:47:20.191700838 +0200 @@ -11,11 +11,18 @@ have when using the VGA color palette. For this reason, a mainstay of this program is to operate using a colorspace with perceptual uniformity, i.e. CIELAB/LCh. +.PP +Most commands operate on a single palette, but it is possible to store multiple +palettes in memory. The current working palette is called "0" (cf. +loadreg/savereg). .SH Commands .SS b0 Set color 0 to actual black. .SS bg Emit a \-bg parameter upon xterm, and use color 0. +.SS blend=pct,name +RGB-blend the current palette with another; performs `output := +curpal*(100-pct) + secondpal*pct`. pct should be in the range 0..100. .SS ct Print the 16-color table. .SS ct256 @@ -59,6 +66,8 @@ .SS loadpal= Load RGB palette from a file. xfce4-terminal *.theme files and termux *.properties files are understood. +.SS loadreg=name +Set the working palette ("0") to the contents of the named palette. .SS satadd=r Change colors' saturation using LCh space. .SS satmul=r @@ -66,6 +75,8 @@ desaturation of colors; r=0 leads to gray. .SS satset=r Set colors' saturation using LCh space. +.SS savereg=name +Save the current working palette ("0") to a new name. .SS hsltint=h,s,l Map the (LCh) brightnesses onto a color line through the HSL cylinder that goes from black to the chosen color. Parameter ranges are (0 <= h < 360; 0 <= s < 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/consoleet-utils-1.6/src/palcomp.cpp new/consoleet-utils-1.7/src/palcomp.cpp --- old/consoleet-utils-1.6/src/palcomp.cpp 2024-05-19 15:08:53.658556377 +0200 +++ new/consoleet-utils-1.7/src/palcomp.cpp 2024-06-29 14:31:59.065310909 +0200 @@ -28,6 +28,17 @@ struct lch { double l = 0, c = 0, h = 0; }; struct hsl { double h = 0, s = 0, l = 0; }; +/*** + * Keep multiple numeric representations of the palette, to reduce accumulation + * of conversion errors. + */ +struct mpalette { + std::vector<srgb888> ra; + std::vector<lch> la; + void mod_la(); + void mod_ra(); +}; + /** * Statistics for one grid view (e.g. 8x8 / 16x8 / ...). * @@ -236,6 +247,9 @@ printf("\n"); } +void mpalette::mod_la() { ra = to_srgb888(la); } +void mpalette::mod_ra() { la = to_lch(ra); } + static void emit_xterm(const std::vector<srgb888> &pal) { for (unsigned int idx = 0; idx < 16; ++idx) @@ -605,10 +619,23 @@ return EXIT_SUCCESS; } +template<typename T> T do_blend(const T &a, double amult, const T &b, double bmult) +{ + auto max = std::max(a.size(), b.size()); + T out(max); + for (size_t x = 0; x < max; ++x) { + out[x].r = a[x].r * amult + b[x].r * bmult; + out[x].g = a[x].g * amult + b[x].g * bmult; + out[x].b = a[x].b * amult + b[x].b * bmult; + } + return out; +} + int main(int argc, const char **argv) { - std::vector<srgb888> ra; - std::vector<lch> la; + std::unordered_map<std::string, mpalette> allpal; + auto xter = allpal.emplace("0", mpalette{}); + mpalette &mpal = xter.first->second; struct bb_guard { bb_guard() { ::babl_init(); } ~bb_guard() { ::babl_exit(); } @@ -638,18 +665,35 @@ bool mod_ra = false, mod_la = false; if (strcmp(*argv, "vga") == 0) { - ra = {std::begin(vga_palette), std::end(vga_palette)}; + mpal.ra = {std::begin(vga_palette), std::end(vga_palette)}; mod_ra = true; } else if (strcmp(*argv, "vgs") == 0) { - ra = {std::begin(vgasat_palette), std::end(vgasat_palette)}; + mpal.ra = {std::begin(vgasat_palette), std::end(vgasat_palette)}; mod_ra = true; } else if (strcmp(*argv, "win") == 0) { - ra = {std::begin(win_palette), std::end(win_palette)}; + mpal.ra = {std::begin(win_palette), std::end(win_palette)}; mod_ra = true; } else if (strncmp(*argv, "loadpal=", 8) == 0) { - if (loadpal(&argv[0][8], ra) != 0) + if (loadpal(&argv[0][8], mpal.ra) != 0) return EXIT_FAILURE; mod_ra = true; + } else if (strncmp(*argv, "loadreg=", 8) == 0) { + mpal = allpal[&argv[0][8]]; + } else if (strncmp(*argv, "savereg=", 8) == 0) { + allpal[&argv[0][8]] = mpal; + } else if (strncmp(*argv, "blend=", 6) == 0) { + char *end = nullptr; + auto pct = strtod(&argv[0][6], &end); + if (*end == ',') { + ++end; + auto bi = allpal.find(end); + if (bi == allpal.cend()) { + fprintf(stderr, "Register \"%s\" not defined yet\n", end); + } else { + mpal.ra = do_blend(mpal.ra, 1-pct/100, allpal[end].ra, pct/100); + mod_ra = true; + } + } } else if (strncmp(*argv, "ild=", 4) == 0) { fprintf(stderr, "New white_point D_%.2f:\n", arg1 / 100); auto a = illuminant_d(arg1); @@ -663,68 +707,68 @@ } else if (strcmp(*argv, "lch") == 0) { printf("#L,c,h\n"); unsigned int cnt = 0; - for (auto &e : la) { + for (auto &e : mpal.la) { printf("\e[%u;3%um%x\e[0m: {%10.6f, %10.6f, %10.6f}\n", !!(cnt & 0x8), cnt & 0x7, cnt, e.l, e.c, e.h); ++cnt; } } else if (strncmp(*argv, "litadd=", 7) == 0) { - for (auto &e : la) + for (auto &e : mpal.la) e.l += arg1; mod_la = true; } else if (strncmp(*argv, "litmul=", 7) == 0) { - for (auto &e : la) + for (auto &e : mpal.la) e.l *= arg1; mod_la = true; } else if (strncmp(*argv, "litset=", 7) == 0) { - for (auto &e : la) + for (auto &e : mpal.la) e.l = arg1; mod_la = true; } else if (strncmp(*argv, "satadd=", 7) == 0) { - for (auto &e : la) + for (auto &e : mpal.la) e.c += arg1; mod_la = true; } else if (strncmp(*argv, "satmul=", 7) == 0) { - for (auto &e : la) + for (auto &e : mpal.la) e.c *= arg1; mod_la = true; } else if (strncmp(*argv, "satset=", 7) == 0) { - for (auto &e : la) + for (auto &e : mpal.la) e.c = arg1; mod_la = true; } else if (strncmp(*argv, "hueadd=", 7) == 0) { - for (auto &e : la) + for (auto &e : mpal.la) e.h = HX_flpr(e.h + arg1, 360); mod_la = true; } else if (strncmp(*argv, "hueset=", 7) == 0) { arg1 = fmod(arg1, 360); - for (auto &e : la) + for (auto &e : mpal.la) e.h = arg1; mod_la = true; } else if (strncmp(*argv, "hsltint=", 8) == 0) { - ra = hsltint(parse_hsl(&argv[0][8]), la); + mpal.ra = hsltint(parse_hsl(&argv[0][8]), mpal.la); mod_ra = true; } else if (strncmp(*argv, "lchtint=", 8) == 0) { auto base = parse_hsl(&argv[0][8]); - la = lchtint(to_lch(to_srgb(base)), la); + mpal.la = lchtint(to_lch(to_srgb(base)), mpal.la); mod_la = true; } else if (strcmp(*argv, "emit") == 0 || strcmp(*argv, "xfce") == 0) { - emit_xfce(ra); + emit_xfce(mpal.ra); } else if (strcmp(*argv, "xterm") == 0) { - emit_xterm(ra); + emit_xterm(mpal.ra); } else if (strcmp(*argv, "fg") == 0) { xterm_fg = 1; } else if (strcmp(*argv, "bg") == 0) { xterm_bg = 1; } else if (strcmp(*argv, "b0") == 0) { - la[0] = {0,0,0}; - ra[0] = {0,0,0}; + mpal.la[0] = {0,0,0}; + mpal.ra[0] = {0,0,0}; } else if (strcmp(*argv, "inv16") == 0) { - decltype(ra) new_ra(ra.size()); - for (size_t i = 0; i < ra.size(); ++i) - new_ra[i] = std::move(ra[~i % ra.size()]); - ra = std::move(new_ra); + decltype(mpal.ra) new_ra(mpal.ra.size()); + for (size_t i = 0; i < mpal.ra.size(); ++i) + new_ra[i] = std::move(mpal.ra[~i % mpal.ra.size()]); + mpal.ra = std::move(new_ra); mod_ra = true; /* * A computational method (only produces exact results @@ -741,33 +785,33 @@ } else if (strcmp(*argv, "ct") == 0) { colortable_16(); } else if (strcmp(*argv, "cxl") == 0) { - cxl_command(la); + cxl_command(mpal.la); } else if (strcmp(*argv, "cxa") == 0) { - cxa_command(ra); + cxa_command(mpal.ra); } else if (strncmp(*argv, "cfgamma=", 8) == 0) { g_continuous_gamma = arg1; } else if (strcmp(*argv, "loeq") == 0) { - la = equalize(la, 9, 100 / 9.0, 100 * 8 / 9.0); + mpal.la = equalize(mpal.la, 9, 100 / 9.0, 100 * 8 / 9.0); mod_la = true; } else if (strncmp(*argv, "loeq=", 5) == 0) { char *end = nullptr; arg1 = strtod(&argv[0][5], &end); double arg2 = *end == ',' ? strtod(end + 1, &end) : 100 / 9.0 * 8; - la = equalize(la, 9, arg1, arg2); + mpal.la = equalize(mpal.la, 9, arg1, arg2); mod_la = true; } else if (strcmp(*argv, "eq") == 0) { - la = equalize(la, 16, 100 / 16.0, 100); + mpal.la = equalize(mpal.la, 16, 100 / 16.0, 100); mod_la = true; } else if (strncmp(*argv, "eq=", 3) == 0) { - la = equalize(la, 16, arg1, 100); + mpal.la = equalize(mpal.la, 16, arg1, 100); mod_la = true; } else { fprintf(stderr, "Unrecognized command: \"%s\"\n", *argv); } if (mod_ra) - la = to_lch(ra); + mpal.mod_ra(); else if (mod_la) - ra = to_srgb888(la); + mpal.mod_la(); } return EXIT_SUCCESS; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/consoleet-utils-1.6/src/vfalib.cpp new/consoleet-utils-1.7/src/vfalib.cpp --- old/consoleet-utils-1.6/src/vfalib.cpp 2023-09-03 00:09:39.244161576 +0200 +++ new/consoleet-utils-1.7/src/vfalib.cpp 2024-09-10 16:36:34.537471123 +0200 @@ -1158,8 +1158,10 @@ auto z = c.empty() || c == "vfontas output"; if (x && y && z) { fprintf(stderr, "Hint: Consider -setname <name>, " - "or the detailed version, " - "-setprop {FontName|FamilyName|FullName}.\n"); + "or the detailed version, e.g.\n" + "\t-setprop FontName aerial_20 # PostScript name\n" + "\t-setprop FamilyName \"Aerial 2.0\"\n" + "\t-setprop FullName \"Aerial 2.0 Bold\"\n"); return; } if (x)
participants (1)
-
Source-Sync