Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ImageINSA_Tanguy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tanguy.Raufflet
ImageINSA_Tanguy
Commits
7f62f5cb
Commit
7f62f5cb
authored
6 years ago
by
Provot Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Updated convert to uchar
parent
48509804
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/Operations/UCharConvertDialog.cpp
+5
-0
5 additions, 0 deletions
app/Operations/UCharConvertDialog.cpp
app/Operations/UCharConvertDialog.h
+2
-0
2 additions, 0 deletions
app/Operations/UCharConvertDialog.h
app/Operations/UCharConvertOp.cpp
+10
-2
10 additions, 2 deletions
app/Operations/UCharConvertOp.cpp
with
17 additions
and
2 deletions
app/Operations/UCharConvertDialog.cpp
+
5
−
0
View file @
7f62f5cb
...
...
@@ -9,6 +9,7 @@
#include
<QSpinBox>
#include
<QComboBox>
#include
<QStringList>
#include
<QString>
UCharConvertDialog
::
UCharConvertDialog
(
QWidget
*
parent
)
:
...
...
@@ -74,3 +75,7 @@ int UCharConvertDialog::getCombo(){
int
UCharConvertDialog
::
getOffset
(){
return
_spinBox
->
value
();
}
QString
UCharConvertDialog
::
getText
(){
return
_comboBox
->
currentText
();
}
This diff is collapsed.
Click to expand it.
app/Operations/UCharConvertDialog.h
+
2
−
0
View file @
7f62f5cb
...
...
@@ -5,6 +5,7 @@
#include
<QSpinBox>
#include
<QLabel>
#include
<QComboBox>
#include
<QString>
namespace
Ui
{
class
UCharConvertDialog
;
...
...
@@ -18,6 +19,7 @@ public:
explicit
UCharConvertDialog
(
QWidget
*
parent
=
0
);
int
getCombo
();
int
getOffset
();
QString
getText
();
public
slots
:
...
...
This diff is collapsed.
Click to expand it.
app/Operations/UCharConvertOp.cpp
+
10
−
2
View file @
7f62f5cb
...
...
@@ -56,11 +56,13 @@ void UCharConvertOp::operator()(const imagein::Image_t<double>* from, const std:
std
::
string
LogMessage
=
""
;
Image_t
<
int
>
*
tempIntImg
;
int
offset
;
std
::
string
windowName
;
switch
(
dialog
->
getCombo
())
{
case
0
:
resImg
=
Converter
<
Image
>::
convertAndRound
(
*
from
);
windowName
=
qApp
->
translate
(
"Operations"
,
"Cropped"
).
toStdString
();
break
;
case
1
:
...
...
@@ -68,6 +70,7 @@ void UCharConvertOp::operator()(const imagein::Image_t<double>* from, const std:
tempIntImg
->
normalize
();
resImg
=
Converter
<
Image
>::
convert
(
*
tempIntImg
);
delete
tempIntImg
;
windowName
=
qApp
->
translate
(
"Operations"
,
"Normalized"
).
toStdString
();
break
;
case
2
:
...
...
@@ -76,27 +79,32 @@ void UCharConvertOp::operator()(const imagein::Image_t<double>* from, const std:
offset
=
dialog
->
getOffset
();
resImg
=
Converter
<
Image
>::
convertAndOffset
(
*
tempIntImg
,
&
LogMessage
,
offset
);
delete
tempIntImg
;
windowName
=
qApp
->
translate
(
"Operations"
,
"Offset"
).
toStdString
();
break
;
case
4
:
tempIntImg
=
Converter
<
Image_t
<
double
>>::
convertToInt
(
*
from
);
resImg
=
Converter
<
Image
>::
convertScaleAndOffset
(
*
tempIntImg
,
&
LogMessage
);
delete
tempIntImg
;
windowName
=
qApp
->
translate
(
"Operations"
,
"Offset and scaled"
).
toStdString
();
break
;
case
3
:
tempIntImg
=
Converter
<
Image_t
<
double
>>::
convertToInt
(
*
from
);
resImg
=
Converter
<
Image
>::
convertAndScale
(
*
tempIntImg
,
&
LogMessage
);
delete
tempIntImg
;
windowName
=
qApp
->
translate
(
"Operations"
,
"Scaled"
).
toStdString
();
break
;
default:
std
::
cout
<<
"Default conversion"
<<
std
::
endl
;
resImg
=
Converter
<
Image
>::
convertAndRound
(
*
from
);
windowName
=
qApp
->
translate
(
"Operations"
,
"Cropped"
).
toStdString
();
break
;
}
outImage
(
resImg
,
"Title"
);
//si erreur lors du chargement alors non de fenêtre vide
outImage
(
resImg
,
windowName
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment