Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Richard Torenvliet
eos
Commits
21dbebd8
Commit
21dbebd8
authored
9 years ago
by
Patrik Huber
Browse files
Options
Downloads
Patches
Plain Diff
Added const to variables in two render-utils functions.
The assembly on VC14 is the same, but anyway!
parent
2944bd0f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/eos/render/utils.hpp
+3
-3
3 additions, 3 deletions
include/eos/render/utils.hpp
with
3 additions
and
3 deletions
include/eos/render/utils.hpp
+
3
−
3
View file @
21dbebd8
...
...
@@ -47,8 +47,8 @@ namespace eos {
inline
cv
::
Vec2f
clip_to_screen_space
(
const
cv
::
Vec2f
&
clip_coordinates
,
int
screen_width
,
int
screen_height
)
{
// Window transform:
float
x_ss
=
(
clip_coordinates
[
0
]
+
1.0
f
)
*
(
screen_width
/
2.0
f
);
float
y_ss
=
screen_height
-
(
clip_coordinates
[
1
]
+
1.0
f
)
*
(
screen_height
/
2.0
f
);
// also flip y; Qt: Origin top-left. OpenGL: bottom-left.
const
float
x_ss
=
(
clip_coordinates
[
0
]
+
1.0
f
)
*
(
screen_width
/
2.0
f
);
const
float
y_ss
=
screen_height
-
(
clip_coordinates
[
1
]
+
1.0
f
)
*
(
screen_height
/
2.0
f
);
// also flip y; Qt: Origin top-left. OpenGL: bottom-left.
return
cv
::
Vec2f
(
x_ss
,
y_ss
);
/* Note: What we do here is equivalent to
x_w = (x * vW/2) + vW/2;
...
...
@@ -72,7 +72,7 @@ inline cv::Vec2f clip_to_screen_space(const cv::Vec2f& clip_coordinates, int scr
*/
inline
cv
::
Vec2f
screen_to_clip_space
(
const
cv
::
Vec2f
&
screen_coordinates
,
int
screen_width
,
int
screen_height
)
{
float
x_cs
=
screen_coordinates
[
0
]
/
(
screen_width
/
2.0
f
)
-
1.0
f
;
const
float
x_cs
=
screen_coordinates
[
0
]
/
(
screen_width
/
2.0
f
)
-
1.0
f
;
float
y_cs
=
screen_coordinates
[
1
]
/
(
screen_height
/
2.0
f
)
-
1.0
f
;
y_cs
*=
-
1.0
f
;
return
cv
::
Vec2f
(
x_cs
,
y_cs
);
...
...
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