Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Luis Penaranda
panoramic
Commits
a066dd5b
Commit
a066dd5b
authored
Jan 22, 2013
by
Luis Peñaranda
Browse files
Merge branch 'master' of gitorious.impa.br:pano/pano
parents
053e329f
b9a7cf0f
Changes
3
Hide whitespace changes
Inline
Side-by-side
openglcanvas.cpp
View file @
a066dd5b
...
...
@@ -476,7 +476,9 @@ int OpenGLCanvas::getTextureSize(const char * const progname, const char * textu
pnm_readpaminit
(
in_file
,
&
inpam
,
sizeof
(
struct
pam
));
#endif
int
size
=
inpam
.
width
*
inpam
.
height
*
inpam
.
depth
*
inpam
.
bytes_per_sample
;
image_size_x
=
inpam
.
width
;
image_size_y
=
inpam
.
height
;
int
size
=
image_size_x
*
image_size_y
*
inpam
.
depth
*
inpam
.
bytes_per_sample
;
pm_close
(
in_file
);
//fprintf(stderr,"size=%d\n",size);
...
...
@@ -620,6 +622,22 @@ void OpenGLCanvas::setShaders() {
}
void
OpenGLCanvas
::
mousePressEvent
(
QMouseEvent
*
event
){
lastPos
=
event
->
pos
();
//fprintf(stderr,"mouse click\n");
}
void
OpenGLCanvas
::
mouseMoveEvent
(
QMouseEvent
*
event
){
// scroll with the left button
if
(
event
->
buttons
()
==
Qt
::
LeftButton
){
// compute the delta and move the image
center_lambda
+=
(
event
->
x
()
-
lastPos
.
x
())
*
3.1415926
f
/
image_size_x
;
center_phi
+=
(
event
->
y
()
-
lastPos
.
y
())
*
3.1415926
f
/
image_size_y
;
lastPos
=
event
->
pos
();
updateGL
();
}
}
void
OpenGLCanvas
::
paintGL
(){
float
fov_rads
=
(
fov
/
180.
f
)
*
1.5708
f
;
...
...
openglcanvas.h
View file @
a066dd5b
...
...
@@ -55,6 +55,8 @@ protected:
void
readTextureBytes
(
const
char
*
const
progname
,
const
char
*
texturePath
,
unsigned
char
*
textureBytes
,
int
*
outImageWidth
,
int
*
outImageHeight
);
char
*
textFileRead
(
char
*
fn
);
void
setShaders
();
void
mousePressEvent
(
QMouseEvent
*
event
);
void
mouseMoveEvent
(
QMouseEvent
*
event
);
signals:
void
fps
(
QString
newFPS
);
...
...
@@ -95,6 +97,12 @@ private:
// options set in the rc file
char
*
shader_dir
;
char
*
input_image_file
;
// input image size (determined automatically)
int
image_size_x
;
int
image_size_y
;
QPoint
lastPos
;
// mouse click position
};
#endif // OPENGLCANVAS_H
panowindow1.ui
View file @
a066dd5b
...
...
@@ -201,6 +201,7 @@
<slot>
change_center_phi(double)
</slot>
<slot>
change_fov_scale_relation(QString)
</slot>
<slot>
change_visualization(QString)
</slot>
<slot>
change_input_image()
</slot>
</slots>
</customwidget>
</customwidgets>
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment