Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-web-393
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
elphel-web-393
Commits
bf1493f4
Commit
bf1493f4
authored
May 03, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. valid values 2. comments
parent
659c7529
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
+34
-4
elphel.js
src/jp4-canvas/elphel.js
+28
-3
jquery-jp4.js
src/jp4-canvas/jquery-jp4.js
+6
-1
No files found.
src/jp4-canvas/elphel.js
View file @
bf1493f4
...
@@ -105,8 +105,33 @@ var Elphel = {
...
@@ -105,8 +105,33 @@ var Elphel = {
// Pixel manipulation
// Pixel manipulation
Pixels
:{
Pixels
:{
/**
* Name: reorderJP4Blocks_lowres
* Description: clear from the function's name except for the image must
* be already scaled to W/lowres x H/lowres
* the image is passed as an array of pixels from <canvas>
*
* @pixels - pixel array, read from origin canvas
* pixels is a long 1-D array with the following structure:
* pix[i+0] - red
* pix[i+1] - green
* pix[i+2] - blue
* pix[i+3] - alpha
* @width - origin canvas width
* @height - origin canvas height
* @format - value comes from exif.js function
* 'jpeg' - skip reordering
* 'jp4' - jp4 reordeing
* 'jp46' - jp46 reordering
* @mosaic - [["Gr","R"],["B","Gb"]] - value comes from application
* odd lines: Gr,R,Gr,R
* even lines: B,Gb,B,Gb
* @lowres - valid values: 1 (not scaled), 2, 4, 8 (lowest resolution)
*
*/
reorderBlocksJP4_lowres
:
function
(
pixels
,
width
,
height
,
format
=
"JP4"
,
mosaic
=
[[
"Gr"
,
"R"
],[
"B"
,
"Gb"
]],
lowres
){
reorderBlocksJP4_lowres
:
function
(
pixels
,
width
,
height
,
format
=
"JP4"
,
mosaic
=
[[
"Gr"
,
"R"
],[
"B"
,
"Gb"
]],
lowres
){
// the output image is 1/4 because demosaicing = 4 single color channel pixels are put into 1 rgb pixel
var
oPixels
=
new
Uint8Array
(
pixels
.
length
/
4
);
var
oPixels
=
new
Uint8Array
(
pixels
.
length
/
4
);
// check
// check
...
@@ -640,7 +665,7 @@ var Elphel = {
...
@@ -640,7 +665,7 @@ var Elphel = {
/**
/**
* Name: l2g
* Name: l2g
* Desc
tipti
n: convert a value from linear to gamma encoded,
* Desc
riptio
n: convert a value from linear to gamma encoded,
* close to square root
* close to square root
*/
*/
l2g
:
function
(
pv
){
l2g
:
function
(
pv
){
...
@@ -650,9 +675,9 @@ var Elphel = {
...
@@ -650,9 +675,9 @@ var Elphel = {
return
tmp
;
return
tmp
;
},
},
/*
/*
*
* Name: g2l
* Name: g2l
* Desc
tipti
n: convert a value gamma encoded to linear,
* Desc
riptio
n: convert a value gamma encoded to linear,
* close to square
* close to square
*/
*/
g2l
:
function
(
pv
){
g2l
:
function
(
pv
){
...
...
src/jp4-canvas/jquery-jp4.js
View file @
bf1493f4
...
@@ -67,7 +67,12 @@
...
@@ -67,7 +67,12 @@
var
SATURATION
=
[
0
,
0
,
0
,
0
];
var
SATURATION
=
[
0
,
0
,
0
,
0
];
var
PIXELS
=
[];
var
PIXELS
=
[];
// only valid values are allowed otherwise - disable
if
((
settings
.
lowres
!=
0
)
&&
(
settings
.
lowres
!=
1
)
&&
(
settings
.
lowres
!=
2
)
&&
(
settings
.
lowres
!=
4
)
&&
(
settings
.
lowres
!=
8
)){
settings
.
lowres
=
0
;
}
var
cnv_working
=
$
(
"<canvas>"
,{
id
:
"working"
});
var
cnv_working
=
$
(
"<canvas>"
,{
id
:
"working"
});
var
cnv_display
=
$
(
"<canvas>"
,{
id
:
"display"
});
var
cnv_display
=
$
(
"<canvas>"
,{
id
:
"display"
});
...
...
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