openCV library for Renesas RZ/A
Dependents: RZ_A2M_Mbed_samples
include/opencv2/core/cuda.inl.hpp@0:0e0631af0305, 2021-01-29 (annotated)
- Committer:
- RyoheiHagimoto
- Date:
- Fri Jan 29 04:53:38 2021 +0000
- Revision:
- 0:0e0631af0305
copied from https://github.com/d-kato/opencv-lib.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RyoheiHagimoto | 0:0e0631af0305 | 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// |
RyoheiHagimoto | 0:0e0631af0305 | 2 | // |
RyoheiHagimoto | 0:0e0631af0305 | 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. |
RyoheiHagimoto | 0:0e0631af0305 | 4 | // |
RyoheiHagimoto | 0:0e0631af0305 | 5 | // By downloading, copying, installing or using the software you agree to this license. |
RyoheiHagimoto | 0:0e0631af0305 | 6 | // If you do not agree to this license, do not download, install, |
RyoheiHagimoto | 0:0e0631af0305 | 7 | // copy or use the software. |
RyoheiHagimoto | 0:0e0631af0305 | 8 | // |
RyoheiHagimoto | 0:0e0631af0305 | 9 | // |
RyoheiHagimoto | 0:0e0631af0305 | 10 | // License Agreement |
RyoheiHagimoto | 0:0e0631af0305 | 11 | // For Open Source Computer Vision Library |
RyoheiHagimoto | 0:0e0631af0305 | 12 | // |
RyoheiHagimoto | 0:0e0631af0305 | 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. |
RyoheiHagimoto | 0:0e0631af0305 | 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. |
RyoheiHagimoto | 0:0e0631af0305 | 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. |
RyoheiHagimoto | 0:0e0631af0305 | 16 | // Third party copyrights are property of their respective owners. |
RyoheiHagimoto | 0:0e0631af0305 | 17 | // |
RyoheiHagimoto | 0:0e0631af0305 | 18 | // Redistribution and use in source and binary forms, with or without modification, |
RyoheiHagimoto | 0:0e0631af0305 | 19 | // are permitted provided that the following conditions are met: |
RyoheiHagimoto | 0:0e0631af0305 | 20 | // |
RyoheiHagimoto | 0:0e0631af0305 | 21 | // * Redistribution's of source code must retain the above copyright notice, |
RyoheiHagimoto | 0:0e0631af0305 | 22 | // this list of conditions and the following disclaimer. |
RyoheiHagimoto | 0:0e0631af0305 | 23 | // |
RyoheiHagimoto | 0:0e0631af0305 | 24 | // * Redistribution's in binary form must reproduce the above copyright notice, |
RyoheiHagimoto | 0:0e0631af0305 | 25 | // this list of conditions and the following disclaimer in the documentation |
RyoheiHagimoto | 0:0e0631af0305 | 26 | // and/or other materials provided with the distribution. |
RyoheiHagimoto | 0:0e0631af0305 | 27 | // |
RyoheiHagimoto | 0:0e0631af0305 | 28 | // * The name of the copyright holders may not be used to endorse or promote products |
RyoheiHagimoto | 0:0e0631af0305 | 29 | // derived from this software without specific prior written permission. |
RyoheiHagimoto | 0:0e0631af0305 | 30 | // |
RyoheiHagimoto | 0:0e0631af0305 | 31 | // This software is provided by the copyright holders and contributors "as is" and |
RyoheiHagimoto | 0:0e0631af0305 | 32 | // any express or implied warranties, including, but not limited to, the implied |
RyoheiHagimoto | 0:0e0631af0305 | 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. |
RyoheiHagimoto | 0:0e0631af0305 | 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, |
RyoheiHagimoto | 0:0e0631af0305 | 35 | // indirect, incidental, special, exemplary, or consequential damages |
RyoheiHagimoto | 0:0e0631af0305 | 36 | // (including, but not limited to, procurement of substitute goods or services; |
RyoheiHagimoto | 0:0e0631af0305 | 37 | // loss of use, data, or profits; or business interruption) however caused |
RyoheiHagimoto | 0:0e0631af0305 | 38 | // and on any theory of liability, whether in contract, strict liability, |
RyoheiHagimoto | 0:0e0631af0305 | 39 | // or tort (including negligence or otherwise) arising in any way out of |
RyoheiHagimoto | 0:0e0631af0305 | 40 | // the use of this software, even if advised of the possibility of such damage. |
RyoheiHagimoto | 0:0e0631af0305 | 41 | // |
RyoheiHagimoto | 0:0e0631af0305 | 42 | //M*/ |
RyoheiHagimoto | 0:0e0631af0305 | 43 | |
RyoheiHagimoto | 0:0e0631af0305 | 44 | #ifndef OPENCV_CORE_CUDAINL_HPP |
RyoheiHagimoto | 0:0e0631af0305 | 45 | #define OPENCV_CORE_CUDAINL_HPP |
RyoheiHagimoto | 0:0e0631af0305 | 46 | |
RyoheiHagimoto | 0:0e0631af0305 | 47 | #include "opencv2/core/cuda.hpp" |
RyoheiHagimoto | 0:0e0631af0305 | 48 | |
RyoheiHagimoto | 0:0e0631af0305 | 49 | //! @cond IGNORED |
RyoheiHagimoto | 0:0e0631af0305 | 50 | |
RyoheiHagimoto | 0:0e0631af0305 | 51 | namespace cv { namespace cuda { |
RyoheiHagimoto | 0:0e0631af0305 | 52 | |
RyoheiHagimoto | 0:0e0631af0305 | 53 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 54 | // GpuMat |
RyoheiHagimoto | 0:0e0631af0305 | 55 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 56 | |
RyoheiHagimoto | 0:0e0631af0305 | 57 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 58 | GpuMat::GpuMat(Allocator* allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 59 | : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 60 | {} |
RyoheiHagimoto | 0:0e0631af0305 | 61 | |
RyoheiHagimoto | 0:0e0631af0305 | 62 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 63 | GpuMat::GpuMat(int rows_, int cols_, int type_, Allocator* allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 64 | : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 65 | { |
RyoheiHagimoto | 0:0e0631af0305 | 66 | if (rows_ > 0 && cols_ > 0) |
RyoheiHagimoto | 0:0e0631af0305 | 67 | create(rows_, cols_, type_); |
RyoheiHagimoto | 0:0e0631af0305 | 68 | } |
RyoheiHagimoto | 0:0e0631af0305 | 69 | |
RyoheiHagimoto | 0:0e0631af0305 | 70 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 71 | GpuMat::GpuMat(Size size_, int type_, Allocator* allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 72 | : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 73 | { |
RyoheiHagimoto | 0:0e0631af0305 | 74 | if (size_.height > 0 && size_.width > 0) |
RyoheiHagimoto | 0:0e0631af0305 | 75 | create(size_.height, size_.width, type_); |
RyoheiHagimoto | 0:0e0631af0305 | 76 | } |
RyoheiHagimoto | 0:0e0631af0305 | 77 | |
RyoheiHagimoto | 0:0e0631af0305 | 78 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 79 | GpuMat::GpuMat(int rows_, int cols_, int type_, Scalar s_, Allocator* allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 80 | : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 81 | { |
RyoheiHagimoto | 0:0e0631af0305 | 82 | if (rows_ > 0 && cols_ > 0) |
RyoheiHagimoto | 0:0e0631af0305 | 83 | { |
RyoheiHagimoto | 0:0e0631af0305 | 84 | create(rows_, cols_, type_); |
RyoheiHagimoto | 0:0e0631af0305 | 85 | setTo(s_); |
RyoheiHagimoto | 0:0e0631af0305 | 86 | } |
RyoheiHagimoto | 0:0e0631af0305 | 87 | } |
RyoheiHagimoto | 0:0e0631af0305 | 88 | |
RyoheiHagimoto | 0:0e0631af0305 | 89 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 90 | GpuMat::GpuMat(Size size_, int type_, Scalar s_, Allocator* allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 91 | : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 92 | { |
RyoheiHagimoto | 0:0e0631af0305 | 93 | if (size_.height > 0 && size_.width > 0) |
RyoheiHagimoto | 0:0e0631af0305 | 94 | { |
RyoheiHagimoto | 0:0e0631af0305 | 95 | create(size_.height, size_.width, type_); |
RyoheiHagimoto | 0:0e0631af0305 | 96 | setTo(s_); |
RyoheiHagimoto | 0:0e0631af0305 | 97 | } |
RyoheiHagimoto | 0:0e0631af0305 | 98 | } |
RyoheiHagimoto | 0:0e0631af0305 | 99 | |
RyoheiHagimoto | 0:0e0631af0305 | 100 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 101 | GpuMat::GpuMat(const GpuMat& m) |
RyoheiHagimoto | 0:0e0631af0305 | 102 | : flags(m.flags), rows(m.rows), cols(m.cols), step(m.step), data(m.data), refcount(m.refcount), datastart(m.datastart), dataend(m.dataend), allocator(m.allocator) |
RyoheiHagimoto | 0:0e0631af0305 | 103 | { |
RyoheiHagimoto | 0:0e0631af0305 | 104 | if (refcount) |
RyoheiHagimoto | 0:0e0631af0305 | 105 | CV_XADD(refcount, 1); |
RyoheiHagimoto | 0:0e0631af0305 | 106 | } |
RyoheiHagimoto | 0:0e0631af0305 | 107 | |
RyoheiHagimoto | 0:0e0631af0305 | 108 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 109 | GpuMat::GpuMat(InputArray arr, Allocator* allocator_) : |
RyoheiHagimoto | 0:0e0631af0305 | 110 | flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), allocator(allocator_) |
RyoheiHagimoto | 0:0e0631af0305 | 111 | { |
RyoheiHagimoto | 0:0e0631af0305 | 112 | upload(arr); |
RyoheiHagimoto | 0:0e0631af0305 | 113 | } |
RyoheiHagimoto | 0:0e0631af0305 | 114 | |
RyoheiHagimoto | 0:0e0631af0305 | 115 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 116 | GpuMat::~GpuMat() |
RyoheiHagimoto | 0:0e0631af0305 | 117 | { |
RyoheiHagimoto | 0:0e0631af0305 | 118 | release(); |
RyoheiHagimoto | 0:0e0631af0305 | 119 | } |
RyoheiHagimoto | 0:0e0631af0305 | 120 | |
RyoheiHagimoto | 0:0e0631af0305 | 121 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 122 | GpuMat& GpuMat::operator =(const GpuMat& m) |
RyoheiHagimoto | 0:0e0631af0305 | 123 | { |
RyoheiHagimoto | 0:0e0631af0305 | 124 | if (this != &m) |
RyoheiHagimoto | 0:0e0631af0305 | 125 | { |
RyoheiHagimoto | 0:0e0631af0305 | 126 | GpuMat temp(m); |
RyoheiHagimoto | 0:0e0631af0305 | 127 | swap(temp); |
RyoheiHagimoto | 0:0e0631af0305 | 128 | } |
RyoheiHagimoto | 0:0e0631af0305 | 129 | |
RyoheiHagimoto | 0:0e0631af0305 | 130 | return *this; |
RyoheiHagimoto | 0:0e0631af0305 | 131 | } |
RyoheiHagimoto | 0:0e0631af0305 | 132 | |
RyoheiHagimoto | 0:0e0631af0305 | 133 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 134 | void GpuMat::create(Size size_, int type_) |
RyoheiHagimoto | 0:0e0631af0305 | 135 | { |
RyoheiHagimoto | 0:0e0631af0305 | 136 | create(size_.height, size_.width, type_); |
RyoheiHagimoto | 0:0e0631af0305 | 137 | } |
RyoheiHagimoto | 0:0e0631af0305 | 138 | |
RyoheiHagimoto | 0:0e0631af0305 | 139 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 140 | void GpuMat::swap(GpuMat& b) |
RyoheiHagimoto | 0:0e0631af0305 | 141 | { |
RyoheiHagimoto | 0:0e0631af0305 | 142 | std::swap(flags, b.flags); |
RyoheiHagimoto | 0:0e0631af0305 | 143 | std::swap(rows, b.rows); |
RyoheiHagimoto | 0:0e0631af0305 | 144 | std::swap(cols, b.cols); |
RyoheiHagimoto | 0:0e0631af0305 | 145 | std::swap(step, b.step); |
RyoheiHagimoto | 0:0e0631af0305 | 146 | std::swap(data, b.data); |
RyoheiHagimoto | 0:0e0631af0305 | 147 | std::swap(datastart, b.datastart); |
RyoheiHagimoto | 0:0e0631af0305 | 148 | std::swap(dataend, b.dataend); |
RyoheiHagimoto | 0:0e0631af0305 | 149 | std::swap(refcount, b.refcount); |
RyoheiHagimoto | 0:0e0631af0305 | 150 | std::swap(allocator, b.allocator); |
RyoheiHagimoto | 0:0e0631af0305 | 151 | } |
RyoheiHagimoto | 0:0e0631af0305 | 152 | |
RyoheiHagimoto | 0:0e0631af0305 | 153 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 154 | GpuMat GpuMat::clone() const |
RyoheiHagimoto | 0:0e0631af0305 | 155 | { |
RyoheiHagimoto | 0:0e0631af0305 | 156 | GpuMat m; |
RyoheiHagimoto | 0:0e0631af0305 | 157 | copyTo(m); |
RyoheiHagimoto | 0:0e0631af0305 | 158 | return m; |
RyoheiHagimoto | 0:0e0631af0305 | 159 | } |
RyoheiHagimoto | 0:0e0631af0305 | 160 | |
RyoheiHagimoto | 0:0e0631af0305 | 161 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 162 | void GpuMat::copyTo(OutputArray dst, InputArray mask) const |
RyoheiHagimoto | 0:0e0631af0305 | 163 | { |
RyoheiHagimoto | 0:0e0631af0305 | 164 | copyTo(dst, mask, Stream::Null()); |
RyoheiHagimoto | 0:0e0631af0305 | 165 | } |
RyoheiHagimoto | 0:0e0631af0305 | 166 | |
RyoheiHagimoto | 0:0e0631af0305 | 167 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 168 | GpuMat& GpuMat::setTo(Scalar s) |
RyoheiHagimoto | 0:0e0631af0305 | 169 | { |
RyoheiHagimoto | 0:0e0631af0305 | 170 | return setTo(s, Stream::Null()); |
RyoheiHagimoto | 0:0e0631af0305 | 171 | } |
RyoheiHagimoto | 0:0e0631af0305 | 172 | |
RyoheiHagimoto | 0:0e0631af0305 | 173 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 174 | GpuMat& GpuMat::setTo(Scalar s, InputArray mask) |
RyoheiHagimoto | 0:0e0631af0305 | 175 | { |
RyoheiHagimoto | 0:0e0631af0305 | 176 | return setTo(s, mask, Stream::Null()); |
RyoheiHagimoto | 0:0e0631af0305 | 177 | } |
RyoheiHagimoto | 0:0e0631af0305 | 178 | |
RyoheiHagimoto | 0:0e0631af0305 | 179 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 180 | void GpuMat::convertTo(OutputArray dst, int rtype) const |
RyoheiHagimoto | 0:0e0631af0305 | 181 | { |
RyoheiHagimoto | 0:0e0631af0305 | 182 | convertTo(dst, rtype, Stream::Null()); |
RyoheiHagimoto | 0:0e0631af0305 | 183 | } |
RyoheiHagimoto | 0:0e0631af0305 | 184 | |
RyoheiHagimoto | 0:0e0631af0305 | 185 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 186 | void GpuMat::convertTo(OutputArray dst, int rtype, double alpha, double beta) const |
RyoheiHagimoto | 0:0e0631af0305 | 187 | { |
RyoheiHagimoto | 0:0e0631af0305 | 188 | convertTo(dst, rtype, alpha, beta, Stream::Null()); |
RyoheiHagimoto | 0:0e0631af0305 | 189 | } |
RyoheiHagimoto | 0:0e0631af0305 | 190 | |
RyoheiHagimoto | 0:0e0631af0305 | 191 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 192 | void GpuMat::convertTo(OutputArray dst, int rtype, double alpha, Stream& stream) const |
RyoheiHagimoto | 0:0e0631af0305 | 193 | { |
RyoheiHagimoto | 0:0e0631af0305 | 194 | convertTo(dst, rtype, alpha, 0.0, stream); |
RyoheiHagimoto | 0:0e0631af0305 | 195 | } |
RyoheiHagimoto | 0:0e0631af0305 | 196 | |
RyoheiHagimoto | 0:0e0631af0305 | 197 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 198 | void GpuMat::assignTo(GpuMat& m, int _type) const |
RyoheiHagimoto | 0:0e0631af0305 | 199 | { |
RyoheiHagimoto | 0:0e0631af0305 | 200 | if (_type < 0) |
RyoheiHagimoto | 0:0e0631af0305 | 201 | m = *this; |
RyoheiHagimoto | 0:0e0631af0305 | 202 | else |
RyoheiHagimoto | 0:0e0631af0305 | 203 | convertTo(m, _type); |
RyoheiHagimoto | 0:0e0631af0305 | 204 | } |
RyoheiHagimoto | 0:0e0631af0305 | 205 | |
RyoheiHagimoto | 0:0e0631af0305 | 206 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 207 | uchar* GpuMat::ptr(int y) |
RyoheiHagimoto | 0:0e0631af0305 | 208 | { |
RyoheiHagimoto | 0:0e0631af0305 | 209 | CV_DbgAssert( (unsigned)y < (unsigned)rows ); |
RyoheiHagimoto | 0:0e0631af0305 | 210 | return data + step * y; |
RyoheiHagimoto | 0:0e0631af0305 | 211 | } |
RyoheiHagimoto | 0:0e0631af0305 | 212 | |
RyoheiHagimoto | 0:0e0631af0305 | 213 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 214 | const uchar* GpuMat::ptr(int y) const |
RyoheiHagimoto | 0:0e0631af0305 | 215 | { |
RyoheiHagimoto | 0:0e0631af0305 | 216 | CV_DbgAssert( (unsigned)y < (unsigned)rows ); |
RyoheiHagimoto | 0:0e0631af0305 | 217 | return data + step * y; |
RyoheiHagimoto | 0:0e0631af0305 | 218 | } |
RyoheiHagimoto | 0:0e0631af0305 | 219 | |
RyoheiHagimoto | 0:0e0631af0305 | 220 | template<typename _Tp> inline |
RyoheiHagimoto | 0:0e0631af0305 | 221 | _Tp* GpuMat::ptr(int y) |
RyoheiHagimoto | 0:0e0631af0305 | 222 | { |
RyoheiHagimoto | 0:0e0631af0305 | 223 | return (_Tp*)ptr(y); |
RyoheiHagimoto | 0:0e0631af0305 | 224 | } |
RyoheiHagimoto | 0:0e0631af0305 | 225 | |
RyoheiHagimoto | 0:0e0631af0305 | 226 | template<typename _Tp> inline |
RyoheiHagimoto | 0:0e0631af0305 | 227 | const _Tp* GpuMat::ptr(int y) const |
RyoheiHagimoto | 0:0e0631af0305 | 228 | { |
RyoheiHagimoto | 0:0e0631af0305 | 229 | return (const _Tp*)ptr(y); |
RyoheiHagimoto | 0:0e0631af0305 | 230 | } |
RyoheiHagimoto | 0:0e0631af0305 | 231 | |
RyoheiHagimoto | 0:0e0631af0305 | 232 | template <class T> inline |
RyoheiHagimoto | 0:0e0631af0305 | 233 | GpuMat::operator PtrStepSz<T>() const |
RyoheiHagimoto | 0:0e0631af0305 | 234 | { |
RyoheiHagimoto | 0:0e0631af0305 | 235 | return PtrStepSz<T>(rows, cols, (T*)data, step); |
RyoheiHagimoto | 0:0e0631af0305 | 236 | } |
RyoheiHagimoto | 0:0e0631af0305 | 237 | |
RyoheiHagimoto | 0:0e0631af0305 | 238 | template <class T> inline |
RyoheiHagimoto | 0:0e0631af0305 | 239 | GpuMat::operator PtrStep<T>() const |
RyoheiHagimoto | 0:0e0631af0305 | 240 | { |
RyoheiHagimoto | 0:0e0631af0305 | 241 | return PtrStep<T>((T*)data, step); |
RyoheiHagimoto | 0:0e0631af0305 | 242 | } |
RyoheiHagimoto | 0:0e0631af0305 | 243 | |
RyoheiHagimoto | 0:0e0631af0305 | 244 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 245 | GpuMat GpuMat::row(int y) const |
RyoheiHagimoto | 0:0e0631af0305 | 246 | { |
RyoheiHagimoto | 0:0e0631af0305 | 247 | return GpuMat(*this, Range(y, y+1), Range::all()); |
RyoheiHagimoto | 0:0e0631af0305 | 248 | } |
RyoheiHagimoto | 0:0e0631af0305 | 249 | |
RyoheiHagimoto | 0:0e0631af0305 | 250 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 251 | GpuMat GpuMat::col(int x) const |
RyoheiHagimoto | 0:0e0631af0305 | 252 | { |
RyoheiHagimoto | 0:0e0631af0305 | 253 | return GpuMat(*this, Range::all(), Range(x, x+1)); |
RyoheiHagimoto | 0:0e0631af0305 | 254 | } |
RyoheiHagimoto | 0:0e0631af0305 | 255 | |
RyoheiHagimoto | 0:0e0631af0305 | 256 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 257 | GpuMat GpuMat::rowRange(int startrow, int endrow) const |
RyoheiHagimoto | 0:0e0631af0305 | 258 | { |
RyoheiHagimoto | 0:0e0631af0305 | 259 | return GpuMat(*this, Range(startrow, endrow), Range::all()); |
RyoheiHagimoto | 0:0e0631af0305 | 260 | } |
RyoheiHagimoto | 0:0e0631af0305 | 261 | |
RyoheiHagimoto | 0:0e0631af0305 | 262 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 263 | GpuMat GpuMat::rowRange(Range r) const |
RyoheiHagimoto | 0:0e0631af0305 | 264 | { |
RyoheiHagimoto | 0:0e0631af0305 | 265 | return GpuMat(*this, r, Range::all()); |
RyoheiHagimoto | 0:0e0631af0305 | 266 | } |
RyoheiHagimoto | 0:0e0631af0305 | 267 | |
RyoheiHagimoto | 0:0e0631af0305 | 268 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 269 | GpuMat GpuMat::colRange(int startcol, int endcol) const |
RyoheiHagimoto | 0:0e0631af0305 | 270 | { |
RyoheiHagimoto | 0:0e0631af0305 | 271 | return GpuMat(*this, Range::all(), Range(startcol, endcol)); |
RyoheiHagimoto | 0:0e0631af0305 | 272 | } |
RyoheiHagimoto | 0:0e0631af0305 | 273 | |
RyoheiHagimoto | 0:0e0631af0305 | 274 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 275 | GpuMat GpuMat::colRange(Range r) const |
RyoheiHagimoto | 0:0e0631af0305 | 276 | { |
RyoheiHagimoto | 0:0e0631af0305 | 277 | return GpuMat(*this, Range::all(), r); |
RyoheiHagimoto | 0:0e0631af0305 | 278 | } |
RyoheiHagimoto | 0:0e0631af0305 | 279 | |
RyoheiHagimoto | 0:0e0631af0305 | 280 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 281 | GpuMat GpuMat::operator ()(Range rowRange_, Range colRange_) const |
RyoheiHagimoto | 0:0e0631af0305 | 282 | { |
RyoheiHagimoto | 0:0e0631af0305 | 283 | return GpuMat(*this, rowRange_, colRange_); |
RyoheiHagimoto | 0:0e0631af0305 | 284 | } |
RyoheiHagimoto | 0:0e0631af0305 | 285 | |
RyoheiHagimoto | 0:0e0631af0305 | 286 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 287 | GpuMat GpuMat::operator ()(Rect roi) const |
RyoheiHagimoto | 0:0e0631af0305 | 288 | { |
RyoheiHagimoto | 0:0e0631af0305 | 289 | return GpuMat(*this, roi); |
RyoheiHagimoto | 0:0e0631af0305 | 290 | } |
RyoheiHagimoto | 0:0e0631af0305 | 291 | |
RyoheiHagimoto | 0:0e0631af0305 | 292 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 293 | bool GpuMat::isContinuous() const |
RyoheiHagimoto | 0:0e0631af0305 | 294 | { |
RyoheiHagimoto | 0:0e0631af0305 | 295 | return (flags & Mat::CONTINUOUS_FLAG) != 0; |
RyoheiHagimoto | 0:0e0631af0305 | 296 | } |
RyoheiHagimoto | 0:0e0631af0305 | 297 | |
RyoheiHagimoto | 0:0e0631af0305 | 298 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 299 | size_t GpuMat::elemSize() const |
RyoheiHagimoto | 0:0e0631af0305 | 300 | { |
RyoheiHagimoto | 0:0e0631af0305 | 301 | return CV_ELEM_SIZE(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 302 | } |
RyoheiHagimoto | 0:0e0631af0305 | 303 | |
RyoheiHagimoto | 0:0e0631af0305 | 304 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 305 | size_t GpuMat::elemSize1() const |
RyoheiHagimoto | 0:0e0631af0305 | 306 | { |
RyoheiHagimoto | 0:0e0631af0305 | 307 | return CV_ELEM_SIZE1(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 308 | } |
RyoheiHagimoto | 0:0e0631af0305 | 309 | |
RyoheiHagimoto | 0:0e0631af0305 | 310 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 311 | int GpuMat::type() const |
RyoheiHagimoto | 0:0e0631af0305 | 312 | { |
RyoheiHagimoto | 0:0e0631af0305 | 313 | return CV_MAT_TYPE(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 314 | } |
RyoheiHagimoto | 0:0e0631af0305 | 315 | |
RyoheiHagimoto | 0:0e0631af0305 | 316 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 317 | int GpuMat::depth() const |
RyoheiHagimoto | 0:0e0631af0305 | 318 | { |
RyoheiHagimoto | 0:0e0631af0305 | 319 | return CV_MAT_DEPTH(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 320 | } |
RyoheiHagimoto | 0:0e0631af0305 | 321 | |
RyoheiHagimoto | 0:0e0631af0305 | 322 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 323 | int GpuMat::channels() const |
RyoheiHagimoto | 0:0e0631af0305 | 324 | { |
RyoheiHagimoto | 0:0e0631af0305 | 325 | return CV_MAT_CN(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 326 | } |
RyoheiHagimoto | 0:0e0631af0305 | 327 | |
RyoheiHagimoto | 0:0e0631af0305 | 328 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 329 | size_t GpuMat::step1() const |
RyoheiHagimoto | 0:0e0631af0305 | 330 | { |
RyoheiHagimoto | 0:0e0631af0305 | 331 | return step / elemSize1(); |
RyoheiHagimoto | 0:0e0631af0305 | 332 | } |
RyoheiHagimoto | 0:0e0631af0305 | 333 | |
RyoheiHagimoto | 0:0e0631af0305 | 334 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 335 | Size GpuMat::size() const |
RyoheiHagimoto | 0:0e0631af0305 | 336 | { |
RyoheiHagimoto | 0:0e0631af0305 | 337 | return Size(cols, rows); |
RyoheiHagimoto | 0:0e0631af0305 | 338 | } |
RyoheiHagimoto | 0:0e0631af0305 | 339 | |
RyoheiHagimoto | 0:0e0631af0305 | 340 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 341 | bool GpuMat::empty() const |
RyoheiHagimoto | 0:0e0631af0305 | 342 | { |
RyoheiHagimoto | 0:0e0631af0305 | 343 | return data == 0; |
RyoheiHagimoto | 0:0e0631af0305 | 344 | } |
RyoheiHagimoto | 0:0e0631af0305 | 345 | |
RyoheiHagimoto | 0:0e0631af0305 | 346 | static inline |
RyoheiHagimoto | 0:0e0631af0305 | 347 | GpuMat createContinuous(int rows, int cols, int type) |
RyoheiHagimoto | 0:0e0631af0305 | 348 | { |
RyoheiHagimoto | 0:0e0631af0305 | 349 | GpuMat m; |
RyoheiHagimoto | 0:0e0631af0305 | 350 | createContinuous(rows, cols, type, m); |
RyoheiHagimoto | 0:0e0631af0305 | 351 | return m; |
RyoheiHagimoto | 0:0e0631af0305 | 352 | } |
RyoheiHagimoto | 0:0e0631af0305 | 353 | |
RyoheiHagimoto | 0:0e0631af0305 | 354 | static inline |
RyoheiHagimoto | 0:0e0631af0305 | 355 | void createContinuous(Size size, int type, OutputArray arr) |
RyoheiHagimoto | 0:0e0631af0305 | 356 | { |
RyoheiHagimoto | 0:0e0631af0305 | 357 | createContinuous(size.height, size.width, type, arr); |
RyoheiHagimoto | 0:0e0631af0305 | 358 | } |
RyoheiHagimoto | 0:0e0631af0305 | 359 | |
RyoheiHagimoto | 0:0e0631af0305 | 360 | static inline |
RyoheiHagimoto | 0:0e0631af0305 | 361 | GpuMat createContinuous(Size size, int type) |
RyoheiHagimoto | 0:0e0631af0305 | 362 | { |
RyoheiHagimoto | 0:0e0631af0305 | 363 | GpuMat m; |
RyoheiHagimoto | 0:0e0631af0305 | 364 | createContinuous(size, type, m); |
RyoheiHagimoto | 0:0e0631af0305 | 365 | return m; |
RyoheiHagimoto | 0:0e0631af0305 | 366 | } |
RyoheiHagimoto | 0:0e0631af0305 | 367 | |
RyoheiHagimoto | 0:0e0631af0305 | 368 | static inline |
RyoheiHagimoto | 0:0e0631af0305 | 369 | void ensureSizeIsEnough(Size size, int type, OutputArray arr) |
RyoheiHagimoto | 0:0e0631af0305 | 370 | { |
RyoheiHagimoto | 0:0e0631af0305 | 371 | ensureSizeIsEnough(size.height, size.width, type, arr); |
RyoheiHagimoto | 0:0e0631af0305 | 372 | } |
RyoheiHagimoto | 0:0e0631af0305 | 373 | |
RyoheiHagimoto | 0:0e0631af0305 | 374 | static inline |
RyoheiHagimoto | 0:0e0631af0305 | 375 | void swap(GpuMat& a, GpuMat& b) |
RyoheiHagimoto | 0:0e0631af0305 | 376 | { |
RyoheiHagimoto | 0:0e0631af0305 | 377 | a.swap(b); |
RyoheiHagimoto | 0:0e0631af0305 | 378 | } |
RyoheiHagimoto | 0:0e0631af0305 | 379 | |
RyoheiHagimoto | 0:0e0631af0305 | 380 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 381 | // HostMem |
RyoheiHagimoto | 0:0e0631af0305 | 382 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 383 | |
RyoheiHagimoto | 0:0e0631af0305 | 384 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 385 | HostMem::HostMem(AllocType alloc_type_) |
RyoheiHagimoto | 0:0e0631af0305 | 386 | : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_) |
RyoheiHagimoto | 0:0e0631af0305 | 387 | { |
RyoheiHagimoto | 0:0e0631af0305 | 388 | } |
RyoheiHagimoto | 0:0e0631af0305 | 389 | |
RyoheiHagimoto | 0:0e0631af0305 | 390 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 391 | HostMem::HostMem(const HostMem& m) |
RyoheiHagimoto | 0:0e0631af0305 | 392 | : flags(m.flags), rows(m.rows), cols(m.cols), step(m.step), data(m.data), refcount(m.refcount), datastart(m.datastart), dataend(m.dataend), alloc_type(m.alloc_type) |
RyoheiHagimoto | 0:0e0631af0305 | 393 | { |
RyoheiHagimoto | 0:0e0631af0305 | 394 | if( refcount ) |
RyoheiHagimoto | 0:0e0631af0305 | 395 | CV_XADD(refcount, 1); |
RyoheiHagimoto | 0:0e0631af0305 | 396 | } |
RyoheiHagimoto | 0:0e0631af0305 | 397 | |
RyoheiHagimoto | 0:0e0631af0305 | 398 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 399 | HostMem::HostMem(int rows_, int cols_, int type_, AllocType alloc_type_) |
RyoheiHagimoto | 0:0e0631af0305 | 400 | : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_) |
RyoheiHagimoto | 0:0e0631af0305 | 401 | { |
RyoheiHagimoto | 0:0e0631af0305 | 402 | if (rows_ > 0 && cols_ > 0) |
RyoheiHagimoto | 0:0e0631af0305 | 403 | create(rows_, cols_, type_); |
RyoheiHagimoto | 0:0e0631af0305 | 404 | } |
RyoheiHagimoto | 0:0e0631af0305 | 405 | |
RyoheiHagimoto | 0:0e0631af0305 | 406 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 407 | HostMem::HostMem(Size size_, int type_, AllocType alloc_type_) |
RyoheiHagimoto | 0:0e0631af0305 | 408 | : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_) |
RyoheiHagimoto | 0:0e0631af0305 | 409 | { |
RyoheiHagimoto | 0:0e0631af0305 | 410 | if (size_.height > 0 && size_.width > 0) |
RyoheiHagimoto | 0:0e0631af0305 | 411 | create(size_.height, size_.width, type_); |
RyoheiHagimoto | 0:0e0631af0305 | 412 | } |
RyoheiHagimoto | 0:0e0631af0305 | 413 | |
RyoheiHagimoto | 0:0e0631af0305 | 414 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 415 | HostMem::HostMem(InputArray arr, AllocType alloc_type_) |
RyoheiHagimoto | 0:0e0631af0305 | 416 | : flags(0), rows(0), cols(0), step(0), data(0), refcount(0), datastart(0), dataend(0), alloc_type(alloc_type_) |
RyoheiHagimoto | 0:0e0631af0305 | 417 | { |
RyoheiHagimoto | 0:0e0631af0305 | 418 | arr.getMat().copyTo(*this); |
RyoheiHagimoto | 0:0e0631af0305 | 419 | } |
RyoheiHagimoto | 0:0e0631af0305 | 420 | |
RyoheiHagimoto | 0:0e0631af0305 | 421 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 422 | HostMem::~HostMem() |
RyoheiHagimoto | 0:0e0631af0305 | 423 | { |
RyoheiHagimoto | 0:0e0631af0305 | 424 | release(); |
RyoheiHagimoto | 0:0e0631af0305 | 425 | } |
RyoheiHagimoto | 0:0e0631af0305 | 426 | |
RyoheiHagimoto | 0:0e0631af0305 | 427 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 428 | HostMem& HostMem::operator =(const HostMem& m) |
RyoheiHagimoto | 0:0e0631af0305 | 429 | { |
RyoheiHagimoto | 0:0e0631af0305 | 430 | if (this != &m) |
RyoheiHagimoto | 0:0e0631af0305 | 431 | { |
RyoheiHagimoto | 0:0e0631af0305 | 432 | HostMem temp(m); |
RyoheiHagimoto | 0:0e0631af0305 | 433 | swap(temp); |
RyoheiHagimoto | 0:0e0631af0305 | 434 | } |
RyoheiHagimoto | 0:0e0631af0305 | 435 | |
RyoheiHagimoto | 0:0e0631af0305 | 436 | return *this; |
RyoheiHagimoto | 0:0e0631af0305 | 437 | } |
RyoheiHagimoto | 0:0e0631af0305 | 438 | |
RyoheiHagimoto | 0:0e0631af0305 | 439 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 440 | void HostMem::swap(HostMem& b) |
RyoheiHagimoto | 0:0e0631af0305 | 441 | { |
RyoheiHagimoto | 0:0e0631af0305 | 442 | std::swap(flags, b.flags); |
RyoheiHagimoto | 0:0e0631af0305 | 443 | std::swap(rows, b.rows); |
RyoheiHagimoto | 0:0e0631af0305 | 444 | std::swap(cols, b.cols); |
RyoheiHagimoto | 0:0e0631af0305 | 445 | std::swap(step, b.step); |
RyoheiHagimoto | 0:0e0631af0305 | 446 | std::swap(data, b.data); |
RyoheiHagimoto | 0:0e0631af0305 | 447 | std::swap(datastart, b.datastart); |
RyoheiHagimoto | 0:0e0631af0305 | 448 | std::swap(dataend, b.dataend); |
RyoheiHagimoto | 0:0e0631af0305 | 449 | std::swap(refcount, b.refcount); |
RyoheiHagimoto | 0:0e0631af0305 | 450 | std::swap(alloc_type, b.alloc_type); |
RyoheiHagimoto | 0:0e0631af0305 | 451 | } |
RyoheiHagimoto | 0:0e0631af0305 | 452 | |
RyoheiHagimoto | 0:0e0631af0305 | 453 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 454 | HostMem HostMem::clone() const |
RyoheiHagimoto | 0:0e0631af0305 | 455 | { |
RyoheiHagimoto | 0:0e0631af0305 | 456 | HostMem m(size(), type(), alloc_type); |
RyoheiHagimoto | 0:0e0631af0305 | 457 | createMatHeader().copyTo(m); |
RyoheiHagimoto | 0:0e0631af0305 | 458 | return m; |
RyoheiHagimoto | 0:0e0631af0305 | 459 | } |
RyoheiHagimoto | 0:0e0631af0305 | 460 | |
RyoheiHagimoto | 0:0e0631af0305 | 461 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 462 | void HostMem::create(Size size_, int type_) |
RyoheiHagimoto | 0:0e0631af0305 | 463 | { |
RyoheiHagimoto | 0:0e0631af0305 | 464 | create(size_.height, size_.width, type_); |
RyoheiHagimoto | 0:0e0631af0305 | 465 | } |
RyoheiHagimoto | 0:0e0631af0305 | 466 | |
RyoheiHagimoto | 0:0e0631af0305 | 467 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 468 | Mat HostMem::createMatHeader() const |
RyoheiHagimoto | 0:0e0631af0305 | 469 | { |
RyoheiHagimoto | 0:0e0631af0305 | 470 | return Mat(size(), type(), data, step); |
RyoheiHagimoto | 0:0e0631af0305 | 471 | } |
RyoheiHagimoto | 0:0e0631af0305 | 472 | |
RyoheiHagimoto | 0:0e0631af0305 | 473 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 474 | bool HostMem::isContinuous() const |
RyoheiHagimoto | 0:0e0631af0305 | 475 | { |
RyoheiHagimoto | 0:0e0631af0305 | 476 | return (flags & Mat::CONTINUOUS_FLAG) != 0; |
RyoheiHagimoto | 0:0e0631af0305 | 477 | } |
RyoheiHagimoto | 0:0e0631af0305 | 478 | |
RyoheiHagimoto | 0:0e0631af0305 | 479 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 480 | size_t HostMem::elemSize() const |
RyoheiHagimoto | 0:0e0631af0305 | 481 | { |
RyoheiHagimoto | 0:0e0631af0305 | 482 | return CV_ELEM_SIZE(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 483 | } |
RyoheiHagimoto | 0:0e0631af0305 | 484 | |
RyoheiHagimoto | 0:0e0631af0305 | 485 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 486 | size_t HostMem::elemSize1() const |
RyoheiHagimoto | 0:0e0631af0305 | 487 | { |
RyoheiHagimoto | 0:0e0631af0305 | 488 | return CV_ELEM_SIZE1(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 489 | } |
RyoheiHagimoto | 0:0e0631af0305 | 490 | |
RyoheiHagimoto | 0:0e0631af0305 | 491 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 492 | int HostMem::type() const |
RyoheiHagimoto | 0:0e0631af0305 | 493 | { |
RyoheiHagimoto | 0:0e0631af0305 | 494 | return CV_MAT_TYPE(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 495 | } |
RyoheiHagimoto | 0:0e0631af0305 | 496 | |
RyoheiHagimoto | 0:0e0631af0305 | 497 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 498 | int HostMem::depth() const |
RyoheiHagimoto | 0:0e0631af0305 | 499 | { |
RyoheiHagimoto | 0:0e0631af0305 | 500 | return CV_MAT_DEPTH(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 501 | } |
RyoheiHagimoto | 0:0e0631af0305 | 502 | |
RyoheiHagimoto | 0:0e0631af0305 | 503 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 504 | int HostMem::channels() const |
RyoheiHagimoto | 0:0e0631af0305 | 505 | { |
RyoheiHagimoto | 0:0e0631af0305 | 506 | return CV_MAT_CN(flags); |
RyoheiHagimoto | 0:0e0631af0305 | 507 | } |
RyoheiHagimoto | 0:0e0631af0305 | 508 | |
RyoheiHagimoto | 0:0e0631af0305 | 509 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 510 | size_t HostMem::step1() const |
RyoheiHagimoto | 0:0e0631af0305 | 511 | { |
RyoheiHagimoto | 0:0e0631af0305 | 512 | return step / elemSize1(); |
RyoheiHagimoto | 0:0e0631af0305 | 513 | } |
RyoheiHagimoto | 0:0e0631af0305 | 514 | |
RyoheiHagimoto | 0:0e0631af0305 | 515 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 516 | Size HostMem::size() const |
RyoheiHagimoto | 0:0e0631af0305 | 517 | { |
RyoheiHagimoto | 0:0e0631af0305 | 518 | return Size(cols, rows); |
RyoheiHagimoto | 0:0e0631af0305 | 519 | } |
RyoheiHagimoto | 0:0e0631af0305 | 520 | |
RyoheiHagimoto | 0:0e0631af0305 | 521 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 522 | bool HostMem::empty() const |
RyoheiHagimoto | 0:0e0631af0305 | 523 | { |
RyoheiHagimoto | 0:0e0631af0305 | 524 | return data == 0; |
RyoheiHagimoto | 0:0e0631af0305 | 525 | } |
RyoheiHagimoto | 0:0e0631af0305 | 526 | |
RyoheiHagimoto | 0:0e0631af0305 | 527 | static inline |
RyoheiHagimoto | 0:0e0631af0305 | 528 | void swap(HostMem& a, HostMem& b) |
RyoheiHagimoto | 0:0e0631af0305 | 529 | { |
RyoheiHagimoto | 0:0e0631af0305 | 530 | a.swap(b); |
RyoheiHagimoto | 0:0e0631af0305 | 531 | } |
RyoheiHagimoto | 0:0e0631af0305 | 532 | |
RyoheiHagimoto | 0:0e0631af0305 | 533 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 534 | // Stream |
RyoheiHagimoto | 0:0e0631af0305 | 535 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 536 | |
RyoheiHagimoto | 0:0e0631af0305 | 537 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 538 | Stream::Stream(const Ptr<Impl>& impl) |
RyoheiHagimoto | 0:0e0631af0305 | 539 | : impl_(impl) |
RyoheiHagimoto | 0:0e0631af0305 | 540 | { |
RyoheiHagimoto | 0:0e0631af0305 | 541 | } |
RyoheiHagimoto | 0:0e0631af0305 | 542 | |
RyoheiHagimoto | 0:0e0631af0305 | 543 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 544 | // Event |
RyoheiHagimoto | 0:0e0631af0305 | 545 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 546 | |
RyoheiHagimoto | 0:0e0631af0305 | 547 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 548 | Event::Event(const Ptr<Impl>& impl) |
RyoheiHagimoto | 0:0e0631af0305 | 549 | : impl_(impl) |
RyoheiHagimoto | 0:0e0631af0305 | 550 | { |
RyoheiHagimoto | 0:0e0631af0305 | 551 | } |
RyoheiHagimoto | 0:0e0631af0305 | 552 | |
RyoheiHagimoto | 0:0e0631af0305 | 553 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 554 | // Initialization & Info |
RyoheiHagimoto | 0:0e0631af0305 | 555 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 556 | |
RyoheiHagimoto | 0:0e0631af0305 | 557 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 558 | bool TargetArchs::has(int major, int minor) |
RyoheiHagimoto | 0:0e0631af0305 | 559 | { |
RyoheiHagimoto | 0:0e0631af0305 | 560 | return hasPtx(major, minor) || hasBin(major, minor); |
RyoheiHagimoto | 0:0e0631af0305 | 561 | } |
RyoheiHagimoto | 0:0e0631af0305 | 562 | |
RyoheiHagimoto | 0:0e0631af0305 | 563 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 564 | bool TargetArchs::hasEqualOrGreater(int major, int minor) |
RyoheiHagimoto | 0:0e0631af0305 | 565 | { |
RyoheiHagimoto | 0:0e0631af0305 | 566 | return hasEqualOrGreaterPtx(major, minor) || hasEqualOrGreaterBin(major, minor); |
RyoheiHagimoto | 0:0e0631af0305 | 567 | } |
RyoheiHagimoto | 0:0e0631af0305 | 568 | |
RyoheiHagimoto | 0:0e0631af0305 | 569 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 570 | DeviceInfo::DeviceInfo() |
RyoheiHagimoto | 0:0e0631af0305 | 571 | { |
RyoheiHagimoto | 0:0e0631af0305 | 572 | device_id_ = getDevice(); |
RyoheiHagimoto | 0:0e0631af0305 | 573 | } |
RyoheiHagimoto | 0:0e0631af0305 | 574 | |
RyoheiHagimoto | 0:0e0631af0305 | 575 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 576 | DeviceInfo::DeviceInfo(int device_id) |
RyoheiHagimoto | 0:0e0631af0305 | 577 | { |
RyoheiHagimoto | 0:0e0631af0305 | 578 | CV_Assert( device_id >= 0 && device_id < getCudaEnabledDeviceCount() ); |
RyoheiHagimoto | 0:0e0631af0305 | 579 | device_id_ = device_id; |
RyoheiHagimoto | 0:0e0631af0305 | 580 | } |
RyoheiHagimoto | 0:0e0631af0305 | 581 | |
RyoheiHagimoto | 0:0e0631af0305 | 582 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 583 | int DeviceInfo::deviceID() const |
RyoheiHagimoto | 0:0e0631af0305 | 584 | { |
RyoheiHagimoto | 0:0e0631af0305 | 585 | return device_id_; |
RyoheiHagimoto | 0:0e0631af0305 | 586 | } |
RyoheiHagimoto | 0:0e0631af0305 | 587 | |
RyoheiHagimoto | 0:0e0631af0305 | 588 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 589 | size_t DeviceInfo::freeMemory() const |
RyoheiHagimoto | 0:0e0631af0305 | 590 | { |
RyoheiHagimoto | 0:0e0631af0305 | 591 | size_t _totalMemory = 0, _freeMemory = 0; |
RyoheiHagimoto | 0:0e0631af0305 | 592 | queryMemory(_totalMemory, _freeMemory); |
RyoheiHagimoto | 0:0e0631af0305 | 593 | return _freeMemory; |
RyoheiHagimoto | 0:0e0631af0305 | 594 | } |
RyoheiHagimoto | 0:0e0631af0305 | 595 | |
RyoheiHagimoto | 0:0e0631af0305 | 596 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 597 | size_t DeviceInfo::totalMemory() const |
RyoheiHagimoto | 0:0e0631af0305 | 598 | { |
RyoheiHagimoto | 0:0e0631af0305 | 599 | size_t _totalMemory = 0, _freeMemory = 0; |
RyoheiHagimoto | 0:0e0631af0305 | 600 | queryMemory(_totalMemory, _freeMemory); |
RyoheiHagimoto | 0:0e0631af0305 | 601 | return _totalMemory; |
RyoheiHagimoto | 0:0e0631af0305 | 602 | } |
RyoheiHagimoto | 0:0e0631af0305 | 603 | |
RyoheiHagimoto | 0:0e0631af0305 | 604 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 605 | bool DeviceInfo::supports(FeatureSet feature_set) const |
RyoheiHagimoto | 0:0e0631af0305 | 606 | { |
RyoheiHagimoto | 0:0e0631af0305 | 607 | int version = majorVersion() * 10 + minorVersion(); |
RyoheiHagimoto | 0:0e0631af0305 | 608 | return version >= feature_set; |
RyoheiHagimoto | 0:0e0631af0305 | 609 | } |
RyoheiHagimoto | 0:0e0631af0305 | 610 | |
RyoheiHagimoto | 0:0e0631af0305 | 611 | |
RyoheiHagimoto | 0:0e0631af0305 | 612 | }} // namespace cv { namespace cuda { |
RyoheiHagimoto | 0:0e0631af0305 | 613 | |
RyoheiHagimoto | 0:0e0631af0305 | 614 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 615 | // Mat |
RyoheiHagimoto | 0:0e0631af0305 | 616 | //=================================================================================== |
RyoheiHagimoto | 0:0e0631af0305 | 617 | |
RyoheiHagimoto | 0:0e0631af0305 | 618 | namespace cv { |
RyoheiHagimoto | 0:0e0631af0305 | 619 | |
RyoheiHagimoto | 0:0e0631af0305 | 620 | inline |
RyoheiHagimoto | 0:0e0631af0305 | 621 | Mat::Mat(const cuda::GpuMat& m) |
RyoheiHagimoto | 0:0e0631af0305 | 622 | : flags(0), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), datalimit(0), allocator(0), u(0), size(&rows) |
RyoheiHagimoto | 0:0e0631af0305 | 623 | { |
RyoheiHagimoto | 0:0e0631af0305 | 624 | m.download(*this); |
RyoheiHagimoto | 0:0e0631af0305 | 625 | } |
RyoheiHagimoto | 0:0e0631af0305 | 626 | |
RyoheiHagimoto | 0:0e0631af0305 | 627 | } |
RyoheiHagimoto | 0:0e0631af0305 | 628 | |
RyoheiHagimoto | 0:0e0631af0305 | 629 | //! @endcond |
RyoheiHagimoto | 0:0e0631af0305 | 630 | |
RyoheiHagimoto | 0:0e0631af0305 | 631 | #endif // OPENCV_CORE_CUDAINL_HPP |