CVTextureCache.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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* CreateBGRA32TextureFromCVTextureCache(void* cache, void* image, size_t w, size_t h);
  11. void* CreateHalfFloatTextureFromCVTextureCache(void* cache, void* image, size_t w, size_t h);
  12. // texture = CVOpenGLESTextureRef
  13. unsigned GetGLTextureFromCVTextureCache(void* texture);
  14. // texture = CVMetalTextureRef
  15. MTLTextureRef GetMetalTextureFromCVTextureCache(void* texture);
  16. // texture = CVOpenGLESTextureRef/CVMetalTextureRef
  17. uintptr_t GetTextureFromCVTextureCache(void* texture);
  18. // returns CVPixelBufferRef
  19. // enforces kCVPixelFormatType_32BGRA
  20. void* CreatePixelBufferForCVTextureCache(size_t w, size_t h);
  21. // returns CVOpenGLESTextureRef
  22. // cache = CVOpenGLESTextureCacheRef
  23. // pb = CVPixelBufferRef (out)
  24. // enforces rgba texture with bgra backing
  25. void* CreateReadableRTFromCVTextureCache(void* cache, size_t w, size_t h, void** pb);
  26. // texture = CVOpenGLESTextureRef/CVMetalTextureRef
  27. int IsCVTextureFlipped(void* texture);