@@ -1440,7 +1440,10 @@ class C_Destination_Options : public C_Destination_Image
1440
1440
1441
1441
double getQuality () const
1442
1442
{
1443
- return m_Quality;
1443
+ if (m_globalSetting_qualityEnabled)
1444
+ return m_globalSetting_quality;
1445
+ else
1446
+ return m_Quality;
1444
1447
}
1445
1448
1446
1449
bool doSwizzle ()
@@ -1493,6 +1496,11 @@ class C_Destination_Options : public C_Destination_Image
1493
1496
// so dont delete its ref using this class. Parent class will clean it up
1494
1497
CMipImages *m_OriginalMipImages;
1495
1498
1499
+
1500
+ // Global Setting overrides
1501
+ bool m_globalSetting_qualityEnabled = false ;
1502
+ float m_globalSetting_quality = 0 .0f ;
1503
+
1496
1504
signals:
1497
1505
1498
1506
void compressionChanged (QVariant &);
@@ -1531,6 +1539,8 @@ class C_Destination_Options : public C_Destination_Image
1531
1539
ds.m_SourceIscompressedFormat = obj.m_SourceIscompressedFormat ;
1532
1540
ds.m_SourceIsFloatFormat = obj.m_SourceIsFloatFormat ;
1533
1541
ds.m_data_has_been_changed = obj.m_data_has_been_changed ;
1542
+ ds.m_globalSetting_qualityEnabled = obj.m_globalSetting_qualityEnabled ;
1543
+ ds.m_globalSetting_quality = obj.m_globalSetting_quality ;
1534
1544
ds.m_SourceImageSize = obj.m_SourceImageSize ;
1535
1545
ds.X_RED = obj.X_RED ;
1536
1546
ds.Y_GREEN = obj.Y_GREEN ;
@@ -1539,6 +1549,7 @@ class C_Destination_Options : public C_Destination_Image
1539
1549
1540
1550
return ds;
1541
1551
}
1552
+
1542
1553
};
1543
1554
1544
1555
// =======================================================
@@ -1617,6 +1628,43 @@ Q_OBJECT
1617
1628
CMipImages *m_MipImages;
1618
1629
};
1619
1630
1631
+ class C_Global_Process_Settings : public QObject
1632
+ {
1633
+ Q_OBJECT
1634
+ Q_PROPERTY (double Set_Quality READ getQuality WRITE setQuality)
1635
+
1636
+ public:
1637
+ C_Global_Process_Settings ()
1638
+ {
1639
+ m_Quality = 0.00 ;
1640
+ }
1641
+
1642
+ double m_Quality;
1643
+ int m_enabled;
1644
+
1645
+ void setQuality (double quality)
1646
+ {
1647
+ m_enabled = 1 ;
1648
+ if (quality > 1.0 ) quality = 1.0 ;
1649
+ else
1650
+ if (quality <= 0 )
1651
+ {
1652
+ quality = 0.0 ;
1653
+ m_enabled = 0 ;
1654
+ }
1655
+ m_Quality = quality;
1656
+ emit globalPropertyChanged (m_enabled);
1657
+ }
1658
+
1659
+ float getQuality () const
1660
+ {
1661
+ return m_Quality;
1662
+ }
1663
+
1664
+ signals:
1665
+ void globalPropertyChanged (int &);
1666
+ };
1667
+
1620
1668
class C_Mesh_Buffer_Info : public QObject
1621
1669
{
1622
1670
Q_OBJECT
@@ -1765,12 +1813,8 @@ class C_3DModel_Info : public QObject
1765
1813
// =======================================================
1766
1814
// APPLICATION DATA
1767
1815
// =======================================================
1768
- // #ifdef USE_CMP_SDK
1769
1816
#define APP_compress_image_using " Encode with"
1770
- // #endif
1771
- // #ifdef USE_3DVIEWALLAPI
1772
1817
#define APP_Render_Models_with " Render Models with"
1773
- // #endif
1774
1818
#define APP_Decompress_image_views_using " Decode with"
1775
1819
#define APP_Reload_image_views_on_selection " Reload image views on selection"
1776
1820
#define APP_Load_recent_project_on_startup " Load recent project on startup"
@@ -1786,10 +1830,8 @@ class C_Application_Options :public QObject
1786
1830
Q_OBJECT
1787
1831
Q_ENUMS (ImageDecodeWith)
1788
1832
Q_ENUMS (RenderModelsWith)
1789
- // #ifdef USE_CMP_SDK
1790
1833
Q_ENUMS (ImageEncodeWith)
1791
1834
Q_PROPERTY (ImageEncodeWith Encode_with READ getImageEncode WRITE setImageEncode NOTIFY ImageEncodeChanged)
1792
- // #endif
1793
1835
Q_PROPERTY (ImageDecodeWith Decode_with READ getImageViewDecode WRITE setImageViewDecode NOTIFY ImageViewDecodeChanged)
1794
1836
Q_PROPERTY (bool Reload_image_views_on_selection READ getUseNewImageViews WRITE setUseNewImageViews)
1795
1837
Q_PROPERTY (bool Close_all_image_views_prior_to_process READ getCloseAllImageViews WRITE setCloseAllImageViews)
@@ -1800,9 +1842,7 @@ class C_Application_Options :public QObject
1800
1842
#ifdef USE_ASSIMP
1801
1843
Q_PROPERTY (bool Use_assimp READ getUseAssimp WRITE setUseAssimp)
1802
1844
#endif
1803
- // #ifdef USE_3DVIEWALLAPI
1804
1845
Q_PROPERTY (RenderModelsWith Render_Models_with READ getGLTFRender WRITE setGLTFRender)
1805
- // #endif
1806
1846
Q_PROPERTY (bool Show_MSE_PSNR_SSIM_Results READ getLogResults WRITE setLogResults NOTIFY LogResultsChanged)
1807
1847
Q_PROPERTY (bool Show_Analysis_Results_Table READ getAnalysisResultTable WRITE setAnalysisResultTable)
1808
1848
public:
@@ -1811,9 +1851,9 @@ class C_Application_Options :public QObject
1811
1851
enum class ImageEncodeWith {
1812
1852
CPU,
1813
1853
HPC,
1814
- #ifdef USE_GPUEncoders
1815
1854
GPU_DirectX,
1816
1855
GPU_OpenCL,
1856
+ #ifdef USE_GPU_PIPELINE_VULKAN
1817
1857
GPU_Vulkan,
1818
1858
#endif
1819
1859
};
@@ -1841,10 +1881,8 @@ class C_Application_Options :public QObject
1841
1881
1842
1882
C_Application_Options ()
1843
1883
{
1844
- m_ImageViewDecode = ImageDecodeWith::CPU;
1845
- // #ifdef USE_CMP_SDK
1846
- m_ImageEncode = ImageEncodeWith::CPU;
1847
- // #endif
1884
+ m_ImageViewDecode = ImageDecodeWith::CPU;
1885
+ m_ImageEncode = ImageEncodeWith::CPU;
1848
1886
m_loadRecentFile = false ;
1849
1887
m_useNewImageViews = false ;
1850
1888
m_refreshCurrentView = false ;
@@ -1874,7 +1912,7 @@ class C_Application_Options :public QObject
1874
1912
{
1875
1913
return m_ImageViewDecode;
1876
1914
}
1877
- // #ifdef USE_CMP_SDK
1915
+
1878
1916
void setImageEncode (ImageEncodeWith encodewith)
1879
1917
{
1880
1918
m_ImageEncode = encodewith;
@@ -1885,7 +1923,11 @@ class C_Application_Options :public QObject
1885
1923
{
1886
1924
return m_ImageEncode;
1887
1925
}
1888
- // #endif
1926
+
1927
+ bool isGPUEncode ()
1928
+ {
1929
+ return ((m_ImageEncode == ImageEncodeWith::GPU_DirectX)||(m_ImageEncode == ImageEncodeWith::GPU_OpenCL));
1930
+ }
1889
1931
1890
1932
void setImagediffContrast (double contrast)
1891
1933
{
@@ -1995,9 +2037,7 @@ class C_Application_Options :public QObject
1995
2037
}
1996
2038
1997
2039
ImageDecodeWith m_ImageViewDecode;
1998
- // #ifdef USE_CMP_SDK
1999
2040
ImageEncodeWith m_ImageEncode;
2000
- // #endif
2001
2041
bool m_clickIconToViewImage;
2002
2042
bool m_closeAllDocuments;
2003
2043
bool m_loadRecentFile;
@@ -2012,10 +2052,7 @@ class C_Application_Options :public QObject
2012
2052
signals:
2013
2053
void ImageViewDecodeChanged (QVariant &);
2014
2054
void LogResultsChanged (QVariant &);
2015
- // #ifdef USE_CMP_SDK
2016
2055
void ImageEncodeChanged (QVariant &);
2017
- // #endif
2018
-
2019
2056
};
2020
2057
2021
2058
#define STR_QUALITY_SETTING_HINT " Quality Setting Range 0 (Poor)to 1 (High)Default is 0.05"
0 commit comments