Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Richard Torenvliet
eos
Commits
21dbebd8
Commit
21dbebd8
authored
Jul 28, 2015
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added const to variables in two render-utils functions.
The assembly on VC14 is the same, but anyway!
parent
2944bd0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
include/eos/render/utils.hpp
include/eos/render/utils.hpp
+3
-3
No files found.
include/eos/render/utils.hpp
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment