CVTextureCache.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. // depending on selected rendering api it will be or GLES or Metal texture cache
  3. // returns CVOpenGLESTextureCacheRef/CVMetalTextureCacheRef
  4. void* CreateCVTextureCache();
  5. // cache = CVOpenGLESTextureCacheRef/CVMetalTextureCacheRef
  6. void FlushCVTextureCache(void* cache);
  7. // returns CVOpenGLESTextureRef/CVMetalTextureRef
  8. // cache = CVOpenGLESTextureCacheRef/CVMetalTextureCacheRef
  9. // image = CVImageBufferRef/CVPixelBufferRef
  10. void* CreateTextureFromCVTextureCache(void* cache, void* image, size_t w, size_t h);
  11. // texture = CVOpenGLESTextureRef
  12. unsigned GetGLTextureFromCVTextureCache(void* texture);
  13. // texture = CVMetalTextureRef
  14. MTLTextureRef GetMetalTextureFromCVTextureCache(void* texture);
  15. // texture = CVOpenGLESTextureRef/CVMetalTextureRef
  16. uintptr_t GetTextureFromCVTextureCache(void* texture);
  17. // returns CVPixelBufferRef
  18. // enforces kCVPixelFormatType_32BGRA
  19. void* CreatePixelBufferForCVTextureCache(size_t w, size_t h);
  20. // returns CVOpenGLESTextureRef
  21. // cache = CVOpenGLESTextureCacheRef
  22. // pb = CVPixelBufferRef (out)
  23. // enforces rgba texture with bgra backing
  24. void* CreateReadableRTFromCVTextureCache(void* cache, size_t w, size_t h, void** pb);
  25. // texture = CVOpenGLESTextureRef/CVMetalTextureRef
  26. int IsCVTextureFlipped(void* texture);