[gtk/matthiasc/color-profile-rebased: 20/46] widget-factory: Add tests for loading color profiles




commit aef5f3b837291ab331ef621c32bcae7fe97ef42d
Author: Benjamin Otte <otte redhat com>
Date:   Tue Sep 28 04:06:02 2021 +0200

    widget-factory: Add tests for loading color profiles
    
    I figured out how to generate them, yay:
    
      cmsHPROFILE lcms_profile;
      cmsToneCurve *curve[3];
    
      curve[0] = cmsBuildParametricToneCurve (NULL, 4, (double[5]) { 1.0, 0, 0, 0, 0 });
      curve[1] = cmsBuildParametricToneCurve (NULL, 4, (double[5]) { 2.4, 255.0 / 15 / 1.055, 0.055 / 1.055, 
0, 15./255 });
      curve[2] = cmsBuildGamma (NULL, 2.4);
      lcms_profile = cmsCreateRGBProfile (&(cmsCIExyY) {
                                            0.3127, 0.3290, 1.0
                                          },
                                          &(cmsCIExyYTRIPLE) {
                                            { 0.6400, 0.3300, 1.0 },
                                            { 0.3000, 0.6000, 1.0 },
                                            { 0.1500, 0.0600, 1.0 }
                                          },
                                          curve);
    
      cmsSaveProfileToFile (lcms_profile, "foo.icc");
    
      cmsFreeToneCurveTriple (curve);
      cmsCloseProfile (lcms_profile);

 demos/widget-factory/color-profile-check.jpeg     | Bin 0 -> 3375 bytes
 demos/widget-factory/color-profile-check.png      | Bin 0 -> 1046 bytes
 demos/widget-factory/color-profile-check.tiff     | Bin 0 -> 4996 bytes
 demos/widget-factory/widget-factory.gresource.xml |   3 +
 demos/widget-factory/widget-factory.ui            |  84 +++++++++++++++++++++-
 5 files changed, 84 insertions(+), 3 deletions(-)
---
diff --git a/demos/widget-factory/color-profile-check.jpeg b/demos/widget-factory/color-profile-check.jpeg
new file mode 100644
index 0000000000..88fe4816e5
Binary files /dev/null and b/demos/widget-factory/color-profile-check.jpeg differ
diff --git a/demos/widget-factory/color-profile-check.png b/demos/widget-factory/color-profile-check.png
new file mode 100644
index 0000000000..280e2ef996
Binary files /dev/null and b/demos/widget-factory/color-profile-check.png differ
diff --git a/demos/widget-factory/color-profile-check.tiff b/demos/widget-factory/color-profile-check.tiff
new file mode 100644
index 0000000000..ed18ac6534
Binary files /dev/null and b/demos/widget-factory/color-profile-check.tiff differ
diff --git a/demos/widget-factory/widget-factory.gresource.xml 
b/demos/widget-factory/widget-factory.gresource.xml
index dca1b43e68..0db9306704 100644
--- a/demos/widget-factory/widget-factory.gresource.xml
+++ b/demos/widget-factory/widget-factory.gresource.xml
@@ -122,5 +122,8 @@
     <file>linear-gradient-monochrome.png</file>
     <file>srgb-gradient-color.png</file>
     <file>srgb-gradient-monochrome.png</file>
+    <file>color-profile-check.png</file>
+    <file>color-profile-check.jpeg</file>
+    <file>color-profile-check.tiff</file>
   </gresource>
 </gresources>
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index 157e6f791c..63756441d3 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -1521,13 +1521,91 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
                               <object class="GtkNotebookPage">
                                 <property name="position">1</property>
                                 <property name="child">
-                                  <object class="GtkBox" id="box10">
-                                    <property name="orientation">1</property>
+                                  <object class="GtkGrid">
+                                    <property name="hexpand">0</property>
+                                    <property name="row-spacing">6</property>
+                                    <property name="column-spacing">6</property>
+                                    <property name="margin-start">6</property>
+                                    <property name="margin-end">6</property>
+                                    <property name="margin-top">6</property>
+                                    <property name="margin-bottom">6</property>
+                                    <property name="row-homogeneous">1</property>
+                                    <property name="valign">start</property>
+                                    <child>
+                                      <object class="GtkLabel">
+                                        <property name="label" translatable="yes">image loading</property>
+                                        <style>
+                                          <class name="caption-heading"/>
+                                        </style>
+                                        <layout>
+                                          <property name="column">0</property>
+                                          <property name="row">0</property>
+                                          <property name="column-span">2</property>
+                                        </layout>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkImage">
+                                        <property 
name="paintable">resource:///org/gtk/WidgetFactory4/color-profile-check.png</property>
+                                        <layout>
+                                          <property name="column">0</property>
+                                          <property name="row">1</property>
+                                        </layout>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel">
+                                        <property name="label">PNG</property>
+                                        <property name="hexpand">1</property>
+                                        <layout>
+                                          <property name="column">1</property>
+                                          <property name="row">1</property>
+                                        </layout>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkImage">
+                                        <property 
name="paintable">resource:///org/gtk/WidgetFactory4/color-profile-check.jpeg</property>
+                                        <layout>
+                                          <property name="column">0</property>
+                                          <property name="row">2</property>
+                                        </layout>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel">
+                                        <property name="label">JPEG</property>
+                                        <property name="hexpand">1</property>
+                                        <layout>
+                                          <property name="column">1</property>
+                                          <property name="row">2</property>
+                                        </layout>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkImage">
+                                        <property 
name="paintable">resource:///org/gtk/WidgetFactory4/color-profile-check.tiff</property>
+                                        <layout>
+                                          <property name="column">0</property>
+                                          <property name="row">3</property>
+                                        </layout>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel">
+                                        <property name="label">TIFF</property>
+                                        <property name="hexpand">1</property>
+                                        <layout>
+                                          <property name="column">1</property>
+                                          <property name="row">3</property>
+                                        </layout>
+                                      </object>
+                                    </child>
                                   </object>
                                 </property>
                                 <property name="tab">
                                   <object class="GtkLabel" id="label9">
-                                    <property name="label" translatable="1">page 2</property>
+                                    <property name="label" translatable="1">Images</property>
                                   </object>
                                 </property>
                               </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]