PAGSurface Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | PAGSurface.h |
+ FromLayer:
Creates a new PAGSurface from specified CAEAGLLayer. The GPU context will be created internally by PAGSurface.
+ (PAGSurface *)FromLayer:(CAEAGLLayer *)layerDeclared In
PAGSurface.h
+ FromCVPixelBuffer:
Creates a new PAGSurface from specified CVPixelBuffer. The GPU context will be created internally by PAGSurface.
+ (PAGSurface *)FromCVPixelBuffer:(CVPixelBufferRef)pixelBufferDeclared In
PAGSurface.h
+ FromCVPixelBuffer:context:
Creates a new PAGSurface from specified CVPixelBuffer and EAGLContext. Multiple PAGSurfaces with the same context share the same GPU caches. The caches are not destroyed when resetting a PAGPlayer’s surface to another PAGSurface with the same context.
+ (PAGSurface *)FromCVPixelBuffer:(CVPixelBufferRef)pixelBuffer context:(EAGLContext *)eaglContextDeclared In
PAGSurface.h
+ MakeFromGPU:
Deprecated Creates an offscreen PAGSurface of the specified size for pixel reading.
+ (PAGSurface *)MakeFromGPU:(CGSize)sizeDeclared In
PAGSurface.h
+ MakeOffscreen:
Creates an offscreen PAGSurface of the specified size for pixel reading.
+ (PAGSurface *)MakeOffscreen:(CGSize)sizeDeclared In
PAGSurface.h
– updateSize
Update the size of the surface, and reset the internal surface.
- (void)updateSizeDeclared In
PAGSurface.h
– clearAll
Erases all pixels of this surface with transparent color. Returns true if the content has changed.
- (BOOL)clearAllDeclared In
PAGSurface.h
– freeCache
Free the cache created by the surface immediately. Can be called to reduce memory pressure.
- (void)freeCacheDeclared In
PAGSurface.h
– getCVPixelBuffer
Returns the internal CVPixelBuffer object associated with this PAGSurface, returns nil if the PAGSurface is created by [PAGSurface FromLayer], or the app is running in the simulator.
- (CVPixelBufferRef)getCVPixelBufferDeclared In
PAGSurface.h
– makeSnapshot
Returns a CVPixelBuffer object capturing the contents of the PAGSurface. Subsequent rendering of the PAGSurface will not be captured.
- (CVPixelBufferRef)makeSnapshotDeclared In
PAGSurface.h
– copyPixelsTo:rowBytes:
Copies the pixels of the PAGSurface to the specified memory address. The format of the copied pixels is in the BGRA color type with the premultiplied alpha type. Returns false if failed.
- (BOOL)copyPixelsTo:(void *)pixels rowBytes:(size_t)rowBytesDeclared In
PAGSurface.h