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
7e610a01
Commit
7e610a01
authored
Jul 12, 2015
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed screen/clip transform to take const references
parent
2b965cd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
include/eos/render/utils.hpp
include/eos/render/utils.hpp
+4
-4
No files found.
include/eos/render/utils.hpp
View file @
7e610a01
...
...
@@ -44,7 +44,7 @@ namespace eos {
* @param[in] screen_height Height of the screen or window.
* @return A vector with x and y coordinates transformed to screen space.
*/
inline
cv
::
Vec2f
clip_to_screen_space
(
c
v
::
Vec2f
clip_coordinates
,
int
screen_width
,
int
screen_height
)
inline
cv
::
Vec2f
clip_to_screen_space
(
c
onst
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
);
...
...
@@ -70,10 +70,10 @@ inline cv::Vec2f clip_to_screen_space(cv::Vec2f clip_coordinates, int screen_wid
* @param[in] screenHeight Height of the screen or window.
* @return A vector with x and y coordinates transformed to clip space.
*/
inline
cv
::
Vec2f
screen
ToClipSpace
(
cv
::
Vec2f
screenCoordinates
,
int
screenWidth
,
int
screenH
eight
)
inline
cv
::
Vec2f
screen
_to_clip_space
(
const
cv
::
Vec2f
&
screen_coordinates
,
int
screen_width
,
int
screen_h
eight
)
{
float
x_cs
=
screen
Coordinates
[
0
]
/
(
screenW
idth
/
2.0
f
)
-
1.0
f
;
float
y_cs
=
screen
Coordinates
[
1
]
/
(
screenH
eight
/
2.0
f
)
-
1.0
f
;
float
x_cs
=
screen
_coordinates
[
0
]
/
(
screen_w
idth
/
2.0
f
)
-
1.0
f
;
float
y_cs
=
screen
_coordinates
[
1
]
/
(
screen_h
eight
/
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