Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
33ae6420
Commit
33ae6420
authored
Nov 09, 2013
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color.cpp refactoring: created generic interface for toRGB and fromRGB callers
parent
a57030a0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
color.cpp
modules/ocl/src/color.cpp
+0
-0
cvt_color.cl
modules/ocl/src/opencl/cvt_color.cl
+7
-7
test_color.cpp
modules/ocl/test/test_color.cpp
+6
-1
No files found.
modules/ocl/src/color.cpp
View file @
33ae6420
This diff is collapsed.
Click to expand it.
modules/ocl/src/opencl/cvt_color.cl
View file @
33ae6420
...
...
@@ -100,7 +100,7 @@ __kernel void RGB2Gray(int cols, int rows, int src_step, int dst_step,
}
}
__kernel
void
Gray2RGB
(
int
cols,
int
rows,
int
src_step,
int
dst_step,
int
channels,
__kernel
void
Gray2RGB
(
int
cols,
int
rows,
int
src_step,
int
dst_step,
int
channels,
int
bidx,
__global
const
DATA_TYPE*
src,
__global
DATA_TYPE*
dst,
int
src_offset,
int
dst_offset
)
{
...
...
@@ -203,17 +203,17 @@ __constant int ITUR_BT_601_CVG = 852492;
__constant
int
ITUR_BT_601_CVR
=
1673527
;
__constant
int
ITUR_BT_601_SHIFT
=
20
;
__kernel
void
YUV2RGBA_NV12
(
int
cols,
int
rows,int
src_step,int
dst_step
,
int
bidx,
int
width,
int
height,
__global
const
uchar*
src,
__global
uchar*
dst,
__kernel
void
YUV2RGBA_NV12
(
int
cols,
int
rows,
int
src_step,
int
dst_step,
int
channels
,
int
bidx,
__global
const
uchar*
src,
__global
uchar*
dst,
int
src_offset,
int
dst_offset
)
{
const
int
x
=
get_global_id
(
0
)
;
// max_x = width / 2
const
int
y
=
get_global_id
(
1
)
;
// max_y = height/ 2
const
int
x
=
get_global_id
(
0
)
;
const
int
y
=
get_global_id
(
1
)
;
if
(
y
<
height
/
2
&&
x
<
width
/
2
)
if
(
y
<
rows
/
2
&&
x
<
cols
/
2
)
{
__global
const
uchar*
ysrc
=
src
+
mad24
(
y
<<
1
,
src_step,
(
x
<<
1
)
+
src_offset
)
;
__global
const
uchar*
usrc
=
src
+
mad24
(
height
+
y,
src_step,
(
x
<<
1
)
+
src_offset
)
;
__global
const
uchar*
usrc
=
src
+
mad24
(
rows
+
y,
src_step,
(
x
<<
1
)
+
src_offset
)
;
__global
uchar*
dst1
=
dst
+
mad24
(
y
<<
1
,
dst_step,
(
x
<<
3
)
+
dst_offset
)
;
__global
uchar*
dst2
=
dst
+
mad24
((
y
<<
1
)
+
1
,
dst_step,
(
x
<<
3
)
+
dst_offset
)
;
...
...
modules/ocl/test/test_color.cpp
View file @
33ae6420
...
...
@@ -116,6 +116,8 @@ PARAM_TEST_CASE(CvtColor, MatDepth, bool)
#define CVTCODE(name) cv::COLOR_ ## name
// RGB <-> Gray
OCL_TEST_P
(
CvtColor
,
RGB2GRAY
)
{
doTest
(
3
,
1
,
CVTCODE
(
RGB2GRAY
));
...
...
@@ -152,6 +154,7 @@ OCL_TEST_P(CvtColor, GRAY2BGRA)
doTest
(
1
,
4
,
CVTCODE
(
GRAY2BGRA
));
}
// RGB <-> YUV
OCL_TEST_P
(
CvtColor
,
RGB2YUV
)
{
...
...
@@ -186,6 +189,7 @@ OCL_TEST_P(CvtColor, YUV2BGRA)
doTest
(
3
,
4
,
CVTCODE
(
YUV2BGR
));
}
// RGB <-> YCrCb
OCL_TEST_P
(
CvtColor
,
RGB2YCrCb
)
{
...
...
@@ -220,6 +224,8 @@ OCL_TEST_P(CvtColor, YCrCb2BGRA)
doTest
(
3
,
4
,
CVTCODE
(
YCrCb2BGR
));
}
// YUV -> RGBA_NV12
struct
CvtColor_YUV420
:
public
CvtColor
{
...
...
@@ -262,7 +268,6 @@ OCL_TEST_P(CvtColor_YUV420, YUV2BGR_NV12)
doTest
(
1
,
3
,
CV_YUV2BGR_NV12
);
}
INSTANTIATE_TEST_CASE_P
(
OCL_ImgProc
,
CvtColor
,
testing
::
Combine
(
testing
::
Values
(
MatDepth
(
CV_8U
),
MatDepth
(
CV_16U
),
MatDepth
(
CV_32F
)),
...
...
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