[latex3-commits] [git/LaTeX3-latex3-latex3] master: Correct backend logic for CIELAB color (c4503e66d)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Sep 11 11:51:07 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/c4503e66da3f221e1c1cab3ab4c0f45d24064ffa

>---------------------------------------------------------------

commit c4503e66da3f221e1c1cab3ab4c0f45d24064ffa
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Sep 11 10:43:54 2020 +0100

    Correct backend logic for CIELAB color
    
    The wrong check was being made, plus the
    data being sent was confusing and the efficiency
    of checking for an existing whitepoint setup wasn't
    made!


>---------------------------------------------------------------

c4503e66da3f221e1c1cab3ab4c0f45d24064ffa
 l3backend/CHANGELOG.md                  |  1 +
 l3backend/l3backend-color.dtx           | 51 ++++++++++++++-------------------
 l3experimental/l3color/l3color.dtx      |  3 +-
 l3kernel/testfiles/m3expl001.luatex.tlg |  3 +-
 l3kernel/testfiles/m3expl001.ptex.tlg   |  3 +-
 l3kernel/testfiles/m3expl001.tlg        |  3 +-
 l3kernel/testfiles/m3expl001.uptex.tlg  |  3 +-
 l3kernel/testfiles/m3expl001.xetex.tlg  |  3 +-
 l3kernel/testfiles/m3expl003.luatex.tlg |  3 +-
 l3kernel/testfiles/m3expl003.ptex.tlg   |  3 +-
 l3kernel/testfiles/m3expl003.tlg        |  3 +-
 l3kernel/testfiles/m3expl003.uptex.tlg  |  3 +-
 l3kernel/testfiles/m3expl003.xetex.tlg  |  3 +-
 13 files changed, 34 insertions(+), 51 deletions(-)

diff --git a/l3backend/CHANGELOG.md b/l3backend/CHANGELOG.md
index a2d6edc7c..25f142920 100644
--- a/l3backend/CHANGELOG.md
+++ b/l3backend/CHANGELOG.md
@@ -9,6 +9,7 @@ this project uses date-based 'snapshot' version identifiers.
 ### Fixed
 - Some PDF object functions
 - Separation color selection for `dvipdfmx`/XeTeX
+- Logic for some aspects of CIELAB Separation color
 
 ## [2020-09-01]
 
diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index bfe19fa56..ca3a69210 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -327,8 +327,7 @@
 %     \@@_backend_separation_init_/DeviceRGB:nnn
 %   }
 % \begin{macro}{\@@_backend_separation_init_Device:Nn}
-% \begin{macro}{\@@_backend_separation_init_CIELAB:nnnnn}
-% \begin{macro}{\@@_backend_separation_init_CIELAB:n}
+% \begin{macro}{\@@_backend_separation_init_CIELAB:nnn}
 %   Initialising here means creating a small header set up plus massaging
 %   some data. This comes about as we have to deal with PDF-focussed data,
 %   which makes most sense \enquote{higher-up}. The approach is based on
@@ -384,14 +383,12 @@
 %    \end{macrocode}
 %  Currently no CIELAB support.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_separation_init_CIELAB:nnnnn #1#2#3#4#5 { }
-\cs_new_protected:Npn \@@_backend_separation_init_CIELAB:n #1 { }
+\cs_new_protected:Npn \@@_backend_separation_init_CIELAB:nnn #1#2#3 { }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 %    \begin{macrocode}
 %</dvips>
@@ -409,16 +406,13 @@
 % \end{macro}
 %
 % \begin{macro}
-%   {\@@_backend_separation_init:nnnnn, \@@_backend_separation_init_CIELAB:nnnnn}
-% \begin{macro}{\@@_backend_separation_init_CIELAB:n}
+%   {\@@_backend_separation_init:nnnnn, \@@_backend_separation_init_CIELAB:nnn}
 %   No support at present.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_backend_separation_init:nnnnn #1#2#3#4#5 { }
-\cs_new_protected:Npn \@@_backend_separation_init_CIELAB:nnnnn #1#2#3#4#5 { }
-\cs_new_protected:Npn \@@_backend_separation_init_CIELAB:n #1 { }
+\cs_new_protected:Npn \@@_backend_separation_init_CIELAB:nnnnnn #1#2#3 { }
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
 %
 %    \begin{macrocode}
 %</dvisvgm>
@@ -452,8 +446,7 @@
 %
 % \begin{macro}{\@@_backend_separation_init:nnnnn}
 % \begin{macro}{\@@_backend_separation_init:n}
-% \begin{macro}{\@@_backend_separation_init_CIELAB:nnnnn}
-% \begin{macro}{\@@_backend_separation_init_CIELAB:n}
+% \begin{macro}{\@@_backend_separation_init_CIELAB:nnn}
 %   Initialising the PDF structures needs two parts: creating an object
 %   containing the \enquote{real} name of the Separation, then adding a reference
 %   to that to each page. The latter uses the internal name of the \texttt{cs}.
@@ -506,37 +499,37 @@
 %   For CIELAB colors, we need one object per document for the illuminant,
 %   plus initialisation of the color space referencing that object.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_separation_init_CIELAB:nnnnn #1#2#3#4#5
+\cs_new_protected:Npn \@@_backend_separation_init_CIELAB:nnn #1#2#3
   {
+    \pdf_object_if_exist:nF { @@_illuminant_CIELAB_ #1 }
+      {
+        \pdf_object_new:nn { @@_illuminant_CIELAB_ #1 } { array }
+        \pdf_object_write:nx { @@_illuminant_CIELAB_ #1 }
+          {
+            /Lab ~
+            <<
+             /WhitePoint ~
+               [ \tl_use:c { c_@@_model_whitepoint_CIELAB_ #1 _tl } ]
+             /Range ~ [ \c_@@_model_range_CIELAB_tl ]
+            >>
+          }
+      }
     \@@_backend_separation_init:nnnnn
       {#2}
       { \pdf_object_ref:n { @@_illuminant_CIELAB_ #1 } }
       { \c_@@_model_range_CIELAB_tl }
       { 100 ~ 0 ~ 0 }
-      { #3 ~ #4 ~ #5 }
+      {#3}
   }
 \cs_if_exist:NF \pdf_object_now:nn
-  { \cs_gset_protected:Npn \@@_backend_separation_init_CIELAB:nnnnn #1#2#3#4#5 { } }
-\cs_new_protected:Npn \@@_backend_separation_init_CIELAB:n #1
   {
-    \pdf_object_new:nn { @@_illuminant_CIELAB_ #1 } { array }
-    \pdf_object_write:nx { @@_illuminant_CIELAB_ #1 }
-      {
-        /Lab ~
-        <<
-         /WhitePoint ~
-           [ \tl_use:c { c_@@_model_whitepoint_CIELAB_ #1 _tl } ]
-         /Range ~ [ \c_@@_model_range_CIELAB_tl ]
-        >>
-     }
+    \cs_gset_protected:Npn \@@_backend_separation_init_CIELAB:nnn #1#2#3
+      { }
   }
-\cs_if_exist:NF \pdf_object_new:nn
-  { \cs_gset_protected:Npn \@@_backend_separation_init_CIELAB:n #1 { } }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 % \end{macro}
-% \end{macro}
 %
 %    \begin{macrocode}
 %</dvipdfmx|luatex|pdftex|xetex>
diff --git a/l3experimental/l3color/l3color.dtx b/l3experimental/l3color/l3color.dtx
index 40700b7fb..80c17931b 100644
--- a/l3experimental/l3color/l3color.dtx
+++ b/l3experimental/l3color/l3color.dtx
@@ -1774,8 +1774,7 @@
   {
     \tl_if_exist:cTF { c_@@_model_whitepoint_CIELAB_ #1 _tl }
       {
-        \@@_backend_separation_init_CIELAB:n {#1}
-        \@@_backend_separation_init_CIELAB:nnnnn {#2} {#3} {#4} {#5} {#6}
+        \@@_backend_separation_init_CIELAB:nnn {#1} {#3} { #4 ~ #5 ~ #6 }
         \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 ~ ##2 \s_@@_stop
           { 0 ~ 0 ~ 0 ~ 1 }
         \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 ~ ##2 \s_@@_stop
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 26474743b..136d88fad 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -38,8 +38,7 @@ Defining \__color_backend_reset: on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
 Defining \__color_backend_separation_init:n on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 4621b4d56..e4182a138 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -41,8 +41,7 @@ Defining \__color_backend_separation_init_/DeviceCMYK:nnn on line ...
 Defining \__color_backend_separation_init_/DeviceGray:nnn on line ...
 Defining \__color_backend_separation_init_/DeviceRGB:nnn on line ...
 Defining \__color_backend_separation_init_Device:Nn on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index c38526716..c2329c9e8 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -38,8 +38,7 @@ Defining \__color_backend_reset: on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
 Defining \__color_backend_separation_init:n on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 4621b4d56..e4182a138 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -41,8 +41,7 @@ Defining \__color_backend_separation_init_/DeviceCMYK:nnn on line ...
 Defining \__color_backend_separation_init_/DeviceGray:nnn on line ...
 Defining \__color_backend_separation_init_/DeviceRGB:nnn on line ...
 Defining \__color_backend_separation_init_Device:Nn on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index b6b1c7422..72681207d 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -34,8 +34,7 @@ Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_select:n on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
 Defining \__color_backend_separation_init:n on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 26474743b..136d88fad 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -38,8 +38,7 @@ Defining \__color_backend_reset: on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
 Defining \__color_backend_separation_init:n on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 4621b4d56..e4182a138 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -41,8 +41,7 @@ Defining \__color_backend_separation_init_/DeviceCMYK:nnn on line ...
 Defining \__color_backend_separation_init_/DeviceGray:nnn on line ...
 Defining \__color_backend_separation_init_/DeviceRGB:nnn on line ...
 Defining \__color_backend_separation_init_Device:Nn on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index c38526716..c2329c9e8 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -38,8 +38,7 @@ Defining \__color_backend_reset: on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
 Defining \__color_backend_separation_init:n on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 4621b4d56..e4182a138 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -41,8 +41,7 @@ Defining \__color_backend_separation_init_/DeviceCMYK:nnn on line ...
 Defining \__color_backend_separation_init_/DeviceGray:nnn on line ...
 Defining \__color_backend_separation_init_/DeviceRGB:nnn on line ...
 Defining \__color_backend_separation_init_Device:Nn on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index b6b1c7422..72681207d 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -34,8 +34,7 @@ Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_select:n on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
 Defining \__color_backend_separation_init:n on line ...
-Defining \__color_backend_separation_init_CIELAB:nnnnn on line ...
-Defining \__color_backend_separation_init_CIELAB:n on line ...
+Defining \__color_backend_separation_init_CIELAB:nnn on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
 Defining \__color_backend_fill_gray:n on line ...
 Defining \__color_backend_fill_rgb:n on line ...





More information about the latex3-commits mailing list.