OSDN Git Service

modified: utilsrc/src/Admin/Makefile
[eos/others.git] / utiltools / X86MAC64 / cuda / samples / 7_CUDALibraries / common / UtilNPP / ImagesCPU.h
1 /**
2  * Copyright 1993-2013 NVIDIA Corporation.  All rights reserved.
3  *
4  * Please refer to the NVIDIA end user license agreement (EULA) associated
5  * with this source code for terms and conditions that govern your use of
6  * this software. Any use, reproduction, disclosure, or distribution of
7  * this software and related documentation outside the terms of the EULA
8  * is strictly prohibited.
9  *
10  */
11
12 #ifndef NV_UTIL_NPP_IMAGES_CPU_H
13 #define NV_UTIL_NPP_IMAGES_CPU_H
14
15 #include "ImagePacked.h"
16
17 #include "ImageAllocatorsCPU.h"
18 #include "Exceptions.h"
19
20 #include <npp.h>
21
22
23 namespace npp
24 {
25
26     template<typename D, unsigned int N, class A>
27     class ImageCPU: public npp::ImagePacked<D, N, A>
28     {
29         public:
30
31             ImageCPU()
32             {
33                 ;
34             }
35
36             ImageCPU(unsigned int nWidth, unsigned int nHeight): ImagePacked<D, N, A>(nWidth, nHeight)
37             {
38                 ;
39             }
40
41             explicit
42             ImageCPU(const npp::Image::Size &rSize): ImagePacked<D, N, A>(rSize)
43             {
44                 ;
45             }
46
47             ImageCPU(const ImageCPU<D, N, A> &rImage): Image(rImage)
48             {
49                 ;
50             }
51
52             virtual
53             ~ImageCPU()
54             {
55                 ;
56             }
57
58             ImageCPU &
59             operator= (const ImageCPU<D, N, A> &rImage)
60             {
61                 ImagePacked<D, N, A>::operator= (rImage);
62
63                 return *this;
64             }
65
66             npp::Pixel<D, N> &
67             operator()(unsigned int iX, unsigned int iY)
68             {
69                 return *ImagePacked<D, N, A>::pixels(iX, iY);
70             }
71
72             npp::Pixel<D, N>
73             operator()(unsigned int iX, unsigned int iY)
74             const
75             {
76                 return *ImagePacked<D, N, A>::pixels(iX, iY);
77             }
78
79     };
80
81
82     typedef ImageCPU<Npp8u,  1, npp::ImageAllocatorCPU<Npp8u,      1>  >   ImageCPU_8u_C1;
83     typedef ImageCPU<Npp8u,  2, npp::ImageAllocatorCPU<Npp8u,      2>  >   ImageCPU_8u_C2;
84     typedef ImageCPU<Npp8u,  3, npp::ImageAllocatorCPU<Npp8u,      3>  >   ImageCPU_8u_C3;
85     typedef ImageCPU<Npp8u,  4, npp::ImageAllocatorCPU<Npp8u,      4>  >   ImageCPU_8u_C4;
86
87     typedef ImageCPU<Npp16u, 1, npp::ImageAllocatorCPU<Npp16u,     1>  >   ImageCPU_16u_C1;
88     typedef ImageCPU<Npp16u, 3, npp::ImageAllocatorCPU<Npp16u,     3>  >   ImageCPU_16u_C3;
89     typedef ImageCPU<Npp16u, 4, npp::ImageAllocatorCPU<Npp16u,     4>  >   ImageCPU_16u_C4;
90
91     typedef ImageCPU<Npp16s, 1, npp::ImageAllocatorCPU<Npp16s,     1>  >   ImageCPU_16s_C1;
92     typedef ImageCPU<Npp16s, 3, npp::ImageAllocatorCPU<Npp16s,     3>  >   ImageCPU_16s_C3;
93     typedef ImageCPU<Npp16s, 4, npp::ImageAllocatorCPU<Npp16s,     4>  >   ImageCPU_16s_C4;
94
95     typedef ImageCPU<Npp32s, 1, npp::ImageAllocatorCPU<Npp32s,     1>  >   ImageCPU_32s_C1;
96     typedef ImageCPU<Npp32s, 3, npp::ImageAllocatorCPU<Npp32s,     3>  >   ImageCPU_32s_C3;
97     typedef ImageCPU<Npp32s, 4, npp::ImageAllocatorCPU<Npp32s,     4>  >   ImageCPU_32s_C4;
98
99     typedef ImageCPU<Npp32f, 1, npp::ImageAllocatorCPU<Npp32f,     1>  >   ImageCPU_32f_C1;
100     typedef ImageCPU<Npp32f, 3, npp::ImageAllocatorCPU<Npp32f,     3>  >   ImageCPU_32f_C3;
101     typedef ImageCPU<Npp32f, 4, npp::ImageAllocatorCPU<Npp32f,     4>  >   ImageCPU_32f_C4;
102
103 } // npp namespace
104
105 #endif // NV_IMAGE_IPP_H