Caffe2 - C++ API
A deep learning, cross platform ML framework
IOSGLImageAllocator.h
1 
2 #pragma once
3 
4 #include "../core/GLImageAllocator.h"
5 
6 #import <CoreVideo/CoreVideo.h>
7 
8 template <class T>
10  static const GLTexture::Type& type;
11 
12  std::vector<CVPixelBufferRef> pixelbuffers;
13 
14  public:
15  static const FourCharCode pixelFormat;
16 
17  IOSGLImageAllocator() : GLImageAllocator<T>() { gl_log(GL_VERBOSE, "%s\n", __PRETTY_FUNCTION__); }
18 
20  gl_log(GL_VERBOSE, "%s\n", __PRETTY_FUNCTION__);
21 
22  for (auto&& pixelbuffer : pixelbuffers) {
23  CFRelease(pixelbuffer);
24  }
25  }
26 
27  GLImageVector<T>* newImage(int num_images,
28  int width,
29  int height,
30  int channels,
31  int tile_x,
32  int tile_y,
33  bool useCVPixelBuffer);
34 };