From ef294b42edfe9d5e4db0515b72c03a36245f1315 Mon Sep 17 00:00:00 2001
From: qbigot <quentin.bigot@insa-rennes.fr>
Date: Mon, 17 Jul 2017 11:04:29 +0200
Subject: [PATCH] =?UTF-8?q?add=20possibility=20to=20have=20a=20double=20re?=
 =?UTF-8?q?sult=20for=20standard=20image=20op=C3=A9ration?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/Operations/PointOp.cpp | 13 ++++++++++++-
 app/imageinsa_en.ts        | 24 ++++++++++++++++++++++--
 app/imageinsa_fr.ts        | 18 ++++++++++++++----
 3 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/app/Operations/PointOp.cpp b/app/Operations/PointOp.cpp
index f18d37f..81dcaf3 100644
--- a/app/Operations/PointOp.cpp
+++ b/app/Operations/PointOp.cpp
@@ -130,6 +130,17 @@ void PointOp::operator()(const ImageWindow* currentWnd, const vector<const Image
     QCheckBox* colorBox = new QCheckBox(qApp->translate("PointOp", "Explode colors"), dialog);
     layout->addWidget(colorBox);
 
+
+    //Ajout d'une checkbox permettant d'avoir le résultat en format Double
+    QCheckBox* DoubleRes = new QCheckBox(qApp->translate("PointOp", "Double Result"), dialog);
+    //Si l'image est une image double le bouton est obligatoirement coché
+    if(currentWnd->isDouble()){
+        DoubleRes->setChecked(true);
+        DoubleRes->setEnabled(false);
+    }
+    layout->addWidget(DoubleRes);
+
+
     int nChannel = currentWnd->getDisplayImage()->getNbChannels();
 
     QHBoxLayout** valueLayouts = new QHBoxLayout*[nChannel+1];
@@ -202,7 +213,7 @@ void PointOp::operator()(const ImageWindow* currentWnd, const vector<const Image
         return;
     }
 
-    bool dblResult = currentWnd->isDouble();
+    bool dblResult = currentWnd->isDouble() || DoubleRes->isChecked();
     if(!valueButton->isChecked()) {
         if(!colorBox->isChecked()) {
             dblResult = dblResult || (imageBoxes[0]->currentType() == MixImageListBox::DBLIMG);
diff --git a/app/imageinsa_en.ts b/app/imageinsa_en.ts
index 6d0fc52..7973051 100644
--- a/app/imageinsa_en.ts
+++ b/app/imageinsa_en.ts
@@ -523,8 +523,23 @@ Number of classes = %1 </translation>
     </message>
     <message>
         <location filename="Operations/DPCMEncodingOp.cpp" line="62"/>
-        <source>Error image</source>
-        <translation>Error image</translation>
+        <source>Prediction error image</source>
+        <translation>Prediction error image</translation>
+    </message>
+    <message>
+        <location filename="Operations/DPCMEncodingOp.cpp" line="62"/>
+        <source>Quantized prediction error image</source>
+        <translation>Quantized prediction error image</translation>
+    </message>
+    <message>
+        <location filename="Operations/DPCMEncodingOp.cpp" line="62"/>
+        <source>Coding error image</source>
+        <translation>Coding error image</translation>
+    </message>
+    <message>
+        <location filename="Operations/DPCMEncodingOp.cpp" line="62"/>
+        <source>Prediction image</source>
+        <translation>Prediction image</translation>
     </message>
     <message>
         <location filename="Operations/DPCMEncodingOp.cpp" line="63"/>
@@ -1233,6 +1248,11 @@ Number of classes = %1 </translation>
         <source>Explode colors</source>
         <translation>Explode colors</translation>
     </message>
+    <message>
+        <location filename="Operations/PointOp.cpp" line="128"/>
+        <source>Double Result</source>
+        <translation>Double Result</translation>
+    </message>
 </context>
 <context>
     <name>PseudoColorOp</name>
diff --git a/app/imageinsa_fr.ts b/app/imageinsa_fr.ts
index 7df49e7..d83ccba 100644
--- a/app/imageinsa_fr.ts
+++ b/app/imageinsa_fr.ts
@@ -523,13 +523,18 @@ Nombre de classes = %1 </translation>
     </message>
     <message>
         <location filename="Operations/DPCMEncodingOp.cpp" line="62"/>
-        <source>Error image</source>
-        <translation>Image d&apos;erreur</translation>
+        <source>Prediction error image</source>
+        <translation>Image d&apos;erreur de prédiction</translation>
     </message>
     <message>
         <location filename="Operations/DPCMEncodingOp.cpp" line="62"/>
-        <source>Quantized error image</source>
-        <translation>Image d&apos;erreur quantifiée</translation>
+        <source>Quantized prediction error image</source>
+        <translation>Image d&apos;erreur de prédiction quantifiée</translation>
+    </message>
+    <message>
+        <location filename="Operations/DPCMEncodingOp.cpp" line="62"/>
+        <source>Coding error image</source>
+        <translation>Image d&apos;erreur de codage</translation>
     </message>
     <message>
         <location filename="Operations/DPCMEncodingOp.cpp" line="63"/>
@@ -1248,6 +1253,11 @@ Nombre de classes = %1 </translation>
         <source>Explode colors</source>
         <translation>Eclater les couleurs</translation>
     </message>
+    <message>
+        <location filename="Operations/PointOp.cpp" line="128"/>
+        <source>Double Result</source>
+        <translation>Résultat Double</translation>
+    </message>
 </context>
 <context>
     <name>PseudoColorOp</name>
-- 
GitLab