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
0b365f6a
Commit
0b365f6a
authored
Feb 08, 2013
by
yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add +-*/ operators to oclMat
parent
db9de43f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
ocl.hpp
modules/ocl/include/opencv2/ocl/ocl.hpp
+11
-0
arithm.cpp
modules/ocl/src/arithm.cpp
+29
-0
matrix_operations.cpp
modules/ocl/src/matrix_operations.cpp
+25
-0
No files found.
modules/ocl/include/opencv2/ocl/ocl.hpp
View file @
0b365f6a
...
...
@@ -219,6 +219,11 @@ namespace cv
oclMat
operator
()(
Range
rowRange
,
Range
colRange
)
const
;
oclMat
operator
()(
const
Rect
&
roi
)
const
;
oclMat
&
operator
+=
(
const
oclMat
&
m
);
oclMat
&
operator
-=
(
const
oclMat
&
m
);
oclMat
&
operator
*=
(
const
oclMat
&
m
);
oclMat
&
operator
/=
(
const
oclMat
&
m
);
//! returns true if the oclMatrix data is continuous
// (i.e. when there are no gaps between successive rows).
// similar to CV_IS_oclMat_CONT(cvoclMat->type)
...
...
@@ -468,6 +473,12 @@ namespace cv
CV_EXPORTS
oclMat
operator
^
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
CV_EXPORTS
void
cvtColor
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
code
,
int
dcn
=
0
);
//! Mathematics operators
CV_EXPORTS
oclMat
operator
+
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
CV_EXPORTS
oclMat
operator
-
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
CV_EXPORTS
oclMat
operator
*
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
CV_EXPORTS
oclMat
operator
/
(
const
oclMat
&
src1
,
const
oclMat
&
src2
);
//////////////////////////////// Filter Engine ////////////////////////////////
/*!
...
...
modules/ocl/src/arithm.cpp
View file @
0b365f6a
...
...
@@ -12,6 +12,7 @@
//
// Copyright (C) 2010-2012, Institute Of Software Chinese Academy Of Science, all rights reserved.
// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.
// Copyright (C) 2010-2012, Multicoreware, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// @Authors
...
...
@@ -2152,6 +2153,34 @@ cv::ocl::oclMat cv::ocl::operator ^ (const oclMat &src1, const oclMat &src2)
return
dst
;
}
cv
::
ocl
::
oclMat
cv
::
ocl
::
operator
+
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMat
dst
;
add
(
src1
,
src2
,
dst
);
return
dst
;
}
cv
::
ocl
::
oclMat
cv
::
ocl
::
operator
-
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMat
dst
;
subtract
(
src1
,
src2
,
dst
);
return
dst
;
}
cv
::
ocl
::
oclMat
cv
::
ocl
::
operator
*
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMat
dst
;
multiply
(
src1
,
src2
,
dst
);
return
dst
;
}
cv
::
ocl
::
oclMat
cv
::
ocl
::
operator
/
(
const
oclMat
&
src1
,
const
oclMat
&
src2
)
{
oclMat
dst
;
divide
(
src1
,
src2
,
dst
);
return
dst
;
}
//////////////////////////////////////////////////////////////////////////////
/////////////////////////////// transpose ////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
...
...
modules/ocl/src/matrix_operations.cpp
View file @
0b365f6a
...
...
@@ -12,10 +12,12 @@
//
// Copyright (C) 2010-2012, Institute Of Software Chinese Academy Of Science, all rights reserved.
// Copyright (C) 2010-2012, Advanced Micro Devices, Inc., all rights reserved.
// Copyright (C) 2010-2012, Multicoreware, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// @Authors
// Niko Li, newlife20080214@gmail.com
// Yao Wang, bitwangyaoyao@gmail.com
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
...
...
@@ -1020,4 +1022,27 @@ void cv::ocl::oclMat::release()
refcount
=
0
;
}
oclMat
&
cv
::
ocl
::
oclMat
::
operator
+=
(
const
oclMat
&
m
)
{
add
(
*
this
,
m
,
*
this
);
return
*
this
;
}
oclMat
&
cv
::
ocl
::
oclMat
::
operator
-=
(
const
oclMat
&
m
)
{
subtract
(
*
this
,
m
,
*
this
);
return
*
this
;
}
oclMat
&
cv
::
ocl
::
oclMat
::
operator
*=
(
const
oclMat
&
m
)
{
multiply
(
*
this
,
m
,
*
this
);
return
*
this
;
}
oclMat
&
cv
::
ocl
::
oclMat
::
operator
/=
(
const
oclMat
&
m
)
{
divide
(
*
this
,
m
,
*
this
);
return
*
this
;
}
#endif
/* !defined (HAVE_OPENCL) */
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