Skip to content

Commit 62a979a

Browse files
committed
GUI updates
1 parent d3f7637 commit 62a979a

22 files changed

+597
-378
lines changed

Compressonator/Applications/CompressonatorGUI/Components/acAboutDlg.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void CHelpAboutDialog::Init(const QString & title, const QString & productName)
3838
QString helpAboutString = "Compressonator<br>";
3939
helpAboutString.append(version);
4040

41-
QString copyRightCaption = "<p> &copy; 2019 Advanced Micro Devices, Inc. All Rights Reserved.</p>";
41+
QString copyRightCaption = "<p> &copy; 2020 Advanced Micro Devices, Inc. All Rights Reserved.</p>";
4242
// Create the QLabels from the strings:
4343
QLabel* pHelpAboutStringAsStaticText = new QLabel(helpAboutString);
4444
QLabel* pCopyRightCaptionAsStaticText = new QLabel(copyRightCaption);

Compressonator/Applications/CompressonatorGUI/Components/acImageView.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1332,13 +1332,13 @@ void acImageView::centerImage()
13321332
// so that is viewed in center
13331333
QTransform translation;
13341334
translation.translate(dx, dy);
1335-
m_imageItem_Processed->setTransform(translation, true);
1335+
m_imageItem_Processed->setTransform(translation,true);
13361336
//#endif
13371337

13381338
if (m_imageItem_Original)
13391339
{
13401340
m_imageItem_Original->setTransformOriginPoint(0, 0);
1341-
m_imageItem_Original->setTransform(translation, true);
1341+
m_imageItem_Original->setTransform(translation,true);
13421342
}
13431343

13441344
}

Compressonator/Applications/CompressonatorGUI/Components/acOGLWidget.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ GLenum acOGLWidget::MIP2OLG_Format(MipSet *m_MipSet)
5050
return m_GLnum;
5151
}
5252

53-
5453
bool acOGLWidget::loadMIPImage(MipSet *m_MipSet, CMIPS *cMips, int MIPLevel = 0)
5554
{
5655
// Get First <IP Level

Compressonator/Applications/CompressonatorGUI/Components/acOGLWidget.h

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class acOGLWidget : public QOpenGLWidget, protected QOpenGLFunctions
3434

3535
explicit acOGLWidget(QWidget *parent = 0);
3636
virtual ~acOGLWidget();
37-
3837
#if 0
3938
GLenum MIP2OLG_Format(MipSet *m_MipSet);
4039
bool loadMIPImage(MipSet *m_MipSet, CMIPS *cMips, int MIPLevel);

Compressonator/Applications/CompressonatorGUI/Components/cp3DModelView.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -626,18 +626,14 @@ cp3DModelView::cp3DModelView(const QString filePathName, const QString filePathN
626626
if (((strcmp(c_ext, "GLTF") == 0) || (strcmp(c_ext, "BIN") == 0)))
627627
{
628628
m_isviewingDX12 = true;
629-
//#ifdef USE_3DVIEWALLAPI
630629
if (g_Application_Options.getGLTFRender() == C_Application_Options::RenderModelsWith::glTF_OpenGL)
631-
//#endif
632630
g_Application_Options.setGLTFRender(C_Application_Options::RenderModelsWith::glTF_DX12_EX);
633631
}
634632
else
635633
{
636634
m_isviewingDX12 = false;
637-
#ifdef USE_3DVIEWALLAPI
638635
if (g_Application_Options.getGLTFRender() == C_Application_Options::RenderModelsWith::glTF_DX12_EX ||
639636
g_Application_Options.getGLTFRender() == C_Application_Options::RenderModelsWith::glTF_Vulkan)
640-
#endif
641637
g_Application_Options.setGLTFRender(C_Application_Options::RenderModelsWith::glTF_OpenGL);
642638
}
643639

Compressonator/Applications/CompressonatorGUI/Components/cpGenMips.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ m_parent(parent)
6363
}
6464

6565

66-
void CGenMips::setMipLevelDisplay(int Width, int Height)
66+
void CGenMips::setMipLevelDisplay(int Width, int Height, bool UsingGPU = false)
6767
{
6868
m_ImageSize_W = Width;
6969
m_ImageSize_H = Height;
@@ -84,14 +84,20 @@ void CGenMips::setMipLevelDisplay(int Width, int Height)
8484
Width = (Width>1) ? (Width >> 1) : 1;
8585
Height = (Height>1) ? (Height >> 1) : 1;
8686

87+
if (UsingGPU)
88+
{
89+
if ((Width % 4)||(Height%4))
90+
break;
91+
}
92+
8793
QString level;
8894
level.append(QString::number(Width));
8995
level.append("x");
9096
level.append(QString::number(Height));
9197

9298
m_MipLevelSizes << level;
93-
9499
m_MipLevels++;
100+
95101
} while (Width > 1 && Height > 1);
96102

97103
QStringList reversedList = m_MipLevelSizes;
@@ -245,8 +251,6 @@ void CGenMips::SetDefaults()
245251

246252

247253
// Data
248-
//https://doc.qt.io/archives/qq/qq18-propertybrowser.html
249-
250254
m_property = variantManager->addProperty(QtVariantPropertyManager::enumTypeId(), LOWEST_MIP_LEVELS);
251255
m_MipLevelSizes << "";
252256
m_property->setAttribute("enumNames", m_MipLevelSizes);

Compressonator/Applications/CompressonatorGUI/Components/cpGenMips.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class CGenMips : public QWidget
8282
CGenMips(const QString title, QWidget *parent);
8383
~CGenMips();
8484

85-
void setMipLevelDisplay(int Width, int Height);
85+
void setMipLevelDisplay(int Width, int Height,bool UsingGPU);
8686

8787
void SetDefaults();
8888
void evalProperties();

Compressonator/Applications/CompressonatorGUI/Components/cpImagePropertyView.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,14 @@ void CImagePropertyView::compressionValueChanged(QVariant& value)
544544
if (m_propQuality)
545545
{
546546
m_propQuality->setHidden(!Quality_Settings);
547-
m_propQuality->setEnabled(Quality_Settings);
547+
if (m_C_Destination_Options->m_globalSetting_qualityEnabled)
548+
{
549+
m_propQuality->setEnabled(false);
550+
}
551+
else
552+
{
553+
m_propQuality->setEnabled(Quality_Settings);
554+
}
548555
}
549556

550557
if (m_propDXT1Alpha)

Compressonator/Applications/CompressonatorGUI/Components/cpProjectData.h

+58-21
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,10 @@ class C_Destination_Options : public C_Destination_Image
14401440

14411441
double getQuality() const
14421442
{
1443-
return m_Quality;
1443+
if (m_globalSetting_qualityEnabled)
1444+
return m_globalSetting_quality;
1445+
else
1446+
return m_Quality;
14441447
}
14451448

14461449
bool doSwizzle()
@@ -1493,6 +1496,11 @@ class C_Destination_Options : public C_Destination_Image
14931496
// so dont delete its ref using this class. Parent class will clean it up
14941497
CMipImages *m_OriginalMipImages;
14951498

1499+
1500+
// Global Setting overrides
1501+
bool m_globalSetting_qualityEnabled = false;
1502+
float m_globalSetting_quality = 0.0f;
1503+
14961504
signals:
14971505

14981506
void compressionChanged(QVariant &);
@@ -1531,6 +1539,8 @@ class C_Destination_Options : public C_Destination_Image
15311539
ds.m_SourceIscompressedFormat = obj.m_SourceIscompressedFormat;
15321540
ds.m_SourceIsFloatFormat = obj.m_SourceIsFloatFormat;
15331541
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;
15341544
ds.m_SourceImageSize = obj.m_SourceImageSize;
15351545
ds.X_RED = obj.X_RED;
15361546
ds.Y_GREEN = obj.Y_GREEN;
@@ -1539,6 +1549,7 @@ class C_Destination_Options : public C_Destination_Image
15391549

15401550
return ds;
15411551
}
1552+
15421553
};
15431554

15441555
// =======================================================
@@ -1617,6 +1628,43 @@ Q_OBJECT
16171628
CMipImages *m_MipImages;
16181629
};
16191630

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+
16201668
class C_Mesh_Buffer_Info : public QObject
16211669
{
16221670
Q_OBJECT
@@ -1765,12 +1813,8 @@ class C_3DModel_Info : public QObject
17651813
// =======================================================
17661814
// APPLICATION DATA
17671815
// =======================================================
1768-
//#ifdef USE_CMP_SDK
17691816
#define APP_compress_image_using "Encode with"
1770-
//#endif
1771-
//#ifdef USE_3DVIEWALLAPI
17721817
#define APP_Render_Models_with "Render Models with"
1773-
//#endif
17741818
#define APP_Decompress_image_views_using "Decode with"
17751819
#define APP_Reload_image_views_on_selection "Reload image views on selection"
17761820
#define APP_Load_recent_project_on_startup "Load recent project on startup"
@@ -1786,10 +1830,8 @@ class C_Application_Options :public QObject
17861830
Q_OBJECT
17871831
Q_ENUMS(ImageDecodeWith)
17881832
Q_ENUMS(RenderModelsWith)
1789-
//#ifdef USE_CMP_SDK
17901833
Q_ENUMS(ImageEncodeWith)
17911834
Q_PROPERTY(ImageEncodeWith Encode_with READ getImageEncode WRITE setImageEncode NOTIFY ImageEncodeChanged)
1792-
//#endif
17931835
Q_PROPERTY(ImageDecodeWith Decode_with READ getImageViewDecode WRITE setImageViewDecode NOTIFY ImageViewDecodeChanged)
17941836
Q_PROPERTY(bool Reload_image_views_on_selection READ getUseNewImageViews WRITE setUseNewImageViews)
17951837
Q_PROPERTY(bool Close_all_image_views_prior_to_process READ getCloseAllImageViews WRITE setCloseAllImageViews)
@@ -1800,9 +1842,7 @@ class C_Application_Options :public QObject
18001842
#ifdef USE_ASSIMP
18011843
Q_PROPERTY(bool Use_assimp READ getUseAssimp WRITE setUseAssimp)
18021844
#endif
1803-
//#ifdef USE_3DVIEWALLAPI
18041845
Q_PROPERTY(RenderModelsWith Render_Models_with READ getGLTFRender WRITE setGLTFRender)
1805-
//#endif
18061846
Q_PROPERTY(bool Show_MSE_PSNR_SSIM_Results READ getLogResults WRITE setLogResults NOTIFY LogResultsChanged)
18071847
Q_PROPERTY(bool Show_Analysis_Results_Table READ getAnalysisResultTable WRITE setAnalysisResultTable)
18081848
public:
@@ -1811,9 +1851,9 @@ class C_Application_Options :public QObject
18111851
enum class ImageEncodeWith {
18121852
CPU,
18131853
HPC,
1814-
#ifdef USE_GPUEncoders
18151854
GPU_DirectX,
18161855
GPU_OpenCL,
1856+
#ifdef USE_GPU_PIPELINE_VULKAN
18171857
GPU_Vulkan,
18181858
#endif
18191859
};
@@ -1841,10 +1881,8 @@ class C_Application_Options :public QObject
18411881

18421882
C_Application_Options()
18431883
{
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;
18481886
m_loadRecentFile = false;
18491887
m_useNewImageViews = false;
18501888
m_refreshCurrentView = false;
@@ -1874,7 +1912,7 @@ class C_Application_Options :public QObject
18741912
{
18751913
return m_ImageViewDecode;
18761914
}
1877-
//#ifdef USE_CMP_SDK
1915+
18781916
void setImageEncode(ImageEncodeWith encodewith)
18791917
{
18801918
m_ImageEncode = encodewith;
@@ -1885,7 +1923,11 @@ class C_Application_Options :public QObject
18851923
{
18861924
return m_ImageEncode;
18871925
}
1888-
//#endif
1926+
1927+
bool isGPUEncode()
1928+
{
1929+
return ((m_ImageEncode == ImageEncodeWith::GPU_DirectX)||(m_ImageEncode == ImageEncodeWith::GPU_OpenCL));
1930+
}
18891931

18901932
void setImagediffContrast(double contrast)
18911933
{
@@ -1995,9 +2037,7 @@ class C_Application_Options :public QObject
19952037
}
19962038

19972039
ImageDecodeWith m_ImageViewDecode;
1998-
//#ifdef USE_CMP_SDK
19992040
ImageEncodeWith m_ImageEncode;
2000-
//#endif
20012041
bool m_clickIconToViewImage;
20022042
bool m_closeAllDocuments;
20032043
bool m_loadRecentFile;
@@ -2012,10 +2052,7 @@ class C_Application_Options :public QObject
20122052
signals:
20132053
void ImageViewDecodeChanged(QVariant &);
20142054
void LogResultsChanged(QVariant &);
2015-
//#ifdef USE_CMP_SDK
20162055
void ImageEncodeChanged(QVariant &);
2017-
//#endif
2018-
20192056
};
20202057

20212058
#define STR_QUALITY_SETTING_HINT "Quality Setting Range 0 (Poor)to 1 (High)Default is 0.05"

0 commit comments

Comments
 (0)