Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/3rdparty/carotene/src/remap.hpp
16337 views
1
/*
2
* By downloading, copying, installing or using the software you agree to this license.
3
* If you do not agree to this license, do not download, install,
4
* copy or use the software.
5
*
6
*
7
* License Agreement
8
* For Open Source Computer Vision Library
9
* (3-clause BSD License)
10
*
11
* Copyright (C) 2015, NVIDIA Corporation, all rights reserved.
12
* Third party copyrights are property of their respective owners.
13
*
14
* Redistribution and use in source and binary forms, with or without modification,
15
* are permitted provided that the following conditions are met:
16
*
17
* * Redistributions of source code must retain the above copyright notice,
18
* this list of conditions and the following disclaimer.
19
*
20
* * Redistributions in binary form must reproduce the above copyright notice,
21
* this list of conditions and the following disclaimer in the documentation
22
* and/or other materials provided with the distribution.
23
*
24
* * Neither the names of the copyright holders nor the names of the contributors
25
* may be used to endorse or promote products derived from this software
26
* without specific prior written permission.
27
*
28
* This software is provided by the copyright holders and contributors "as is" and
29
* any express or implied warranties, including, but not limited to, the implied
30
* warranties of merchantability and fitness for a particular purpose are disclaimed.
31
* In no event shall copyright holders or contributors be liable for any direct,
32
* indirect, incidental, special, exemplary, or consequential damages
33
* (including, but not limited to, procurement of substitute goods or services;
34
* loss of use, data, or profits; or business interruption) however caused
35
* and on any theory of liability, whether in contract, strict liability,
36
* or tort (including negligence or otherwise) arising in any way out of
37
* the use of this software, even if advised of the possibility of such damage.
38
*/
39
40
#ifndef CAROTENE_SRC_REMAP_HPP
41
#define CAROTENE_SRC_REMAP_HPP
42
43
#include "common.hpp"
44
45
#include <cmath>
46
47
#ifdef CAROTENE_NEON
48
49
namespace CAROTENE_NS { namespace internal {
50
51
enum
52
{
53
BLOCK_SIZE = 32
54
};
55
56
57
void remapNearestNeighborReplicate(const Size2D size,
58
const u8 * srcBase,
59
const s32 * map,
60
u8 * dstBase, ptrdiff_t dstStride);
61
62
void remapNearestNeighborConst(const Size2D size,
63
const u8 * srcBase,
64
const s32 * map,
65
u8 * dstBase, ptrdiff_t dstStride,
66
u8 borderValue);
67
68
void remapLinearReplicate(const Size2D size,
69
const u8 * srcBase,
70
const s32 * map,
71
const f32 * coeffs,
72
u8 * dstBase, ptrdiff_t dstStride);
73
74
void remapLinearConst(const Size2D size,
75
const u8 * srcBase,
76
const s32 * map,
77
const f32 * coeffs,
78
u8 * dstBase, ptrdiff_t dstStride,
79
u8 borderValue);
80
81
} }
82
83
#endif // CAROTENE_NEON
84
85
#endif // CAROTENE_SRC_REMAP_HPP
86
87