Caffe2 - C++ API
A deep learning, cross platform ML framework
GLImageAllocator.h
1 
2 #pragma once
3 
4 #include "GLImage.h"
5 #include "GLPlainTexture.h"
6 
7 template <class T>
9  public:
10  static const GLTexture::Type& type;
11 
12  GLImageAllocator() { gl_log(GL_VERBOSE, "%s\n", __PRETTY_FUNCTION__); }
13 
14  virtual ~GLImageAllocator() { gl_log(GL_VERBOSE, "%s\n", __PRETTY_FUNCTION__); }
15 
16  virtual GLImageVector<T>* newImage(
17  int num_images, int width, int height, int channels, int tile_x, int tile_y, bool is_output);
18 
19  virtual GLImageVector<T>* newImage(
20  int num_images,
21  int width,
22  int height,
23  int channels,
24  int tile_x,
25  int tile_y,
26  std::function<const GLTexture*(const int width, const int height)> textureAllocator);
27 
28  virtual GLImageVector<T>* ShareTexture(const GLuint textureID,
29  int num_images,
30  int width,
31  int height,
32  int channels,
33  int tile_x = 1,
34  int tile_y = 1);
35 
36  static GLImageAllocator<T>* newGLImageAllocator();
37 };