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
c0050115
Commit
c0050115
authored
12 years ago
by
Sacha Percot-Tétu
Browse files
Options
Downloads
Patches
Plain Diff
Moved utility method to namespace Tools
parent
b9560566
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/PointOp.cpp
+4
-2
4 additions, 2 deletions
app/Operations/PointOp.cpp
app/Operations/PointOp.h
+0
-10
0 additions, 10 deletions
app/Operations/PointOp.h
app/Tools.h
+35
-0
35 additions, 0 deletions
app/Tools.h
with
39 additions
and
12 deletions
app/Operations/PointOp.cpp
+
4
−
2
View file @
c0050115
...
@@ -33,6 +33,8 @@
...
@@ -33,6 +33,8 @@
#include
"ImgWidget.h"
#include
"ImgWidget.h"
#include
"ImageListBox.h"
#include
"ImageListBox.h"
#include
"../Tools.h"
using
namespace
std
;
using
namespace
std
;
using
namespace
imagein
;
using
namespace
imagein
;
...
@@ -106,7 +108,7 @@ vector<QWidget*> PointOp::operator()(const imagein::Image* image, const std::map
...
@@ -106,7 +108,7 @@ vector<QWidget*> PointOp::operator()(const imagein::Image* image, const std::map
exprEdits
[
0
]
=
new
QLineEdit
(
pixelWidget
);
exprEdits
[
0
]
=
new
QLineEdit
(
pixelWidget
);
exprEdits
[
0
]
->
setFixedWidth
(
64
);
exprEdits
[
0
]
->
setFixedWidth
(
64
);
imageBoxes
[
0
]
=
new
ImageListBox
(
pixelWidget
,
image
,
imgList
);
imageBoxes
[
0
]
=
new
ImageListBox
(
pixelWidget
,
image
,
imgList
);
valueLayouts
[
0
]
->
addWidget
(
new
QLabel
(
"Image"
,
pixelWidget
));
valueLayouts
[
0
]
->
addWidget
(
new
QLabel
(
dialog
->
tr
(
"Image"
)
,
pixelWidget
));
valueLayouts
[
0
]
->
addWidget
(
pixOperatorBoxes
[
0
]);
valueLayouts
[
0
]
->
addWidget
(
pixOperatorBoxes
[
0
]);
valueLayouts
[
0
]
->
addWidget
(
imgOperatorBoxes
[
0
]);
valueLayouts
[
0
]
->
addWidget
(
imgOperatorBoxes
[
0
]);
valueLayouts
[
0
]
->
addWidget
(
exprEdits
[
0
]);
valueLayouts
[
0
]
->
addWidget
(
exprEdits
[
0
]);
...
@@ -127,7 +129,7 @@ vector<QWidget*> PointOp::operator()(const imagein::Image* image, const std::map
...
@@ -127,7 +129,7 @@ vector<QWidget*> PointOp::operator()(const imagein::Image* image, const std::map
exprEdits
[
i
]
=
new
QLineEdit
(
colorWidget
);
exprEdits
[
i
]
=
new
QLineEdit
(
colorWidget
);
exprEdits
[
i
]
->
setFixedWidth
(
64
);
exprEdits
[
i
]
->
setFixedWidth
(
64
);
imageBoxes
[
i
]
=
new
ImageListBox
(
colorWidget
,
image
,
imgList
);
imageBoxes
[
i
]
=
new
ImageListBox
(
colorWidget
,
image
,
imgList
);
valueLayouts
[
i
]
->
addWidget
(
new
QLabel
(
colorName
(
i
-
1
,
nChannel
),
colorWidget
));
valueLayouts
[
i
]
->
addWidget
(
new
QLabel
(
Tools
::
colorName
(
i
-
1
,
nChannel
),
colorWidget
));
valueLayouts
[
i
]
->
addWidget
(
pixOperatorBoxes
[
i
]);
valueLayouts
[
i
]
->
addWidget
(
pixOperatorBoxes
[
i
]);
valueLayouts
[
i
]
->
addWidget
(
imgOperatorBoxes
[
i
]);
valueLayouts
[
i
]
->
addWidget
(
imgOperatorBoxes
[
i
]);
valueLayouts
[
i
]
->
addWidget
(
exprEdits
[
i
]);
valueLayouts
[
i
]
->
addWidget
(
exprEdits
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
app/Operations/PointOp.h
+
0
−
10
View file @
c0050115
...
@@ -40,16 +40,6 @@ class PointOp : public Operation {
...
@@ -40,16 +40,6 @@ class PointOp : public Operation {
bool
needCurrentImg
();
bool
needCurrentImg
();
inline
static
QString
colorName
(
int
i
,
int
n
)
{
if
((
n
==
1
||
n
==
2
)
&&
i
==
0
)
return
tr
(
"Black"
);
if
((
n
==
2
&&
i
==
1
)
||
(
n
==
4
&&
i
==
3
))
return
tr
(
"Alpha"
);
switch
(
i
)
{
case
0
:
return
tr
(
"Red"
);
case
1
:
return
tr
(
"Green"
);
case
2
:
return
tr
(
"Blue"
);
default
:
return
tr
(
"Color"
);
}
}
static
inline
QString
tr
(
const
char
*
str
)
{
return
QCoreApplication
::
tr
(
str
);
}
private:
private:
typedef
imagein
::
Image
::
depth_t
depth_t
;
typedef
imagein
::
Image
::
depth_t
depth_t
;
...
...
This diff is collapsed.
Click to expand it.
app/Tools.h
0 → 100644
+
35
−
0
View file @
c0050115
/*
* Copyright 2011-2012 INSA Rennes
*
* This file is part of EIImage.
*
* EIImage is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EIImage is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EIImage. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TOOLS_H
#define TOOLS_H
namespace
Tools
{
inline
QString
tr
(
const
char
*
str
)
{
return
QCoreApplication
::
tr
(
str
);
}
inline
QString
colorName
(
int
i
,
int
n
)
{
if
((
n
==
1
||
n
==
2
)
&&
i
==
0
)
return
tr
(
"Black"
);
if
((
n
==
2
&&
i
==
1
)
||
(
n
==
4
&&
i
==
3
))
return
tr
(
"Alpha"
);
switch
(
i
)
{
case
0
:
return
tr
(
"Red"
);
case
1
:
return
tr
(
"Green"
);
case
2
:
return
tr
(
"Blue"
);
default
:
return
tr
(
"Color"
);
}
}
}
#endif // TOOLS_H
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