Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
22814f7f
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
22814f7f
编写于
4月 25, 2023
作者:
F
fengzewu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change colorspace
Signed-off-by:
N
fengzewu
<
fengzewu@huawei.com
>
上级
ed6da30f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
174 deletion
+28
-174
multimedia/image/image_js_standard/imageColorspace/src/main/js/test/P3.test.js
...e_js_standard/imageColorspace/src/main/js/test/P3.test.js
+28
-174
未找到文件。
multimedia/image/image_js_standard/imageColorspace/src/main/js/test/P3.test.js
浏览文件 @
22814f7f
...
...
@@ -72,37 +72,7 @@ export default function ImageP3() {
},
};
}
async
function
setColorCallBack
(
done
,
testNum
,
imageSource
,
colorSpaceName
)
{
let
logger
=
Logger
(
testNum
);
logger
.
log
(
"
ImageSource
"
+
(
imageSource
!=
undefined
));
if
(
imageSource
!=
undefined
)
{
let
pixelMap
=
await
imageSource
.
createPixelMap
();
logger
.
log
(
"
PixelMap
"
+
pixelMap
);
var
csm
=
colorSpaceManager
.
create
(
colorSpaceName
);
logger
.
log
(
"
colorSpaceManager.ColorSpace:
"
+
colorSpaceName
);
pixelMap
.
setColorSpace
(
csm
,
async
(
err
)
=>
{
if
(
err
!=
undefined
)
{
expect
(
false
).
assertTrue
();
logger
.
log
(
"
setColorSpace failed
"
+
err
);
done
();
return
;
}
var
csm1
=
await
pixelMap
.
getColorSpace
();
logger
.
log
(
"
getColorSpace
"
+
csm1
);
var
csmn
=
csm1
.
getColorSpaceName
();
logger
.
log
(
"
getColorSpaceName
"
+
csmn
);
expect
(
csmn
==
colorSpaceName
).
assertTrue
();
done
();
});
}
else
{
logger
.
log
(
"
createimageSource fail
"
);
expect
(
false
).
assertTrue
();
done
();
}
}
async
function
setColorPromise
(
done
,
testNum
,
imageSource
,
colorSpaceName
)
{
async
function
setColor
(
done
,
testNum
,
imageSource
,
colorSpaceName
)
{
let
logger
=
Logger
(
testNum
);
try
{
logger
.
log
(
"
ImageSource
"
+
(
imageSource
!=
undefined
));
...
...
@@ -111,8 +81,8 @@ export default function ImageP3() {
logger
.
log
(
"
PixelMap
"
+
pixelMap
);
var
csm
=
colorSpaceManager
.
create
(
colorSpaceName
);
logger
.
log
(
"
colorSpaceManager.ColorSpace:
"
+
colorSpaceName
);
await
pixelMap
.
setColorSpace
(
csm
);
var
csm1
=
await
pixelMap
.
getColorSpace
();
pixelMap
.
setColorSpace
(
csm
);
var
csm1
=
pixelMap
.
getColorSpace
();
logger
.
log
(
"
getColorSpace
"
+
csm1
);
var
csmn
=
csm1
.
getColorSpaceName
();
logger
.
log
(
"
getColorSpaceName
"
+
csmn
);
...
...
@@ -131,8 +101,8 @@ export default function ImageP3() {
}
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETCOLORSPACE_
PROMISE_
0100
* @tc.name : SUB_GRAPHIC_IMAGE_GETCOLORSPACE_
PROMISE_
0100
* @tc.number : SUB_GRAPHIC_IMAGE_GETCOLORSPACE_0100
* @tc.name : SUB_GRAPHIC_IMAGE_GETCOLORSPACE_0100
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.getColorSpace and getColorSpaceName
...
...
@@ -140,13 +110,13 @@ export default function ImageP3() {
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETCOLORSPACE_
PROMISE_
0100
"
,
0
,
async
function
(
done
)
{
let
logger
=
Logger
(
"
SUB_GRAPHIC_IMAGE_GETCOLORSPACE_
PROMISE_
0100
"
);
it
(
"
SUB_GRAPHIC_IMAGE_GETCOLORSPACE_0100
"
,
0
,
async
function
(
done
)
{
let
logger
=
Logger
(
"
SUB_GRAPHIC_IMAGE_GETCOLORSPACE_0100
"
);
try
{
let
imageSource
=
GenPicSource
(
testImg
);
if
(
imageSource
!=
undefined
)
{
let
pixelMap
=
await
imageSource
.
createPixelMap
();
var
csm
=
await
pixelMap
.
getColorSpace
();
var
csm
=
pixelMap
.
getColorSpace
();
logger
.
log
(
"
getColorSpace csm
"
+
csm
);
var
csmn
=
csm
.
getColorSpaceName
();
logger
.
log
(
"
getColorSpaceName
"
+
csmn
);
...
...
@@ -165,38 +135,8 @@ export default function ImageP3() {
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETCOLORSPACE_CALLBACK_0100
* @tc.name : SUB_GRAPHIC_IMAGE_GETCOLORSPACE_CALLBACK_0100
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.getColorSpace and getColorSpaceName
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETCOLORSPACE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
let
logger
=
Logger
(
"
SUB_GRAPHIC_IMAGE_GETCOLORSPACE_CALLBACK_0100
"
);
let
imageSource
=
GenPicSource
(
testImg
);
if
(
imageSource
!=
undefined
)
{
let
pixelMap
=
await
imageSource
.
createPixelMap
();
pixelMap
.
getColorSpace
((
err
,
csm
)
=>
{
if
(
err
!=
undefined
)
{
logger
.
log
(
"
getColorSpace failed
"
+
err
);
expect
(
false
).
assertTrue
();
return
;
}
logger
.
log
(
"
getColorSpace csm
"
+
csm
);
let
csmn
=
csm
.
getColorSpaceName
();
logger
.
log
(
"
getColorSpaceName
"
+
csmn
);
expect
(
csmn
==
COLORSPACENAME
).
assertTrue
();
done
();
});
}
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_PROMISE_0100
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_PROMISE_0100
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0100
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0100
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.setColorSpace
...
...
@@ -205,19 +145,19 @@ export default function ImageP3() {
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_0100
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
0100
"
,
0
,
function
(
done
)
{
let
imageSource
=
image
.
createImageSource
(
testP3
.
buffer
);
setColor
Promise
(
setColor
(
done
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0100
"
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0100
"
,
imageSource
,
colorSpaceManager
.
ColorSpace
.
SRGB
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0200
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0200
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0200
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0200
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.setColorSpace
...
...
@@ -226,19 +166,19 @@ export default function ImageP3() {
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_0200
"
,
1
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
0200
"
,
1
,
function
(
done
)
{
let
imageSource
=
image
.
createImageSource
(
testImg
.
buffer
);
setColor
Promise
(
setColor
(
done
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0200
"
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0200
"
,
imageSource
,
colorSpaceManager
.
ColorSpace
.
DISPLAY_P3
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0300
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0300
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0300
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0300
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.setColorSpace
...
...
@@ -247,20 +187,20 @@ export default function ImageP3() {
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0300
"
,
1
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0300
"
,
1
,
async
function
(
done
)
{
await
getFd
(
"
colorspace.jpg
"
);
let
imageSource
=
image
.
createImageSource
(
fdNumber
);
setColor
Promise
(
setColor
(
done
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0300
"
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0300
"
,
imageSource
,
colorSpaceManager
.
ColorSpace
.
DISPLAY_P3
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0400
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0400
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0400
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0400
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.setColorSpace
...
...
@@ -269,101 +209,15 @@ export default function ImageP3() {
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0400
"
,
1
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0400
"
,
1
,
async
function
(
done
)
{
await
getFd
(
"
DisplayP3.png
"
);
let
imageSource
=
image
.
createImageSource
(
fdNumber
);
setColor
Promise
(
setColor
(
done
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_
PROMISE_
0400
"
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_0400
"
,
imageSource
,
colorSpaceManager
.
ColorSpace
.
SRGB
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0100
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0100
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.setColorSpace
* 4.getColorSpace and getColorSpaceName
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
let
imageSource
=
image
.
createImageSource
(
testImg
.
buffer
);
setColorCallBack
(
done
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0100
"
,
imageSource
,
colorSpaceManager
.
ColorSpace
.
DISPLAY_P3
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0200
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0200
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.setColorSpace
* 4.getColorSpace and getColorSpaceName
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0200
"
,
1
,
async
function
(
done
)
{
let
imageSource
=
image
.
createImageSource
(
testP3
.
buffer
);
setColorCallBack
(
done
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0200
"
,
imageSource
,
colorSpaceManager
.
ColorSpace
.
SRGB
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0300
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0300
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.setColorSpace
* 4.getColorSpace and getColorSpaceName
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0300
"
,
1
,
async
function
(
done
)
{
await
getFd
(
"
DisplayP3.png
"
);
let
imageSource
=
image
.
createImageSource
(
fdNumber
);
setColorCallBack
(
done
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0300
"
,
imageSource
,
colorSpaceManager
.
ColorSpace
.
SRGB
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0400
* @tc.name : SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0400
* @tc.desc : 1.create imagesource
* 2.createPixelMap
* 3.setColorSpace
* 4.getColorSpace and getColorSpaceName
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0400
"
,
1
,
async
function
(
done
)
{
await
getFd
(
"
colorspace.jpg
"
);
let
imageSource
=
image
.
createImageSource
(
fdNumber
);
setColorCallBack
(
done
,
"
SUB_GRAPHIC_IMAGE_SETCOLORSPACE_CALLBACK_0400
"
,
imageSource
,
colorSpaceManager
.
ColorSpace
.
DISPLAY_P3
);
});
});
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录