Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_Image_GL_Cuda / INC / gpu / GLImages_GPU.h
1 #ifndef GLIMAGES_GPU_H
2 #define GLIMAGES_GPU_H
3
4 #include "envGLImageCudas.h"
5 #include "CudaInteropTools.h"
6 #include "GLImages_A.h"
7 #include "ImageMOOs_A_GPU.h"
8
9 /*----------------------------------------------------------------------*\
10 |* Declaration *|
11 \*---------------------------------------------------------------------*/
12
13 /*--------------------------------------*\
14 |* Public *|
15 \*-------------------------------------*/
16
17 namespace gpu
18 {
19
20 /**
21 * Data plus stocker in Central Memory, mais in GPU memory !
22 */
23 class CBI_GLIMAGE_CUDA GLImages: public GLImages_A
24 {
25 public:
26
27 /*--------------------------------------*\
28 |* Constructor *|
29 \*-------------------------------------*/
30
31 /**
32 * (dx,dy) : Size of the image
33 * (pxFrame,pyFrame) : The position of the upper left corner of the frame in screen space.
34 */
35 GLImages(gpu::ImageMOOs_A* ptrImageCudaMOO, bool isAnimationEnable = true);
36
37 virtual ~GLImages();
38
39 /*--------------------------------------*\
40 |* Methodes *|
41 \*-------------------------------------*/
42
43 public:
44
45 virtual void release(Panel_A &panel);
46
47 protected:
48
49 /**
50 * Override
51 */
52 virtual void createPBO();
53
54 /**
55 * Override
56 */
57 virtual void fillPBO();
58
59 /*--------------------------------------*\
60 |* Get *|
61 \*-------------------------------------*/
62
63 public:
64
65 gpu::ImageMOOs_A* getPtrImageCudaMOO();
66
67 /*--------------------------------------*\
68 |* Set *|
69 \*-------------------------------------*/
70
71 public:
72
73 void setStreamToSynchronize(cudaStream_t streamId);
74
75 /*--------------------------------------*\
76 |* Attributs *|
77 \*-------------------------------------*/
78
79 private:
80
81 //Inputs
82 gpu::ImageMOOs_A* ptrImageCudaMOO;
83
84 //Cuda interop
85 cudaGraphicsResource* cudaRessource;
86 cudaStream_t streamToSynchronize;
87 };
88
89 }
90 #endif
91
92 /*----------------------------------------------------------------------*\
93 |* End *|
94 \*---------------------------------------------------------------------*/
95