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
b2724043
Commit
b2724043
authored
10 years ago
by
Antoine Lorence
Browse files
Options
Downloads
Patches
Plain Diff
[Quantif] Remove useless Quantifier class
parent
7ced6897
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/Quantification.cpp
+0
-5
0 additions, 5 deletions
app/Operations/Quantification.cpp
app/Operations/Quantification.h
+8
-18
8 additions, 18 deletions
app/Operations/Quantification.h
app/Operations/QuantificationOp.cpp
+1
-2
1 addition, 2 deletions
app/Operations/QuantificationOp.cpp
with
9 additions
and
25 deletions
app/Operations/Quantification.cpp
+
0
−
5
View file @
b2724043
...
...
@@ -171,8 +171,3 @@ Quantification Quantification::nonLinearQuantOptimized(int size, const Image* im
return
quant
;
}
Quantifier
::
Quantifier
(
Quantification
quant
)
{
for
(
int
i
=
0
;
i
<
N_MAX_THRESHOLD
;
++
i
)
{
values
[
i
]
=
quant
.
valueOf
(
i
);
}
}
This diff is collapsed.
Click to expand it.
app/Operations/Quantification.h
+
8
−
18
View file @
b2724043
...
...
@@ -32,22 +32,22 @@ public:
void
saveAs
(
std
::
string
filename
);
inline
int
valueOf
(
int
value
)
const
{
for
(
int
i
=
0
;
i
<
this
->
size
-
1
;
++
i
)
{
if
(
value
<
this
->
_threshold
[
i
])
{
return
this
->
_values
[
i
];
for
(
int
i
=
0
;
i
<
nbThresholds
()
;
++
i
)
{
if
(
value
<
_threshold
[
i
])
{
return
_values
[
i
];
}
}
return
this
->
_values
[
this
->
size
-
1
];
return
_values
[
nbThresholds
()
];
}
inline
int
nbValues
()
{
return
size
;}
inline
int
nbValues
()
const
{
return
size
;}
inline
int
nbThresholds
()
{
return
size
-
1
;}
inline
int
nbThresholds
()
const
{
return
size
-
1
;}
inline
int
value
(
int
i
)
{
return
_values
[
i
];}
inline
int
value
(
int
i
)
const
{
return
_values
[
i
];}
inline
void
setValue
(
int
i
,
int
v
)
{
_values
[
i
]
=
v
;}
inline
int
threshold
(
int
i
)
{
return
_threshold
[
i
];}
inline
int
threshold
(
int
i
)
const
{
return
_threshold
[
i
];}
inline
void
setThreshold
(
int
i
,
int
v
)
{
_threshold
[
i
]
=
v
;}
static
Quantification
linearQuant
(
int
size
);
...
...
@@ -60,14 +60,4 @@ private:
int
*
_values
;
};
class
Quantifier
{
public:
Quantifier
(
Quantification
quant
);
inline
int
valueOf
(
imagein
::
Image
::
depth_t
value
)
{
return
this
->
values
[
value
];
}
private
:
int
values
[
N_MAX_THRESHOLD
];
};
#endif // QUANTIFICATION_H
This diff is collapsed.
Click to expand it.
app/Operations/QuantificationOp.cpp
+
1
−
2
View file @
b2724043
...
...
@@ -64,11 +64,10 @@ void QuantificationOp::operator()(const imagein::Image* image, const std::map<co
cout
<<
quantification
.
threshold
(
i
)
<<
"."
;
}
cout
<<
endl
;
Quantifier
quantifier
=
Quantifier
(
quantification
);
for
(
unsigned
int
j
=
0
;
j
<
image
->
getHeight
();
++
j
)
{
for
(
unsigned
int
i
=
0
;
i
<
image
->
getWidth
();
++
i
)
{
const
Image
::
depth_t
value
=
image
->
getPixelAt
(
i
,
j
,
c
);
resImg
->
setPixelAt
(
i
,
j
,
c
,
quantifi
er
.
valueOf
(
value
));
resImg
->
setPixelAt
(
i
,
j
,
c
,
quantifi
cation
.
valueOf
(
value
));
}
}
}
...
...
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