Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eyesis4pi-393-panorama-previewer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
eyesis4pi-393-panorama-previewer
Commits
87751fc4
Commit
87751fc4
authored
Apr 05, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. fixed preview borders
parent
c8b40199
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
+23
-13
elphel.js
js/elphel.js
+8
-3
panorama_preview.css
js/panorama_preview.css
+3
-2
panorama_preview.js
js/panorama_preview.js
+12
-8
No files found.
js/elphel.js
View file @
87751fc4
...
@@ -87,10 +87,15 @@ var Elphel = {
...
@@ -87,10 +87,15 @@ var Elphel = {
sctx
.
canvas
.
width
=
w
;
sctx
.
canvas
.
width
=
w
;
sctx
.
canvas
.
height
=
h
;
sctx
.
canvas
.
height
=
h
;
cscale
=
Math
.
round
(
w
/
tw
*
100
)
/
100
;
//
cscale = Math.round(w/tw*100)/100;
sctx
.
scale
(
cscale
,
cscale
);
//option 1
sctx
.
drawImage
(
cnv_src
[
0
],
0
,
0
);
//cscale = w/tw;
//sctx.scale(cscale,cscale);
//sctx.drawImage(cnv_src[0],0,0);
// option 2
sctx
.
drawImage
(
cnv_src
[
0
],
0
,
0
,
ctx
.
canvas
.
width
,
ctx
.
canvas
.
height
,
0
,
0
,
sctx
.
canvas
.
width
,
sctx
.
canvas
.
height
);
console
.
log
(
"drawScaled(): "
+
(
Date
.
now
()
-
t0
)
/
1000
+
" s"
);
console
.
log
(
"drawScaled(): "
+
(
Date
.
now
()
-
t0
)
/
1000
+
" s"
);
}
}
...
...
js/panorama_preview.css
View file @
87751fc4
...
@@ -2,8 +2,9 @@
...
@@ -2,8 +2,9 @@
position
:
absolute
;
position
:
absolute
;
top
:
5px
;
top
:
5px
;
left
:
5px
;
left
:
5px
;
width
:
1170px
;
width
:
1200px
;
height
:
585px
;
/* height:585px; */
height
:
600px
;
padding
:
5px
;
padding
:
5px
;
background
:
#99ff99
;
background
:
#99ff99
;
}
}
...
...
js/panorama_preview.js
View file @
87751fc4
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,8 @@
*! -----------------------------------------------------------------------------**
*! -----------------------------------------------------------------------------**
*/
*/
var
baseWidth
=
194
;
var
baseWidth
=
200
;
var
baseHeight
=
1
46
;
var
baseHeight
=
1
50
;
var
W
=
2592
;
var
W
=
2592
;
var
H
=
1944
;
var
H
=
1944
;
...
@@ -124,19 +124,23 @@ function draw_image(img,index){
...
@@ -124,19 +124,23 @@ function draw_image(img,index){
index
=
+
index
;
index
=
+
index
;
var
dx
=
Array
(
0
,
1
,
4
);
var
dw
=
Array
(
0
,
0
,
4
);
cContext
.
rotate
(
90
*
Math
.
PI
/
180
);
cContext
.
rotate
(
90
*
Math
.
PI
/
180
);
if
(
index
%
2
==
0
)
{
if
(
index
%
2
==
0
)
{
cContext
.
drawImage
(
img
,
0
,
0
*
h
,
w
,
h
,
0
*
w
,
-
1
*
h
*
(
index
+
1
),
w
,
h
);
//drawImage img sx,sy, sw,sh, dx,dy, dw,dh
cContext
.
drawImage
(
img
,
0
,
1
*
h
,
w
,
h
,
1
*
w
,
-
1
*
h
*
(
index
+
1
),
w
,
h
);
cContext
.
drawImage
(
img
,
0
,
0
*
h
+
dx
[
0
],
w
,
h
-
dw
[
0
],
0
*
w
,
-
1
*
h
*
(
index
+
1
),
w
,
h
);
cContext
.
drawImage
(
img
,
0
,
1
*
h
+
dx
[
1
],
w
,
h
-
dw
[
1
],
1
*
w
,
-
1
*
h
*
(
index
+
1
),
w
,
h
);
cContext
.
scale
(
-
1
,
1
);
cContext
.
scale
(
-
1
,
1
);
cContext
.
drawImage
(
img
,
0
,
2
*
h
,
w
,
h
,
-
3
*
w
,
-
1
*
h
*
(
index
+
1
),
w
,
h
);
cContext
.
drawImage
(
img
,
0
,
2
*
h
+
dx
[
2
],
w
,
h
-
dw
[
2
],
-
3
*
w
,
-
1
*
h
*
(
index
+
1
),
w
,
h
);
cContext
.
scale
(
-
1
,
1
);
cContext
.
scale
(
-
1
,
1
);
}
else
{
}
else
{
cContext
.
scale
(
1
,
-
1
);
//mirror is needed
cContext
.
scale
(
1
,
-
1
);
//mirror is needed
cContext
.
drawImage
(
img
,
0
,
0
*
h
,
w
,
h
,
0
*
w
,
index
*
h
,
w
,
h
);
cContext
.
drawImage
(
img
,
0
,
0
*
h
+
dx
[
0
],
w
,
h
-
dw
[
0
]
,
0
*
w
,
index
*
h
,
w
,
h
);
cContext
.
drawImage
(
img
,
0
,
1
*
h
,
w
,
h
,
1
*
w
,
index
*
h
,
w
,
h
);
cContext
.
drawImage
(
img
,
0
,
1
*
h
+
dx
[
1
],
w
,
h
-
dw
[
1
]
,
1
*
w
,
index
*
h
,
w
,
h
);
cContext
.
scale
(
-
1
,
1
);
cContext
.
scale
(
-
1
,
1
);
cContext
.
drawImage
(
img
,
0
,
2
*
h
,
w
,
h
,
-
3
*
w
,
h
*
(
index
),
w
,
h
);
cContext
.
drawImage
(
img
,
0
,
2
*
h
+
dx
[
2
],
w
,
h
-
dw
[
2
]
,
-
3
*
w
,
h
*
(
index
),
w
,
h
);
cContext
.
scale
(
-
1
,
1
);
cContext
.
scale
(
-
1
,
1
);
cContext
.
scale
(
1
,
-
1
);
cContext
.
scale
(
1
,
-
1
);
}
}
...
...
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