6 #import <Cocoa/Cocoa.h>
7 #import <OpenGL/CGLMacro.h>
8 #import <CoreVideo/CoreVideo.h>
9 #import <IOSurface/IOSurface.h>
21 VVBufferType_DispList,
74 VVBufferBackID_GWorld,
142 GLfloat *auxTransMatrix;
144 struct timeval contentTimestamp;
152 void *backingReleaseCallbackContext;
156 IOSurfaceRef remoteSurfaceRef;
164 + (id) createWithPool:(
id)p;
165 - (id) initWithPool:(
id)p;
170 @property (assign, readwrite) BOOL preferDeletion;
172 @property (readonly) NSSize size;
173 - (void) setSize:(NSSize)n;
175 @property (assign, readwrite) NSRect srcRect;
177 @property (assign, readwrite) BOOL flipped;
179 @property (assign, readwrite) NSSize backingSize;
181 - (struct timeval *) contentTimestampPtr;
183 - (void) getContentTimestamp:(struct timeval *)n;
184 - (void) setContentTimestampFromPtr:(struct timeval *)n;
186 - (void) setUserInfo:(
id)n;
189 - (void) setAuxTransMatrix:(GLfloat *)n;
190 - (GLfloat *) auxTransMatrix;
191 @property (assign, readwrite) GLfloat auxOpacity;
193 @property (readonly) NSRect normalizedSrcRect;
195 @property (readonly) NSRect glReadySrcRect;
202 - (NSRect) srcRectCroppedWith:(NSRect)cropRect takingFlipIntoAccount:(BOOL)f;
204 @property (readonly) BOOL isFullFrame;
206 @property (readonly) GLuint name;
208 @property (readonly) GLuint target;
210 @property (readonly) BOOL safeToPublishToSyphon;
212 - (BOOL) isContentMatchToBuffer:(
VVBuffer *)n;
216 - (CVPixelBufferRef) cvPixBuf;
218 - (CVOpenGLTextureRef) cvTexRef;
220 - (NSBitmapImageRep *) bitmapRep;
221 - (
void *) externalBacking;
223 - (GWorldPtr) gWorld;
228 - (void) setCpuBackingPtr:(
void *)n;
230 - (
void *) cpuBackingPtr;
241 - (void) setBackingReleaseCallbackContext:(
void *)n;
242 - (
void *) backingReleaseCallbackContext;
244 - (IOSurfaceRef) localSurfaceRef;
245 - (void) setLocalSurfaceRef:(IOSurfaceRef)n;
246 - (IOSurfaceRef) remoteSurfaceRef;
247 - (void) setRemoteSurfaceRef:(IOSurfaceRef)n;
249 @property (retain,readwrite)
id copySourceBuffer;
250 @property (assign,readwrite)
int idleCount;
251 - (void) _incrementIdleCount;
259 void VVBuffer_ReleasePixelsCallback(
id b,
void *c);
260 void VVBuffer_ReleaseCVGLT(
id b,
void *c);
261 void VVBuffer_ReleaseCVPixBuf(
id b,
void *c);
262 void VVBuffer_ReleaseBitmapRep(
id b,
void *c);
264 void VVBuffer_ReleaseGWorld(
id b,
void *c);
unsigned long VVBufferDescriptorCalculateCPUBackingForSize(VVBufferDescriptor *b, NSSize s)
Calculates the size (in bytes) that would be required to create a CPU-based backing for a buffer of t...
Definition: VVBuffer.m:91
BOOL VVBufferDescriptorCompareForRecycling(VVBufferDescriptor *a, VVBufferDescriptor *b)
Compares the passed buffers for the purpose of recycling, returns a YES if they are close enough of a...
Definition: VVBuffer.m:61
GLuint msAmount
the number of multisamples (where appropriate- only applies to renderbuffers- 0 by default) ...
Definition: VVBuffer.h:94
depth
Definition: VVBuffer.h:41
float- used for rendering high-precision stuff
Definition: VVBuffer.h:51
the buffer was wholly created by this framework- there's no backing
Definition: VVBuffer.h:73
standard four channel/8 bits per channel/unsigned byte format. fast on os x, (probably most common) ...
Definition: VVBuffer.h:53
VVBufferGPUBack gpuBackingType
the GPU backing type
Definition: VVBuffer.h:90
VVBufferType type
what kind of buffer (what kind of GL resource) this holds
Definition: VVBuffer.h:84
renderbuffer
Definition: VVBuffer.h:16
none/unknown/unused
Definition: VVBuffer.h:50
the GPU-based resource was created outside of this framework, and this buffer should be freed immedia...
Definition: VVBuffer.h:66
three channel, 8 bit per channel
Definition: VVBuffer.h:29
unsigned long localSurfaceID
if 0, the buffer doesn't have an associated IOSurfaceRef; otherwise the surfaceID of the local surfac...
Definition: VVBuffer.h:95
void VVBufferDescriptorPopulateDefault(VVBufferDescriptor *d)
Populates the passed VVBufferDescriptor pointer with default values.
Definition: VVBuffer.m:7
four channel, 32 bit per channel
Definition: VVBuffer.h:33
enum _VVBufferBackID VVBufferBackID
The "VVBufferBackID" is an arbitrary enum that isn't used functionally by this framework. This enum- and VVBuffer's corresponding "backingID" member- exist to help track where a VVBuffer came from (if it was made from pixels, from another object, etc).
single channel, 8 bit per pixel
Definition: VVBuffer.h:26
BGRA. faston os x, (probably most common)
Definition: VVBuffer.h:45
there is no GPU-based resource
Definition: VVBuffer.h:64
the buffer was created from some kind of external pointer passed in from another API (this can be use...
Definition: VVBuffer.h:80
_VVBufferType
These are the different kinds of VVBuffers.
Definition: VVBuffer.h:14
there is no CPU-based backing
Definition: VVBuffer.h:58
void * cpuBackingPtr()
If a VVBuffer was created from a CPU-based resource, this will always return a ptr to the raw pixels ...
Definition: VVBuffer.m:485
two channel/8 bits per channel/unsigned byte format. usually used for YCbCr textures.
Definition: VVBuffer.h:54
id userInfo()
Returns the buffer's "userInfo" (if there is one).
Definition: VVBuffer.m:360
_VVBufferGPUBack
The origin of any GPU-based content.
Definition: VVBuffer.h:63
enum _VVBufferType VVBufferType
These are the different kinds of VVBuffers.
NSSize size
This returns the size of the underlying GL resource. The value returned by this method is always usin...
Definition: VVBuffer.h:138
VVBuffer represents a buffer- almost always in VRAM as a GL texture or renderbuffer- created and mana...
Definition: VVBuffer.h:134
none/unknown/unused
Definition: VVBuffer.h:15
depth- single channel, 24 bit per pixel
Definition: VVBuffer.h:32
the buffer was created from an NSBitmapImageRep
Definition: VVBuffer.h:78
struct _VVBufferDescriptor VVBufferDescriptor
This C struct describes the basic characteristics of a VVBuffer's internal GL properties.
enum _VVBufferPixType VVBufferPixType
This describes the pixel type of the GL resource represented by a VVBuffer.
IOSurfaceRef localSurfaceRef()
If the receiver is a GL texture backed by an IOSurfaceRef, this returns the IOSurfaceRef. If you want to send a texture to another process, you want to call -[VVBufferPool allocBufferForTexBackedIOSurfaceSized:], render into the returned buffer, and then call "localSurfaceRef" to retrieve the IOSurface to be sent to another process.
Definition: VVBuffer.m:488
none/unknown/unused
Definition: VVBuffer.h:25
VVBufferPixType pixelType
the type of data in the pixel format; usually U_Int_8888_Rev
Definition: VVBuffer.h:88
four channel, 8 bit per channel. fast on os x, probably most common)
Definition: VVBuffer.h:31
the buffer was created from a CVOpenGLTextureRef
Definition: VVBuffer.h:77
FBO.
Definition: VVBuffer.h:17
BOOL texClientStorageFlag
if YES, the texture was created with GL_UNPACK_CLIENT_STORAGE_APPLE set to TRUE: this will prevent Op...
Definition: VVBuffer.h:93
GLuint name
the actual name (identifier) of GL resource this holds
Definition: VVBuffer.h:91
packed YCbCr
Definition: VVBuffer.h:46
four channel, 8 bit per channel
Definition: VVBuffer.h:30
NSSize backingSize
If the buffer has some kind of backing, these are its dimensions. Stored here as a different size to ...
Definition: VVBuffer.h:141
BOOL texRangeFlag
if YES, it's a texture range (where appropriate)
Definition: VVBuffer.h:92
enum _VVBufferCPUBack VVBufferCPUBack
The origin of any CPU-based content.
BOOL flipped
Whether or not the image represented by this buffer is flipped vertically. Like "srcRect", it's safe and quick to both set and get this value- changing it does not cause any graphic operatings to occur, the value is only used when you want to do something with this VVBuffer.
Definition: VVBuffer.h:140
RGBA.
Definition: VVBuffer.h:44
buffer backing is CPU-based, and the CPU resource was created by this framework
Definition: VVBuffer.h:59
_VVBufferIntFormat
This desribes the internal format of the GL resource represented by a VVBuffer.
Definition: VVBuffer.h:24
VVBufferIntFormat internalFormat
the format in which the pixel data is stored in opengl; usually RGBA8
Definition: VVBuffer.h:86
single channel, 32 bit float per pixel
Definition: VVBuffer.h:27
luminance
Definition: VVBuffer.h:42
VVBufferPixFormat pixelFormat
the pixel format; usually BGRA
Definition: VVBuffer.h:87
NSRect srcRect
The "srcRect" is the region of the GL resource that contains an image- this value is always measured ...
Definition: VVBuffer.h:139
usually used for depth buffer/luminance/single-channel stuff
Definition: VVBuffer.h:52
enum _VVBufferGPUBack VVBufferGPUBack
The origin of any GPU-based content.
BOOL VVBufferDescriptorCompare(VVBufferDescriptor *a, VVBufferDescriptor *b)
Compares the passed buffers, returns a YES if they are completely identical.
Definition: VVBuffer.m:41
enum _VVBufferIntFormat VVBufferIntFormat
This desribes the internal format of the GL resource represented by a VVBuffer.
single channel, 8 bit per pixel
Definition: VVBuffer.h:28
VVBufferCPUBack cpuBackingType
the CPU backing type
Definition: VVBuffer.h:89
enum _VVBufferPixFormat VVBufferPixFormat
This describes the pixel format of the GL resource represented by a VVBuffer.
void(* VVBufferBackingReleaseCallback)(id VVBufferBeingFreed, void *callbackContext)
This is a function pointer- it gets called when the VVBuffer that owns it is being deallocated and ne...
Definition: VVBuffer.h:120
the buffer was created from a CVPixelBufferRef
Definition: VVBuffer.h:76
the buffer was created from a pointer to pixels which were also allocated by this framework ...
Definition: VVBuffer.h:75
non/unknown/unused
Definition: VVBuffer.h:40
GLuint target
GL_TEXTURE_RECTANGLE_EXT by default, sometimes GL_TEXTURE_2D or GL_RENDERBUFFER_EXT. 0 if not used.
Definition: VVBuffer.h:85
_VVBufferPixType
This describes the pixel type of the GL resource represented by a VVBuffer.
Definition: VVBuffer.h:49
_VVBufferBackID
The "VVBufferBackID" is an arbitrary enum that isn't used functionally by this framework. This enum- and VVBuffer's corresponding "backingID" member- exist to help track where a VVBuffer came from (if it was made from pixels, from another object, etc).
Definition: VVBuffer.h:72
texture (probably most common)
Definition: VVBuffer.h:18
void VVBufferDescriptorCopy(VVBufferDescriptor *src, VVBufferDescriptor *dst)
Copies the contents of the src to dst.
Definition: VVBuffer.m:24
_VVBufferPixFormat
This describes the pixel format of the GL resource represented by a VVBuffer.
Definition: VVBuffer.h:39
buffer backing is CPU-based, and the CPU resource was created outside this framework ...
Definition: VVBuffer.h:60
_VVBufferCPUBack
The origin of any CPU-based content.
Definition: VVBuffer.h:57
Hap.
Definition: VVBuffer.h:34
the GPU-based resource was created by this framework (and should be deleted by this framework) ...
Definition: VVBuffer.h:65
VVBufferBackID backingID
The VVBufferBackID doesn't play a functional role in the processing of VVBuffer- it's an enum that ex...
Definition: VVBuffer.h:147
the buffer was created from an remote IOSurfaceRef (the IOSurface was generated in another process) ...
Definition: VVBuffer.h:79
Hap Alpha.
Definition: VVBuffer.h:35
HapQ. not a typo, same as RGBA_DXT5!
Definition: VVBuffer.h:36
This C struct describes the basic characteristics of a VVBuffer's internal GL properties.
Definition: VVBuffer.h:83
red (same idea as luminance, just seems to be slightly more compatible with stuff) ...
Definition: VVBuffer.h:43