Platforms to show: All Mac Windows Linux Cross-Platform
Back to CVPixelBufferMBS class.
CVPixelBufferMBS.BaseAddressOfPlane(planeIndex as Integer) as Ptr
Function:
Returns the base address of the plane at the specified plane index.
Notes:
planeIndex: The index of the plane.
Returns the base address of the plane, or NULL for nonplanar pixel buffers.
Retrieving the base address for a pixel buffer requires that the buffer base address be locked by a successful call to LockBaseAddress.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
planeIndex: The index of the plane.
Returns the base address of the plane, or NULL for nonplanar pixel buffers.
Retrieving the base address for a pixel buffer requires that the buffer base address be locked by a successful call to LockBaseAddress.
CVPixelBufferMBS.BytesPerRowOfPlane(planeIndex as Integer) as Integer
Function:
Returns the number of bytes per row for a plane at the specified index in the pixel buffer.
Notes:
planeIndex: The index of the plane whose bytes-per-row value you want to obtain.
Returns the number of row bytes of the plane, or nil for nonplanar pixel buffers.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
planeIndex: The index of the plane whose bytes-per-row value you want to obtain.
Returns the number of row bytes of the plane, or nil for nonplanar pixel buffers.
CVPixelBufferMBS.CIImage as Variant
Function:
Creates CIImageMBS object for given pixel buffer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 19.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CVPixelBufferMBS.Constructor(pic as picture)
Function:
Creates a pixel buffer for a picture.
Example:
Notes:
Only for Cocoa target.
This function takes the existing picture and creates a pixelbuffer referencing it. Also we setup the CGContext object and stores it in Context property. Also picture property is set to the current picture.
Implemented for iOS in version 22.3 of MBS Plugin.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Example:
// Let's test the class:
// get a picture
Dim p As Picture = LogoMBS(500)
// load into CVPixelBufferMBS
Dim c As New CVPixelBufferMBS(p)
// ask back as JPEG
Dim JPEGData As MemoryBlock = c.JPEG(0.8)
// show it
ImageViewer1.Image = Picture.FromData(JPEGData)
Only for Cocoa target.
This function takes the existing picture and creates a pixelbuffer referencing it. Also we setup the CGContext object and stores it in Context property. Also picture property is set to the current picture.
Implemented for iOS in version 22.3 of MBS Plugin.
See also:
- Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as String, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as String, pixelBufferAttributes as Dictionary)
CVPixelBufferMBS.Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
Function:
Creates a pixel buffer for a given size and pixel format containing data specified by a memory location.
Notes:
width: The width of the pixel buffer, in pixels.
height: The height of the pixel buffer, in pixels.
pixelFormatType: The pixel format identified by its respective four character code
baseAddress: The memoryblock referenced by the PixelBuffer with the data.
bytesPerRow: The row bytes of the pixel storage memory.
pixelBufferAttributes: A Core Foundation dictionary with additional attributes for a pixel buffer. This parameter is optional.
Returns a Core Video result code. See Core Video Constants for possible values.
Some of the parameters specified in this call override equivalent pixel buffer attributes. For example, if you define the kCVPixelBufferWidth and kCVPixelBufferHeight keys in the pixel buffer attributes parameter (pixelBufferAttributes), these values are overridden by the width and height parameters.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 19.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
width: The width of the pixel buffer, in pixels.
height: The height of the pixel buffer, in pixels.
pixelFormatType: The pixel format identified by its respective four character code
baseAddress: The memoryblock referenced by the PixelBuffer with the data.
bytesPerRow: The row bytes of the pixel storage memory.
pixelBufferAttributes: A Core Foundation dictionary with additional attributes for a pixel buffer. This parameter is optional.
Returns a Core Video result code. See Core Video Constants for possible values.
Some of the parameters specified in this call override equivalent pixel buffer attributes. For example, if you define the kCVPixelBufferWidth and kCVPixelBufferHeight keys in the pixel buffer attributes parameter (pixelBufferAttributes), these values are overridden by the width and height parameters.
See also:
- Constructor(pic as picture)
- Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as String, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as String, pixelBufferAttributes as Dictionary)
CVPixelBufferMBS.Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, pixelBufferAttributes as Dictionary)
Function:
Creates a single pixel buffer for a given size and pixel format.
Notes:
width: Width of the pixel buffer, in pixels.
height: Height of the pixel buffer, in pixels.
pixelFormatType: The pixel format identified by its respective four-character code.
pixelBufferAttributes: A dictionary with additional attributes for a pixel buffer. This parameter is optional.
Raises exception on failure with error code included.
This function allocates the necessary memory based on the pixel dimensions, format, and extended pixels described in the pixel buffer’s attributes.
Some of the parameters specified in this call override equivalent pixel buffer attributes. For example, if you define the kCVPixelBufferWidth and kCVPixelBufferHeight keys in the pixel buffer attributes parameter (pixelBufferAttributes), these values are overridden by the width and height parameters.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 19.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
width: Width of the pixel buffer, in pixels.
height: Height of the pixel buffer, in pixels.
pixelFormatType: The pixel format identified by its respective four-character code.
pixelBufferAttributes: A dictionary with additional attributes for a pixel buffer. This parameter is optional.
Raises exception on failure with error code included.
This function allocates the necessary memory based on the pixel dimensions, format, and extended pixels described in the pixel buffer’s attributes.
Some of the parameters specified in this call override equivalent pixel buffer attributes. For example, if you define the kCVPixelBufferWidth and kCVPixelBufferHeight keys in the pixel buffer attributes parameter (pixelBufferAttributes), these values are overridden by the width and height parameters.
See also:
- Constructor(pic as picture)
- Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as String, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as String, pixelBufferAttributes as Dictionary)
CVPixelBufferMBS.Constructor(Width as Integer, Height as Integer, PixelFormat as String, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
Function:
Creates a pixel buffer for a given size and pixel format containing data specified by a memory location.
Notes:
width: The width of the pixel buffer, in pixels.
height: The height of the pixel buffer, in pixels.
pixelFormatType: The pixel format identified by its respective four character code
baseAddress: The memoryblock referenced by the PixelBuffer with the data.
bytesPerRow: The row bytes of the pixel storage memory.
pixelBufferAttributes: A Core Foundation dictionary with additional attributes for a pixel buffer. This parameter is optional.
Returns a Core Video result code. See Core Video Constants for possible values.
Some of the parameters specified in this call override equivalent pixel buffer attributes. For example, if you define the kCVPixelBufferWidth and kCVPixelBufferHeight keys in the pixel buffer attributes parameter (pixelBufferAttributes), these values are overridden by the width and height parameters.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 19.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
width: The width of the pixel buffer, in pixels.
height: The height of the pixel buffer, in pixels.
pixelFormatType: The pixel format identified by its respective four character code
baseAddress: The memoryblock referenced by the PixelBuffer with the data.
bytesPerRow: The row bytes of the pixel storage memory.
pixelBufferAttributes: A Core Foundation dictionary with additional attributes for a pixel buffer. This parameter is optional.
Returns a Core Video result code. See Core Video Constants for possible values.
Some of the parameters specified in this call override equivalent pixel buffer attributes. For example, if you define the kCVPixelBufferWidth and kCVPixelBufferHeight keys in the pixel buffer attributes parameter (pixelBufferAttributes), these values are overridden by the width and height parameters.
See also:
- Constructor(pic as picture)
- Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as String, pixelBufferAttributes as Dictionary)
CVPixelBufferMBS.Constructor(Width as Integer, Height as Integer, PixelFormat as String, pixelBufferAttributes as Dictionary)
Function:
Creates a single pixel buffer for a given size and pixel format.
Notes:
width: Width of the pixel buffer, in pixels.
height: Height of the pixel buffer, in pixels.
pixelFormatType: The pixel format identified by its respective four-character code.
pixelBufferAttributes: A dictionary with additional attributes for a pixel buffer. This parameter is optional.
Raises exception on failure with error code included.
This function allocates the necessary memory based on the pixel dimensions, format, and extended pixels described in the pixel buffer’s attributes.
Some of the parameters specified in this call override equivalent pixel buffer attributes. For example, if you define the kCVPixelBufferWidth and kCVPixelBufferHeight keys in the pixel buffer attributes parameter (pixelBufferAttributes), these values are overridden by the width and height parameters.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 19.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
width: Width of the pixel buffer, in pixels.
height: Height of the pixel buffer, in pixels.
pixelFormatType: The pixel format identified by its respective four-character code.
pixelBufferAttributes: A dictionary with additional attributes for a pixel buffer. This parameter is optional.
Raises exception on failure with error code included.
This function allocates the necessary memory based on the pixel dimensions, format, and extended pixels described in the pixel buffer’s attributes.
Some of the parameters specified in this call override equivalent pixel buffer attributes. For example, if you define the kCVPixelBufferWidth and kCVPixelBufferHeight keys in the pixel buffer attributes parameter (pixelBufferAttributes), these values are overridden by the width and height parameters.
See also:
- Constructor(pic as picture)
- Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, pixelBufferAttributes as Dictionary)
- Constructor(Width as Integer, Height as Integer, PixelFormat as String, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)
CVPixelBufferMBS.FillExtendedPixels
Function:
Fills the extended pixels of the pixel buffer.
Notes: This function replicates edge pixels to fill the entire extended region of the image.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: This function replicates edge pixels to fill the entire extended region of the image.
CVPixelBufferMBS.Flush
Function:
Flushes output to the image buffer.
Notes: Anything not yet drawn is drawn now.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: Anything not yet drawn is drawn now.
CVPixelBufferMBS.GetExtendedPixels(byref extraColumnsOnLeft as Integer, byref extraColumnsOnRight as Integer, byref extraRowsOnTop as Integer, byref extraRowsOnBottom as Integer)
Function:
Returns the amount of extended pixel padding in the pixel buffer.
Notes:
extraColumnsOnLeft: On output, the pixel row padding to the left.
extraColumnsOnRight: On output, the pixel row padding to the right.
extraRowsOnTop: On output, the pixel row padding to the top.
extraRowsOnBottom: On output, the pixel row padding to the bottom.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
extraColumnsOnLeft: On output, the pixel row padding to the left.
extraColumnsOnRight: On output, the pixel row padding to the right.
extraRowsOnTop: On output, the pixel row padding to the top.
extraRowsOnBottom: On output, the pixel row padding to the bottom.
CVPixelBufferMBS.HeightOfPlane(planeIndex as Integer) as Integer
Function:
Returns the height of the plane at planeIndex in the pixel buffer.
Notes:
planeIndex: The index of the plane.
Returns the height of the buffer, in pixels, or 0 for nonplanar pixel buffers.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
planeIndex: The index of the plane.
Returns the height of the buffer, in pixels, or 0 for nonplanar pixel buffers.
CVPixelBufferMBS.LockBaseAddress(flags as Integer = 0)
Function:
Locks the base address of the pixel buffer.
Notes: lockFlags: You can pass zero or kLockReadonly.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes: lockFlags: You can pass zero or kLockReadonly.
CVPixelBufferMBS.PixelData as MemoryBlock
Function:
Copies pixel data into MemoryBlock.
Notes:
Returns nil in case of error.
Works only on non planar pixel buffers.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 19.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
Returns nil in case of error.
Works only on non planar pixel buffers.
CVPixelBufferMBS.SetPixelData(data as MemoryBlock) as Boolean
Function:
Copies pixel data from MemoryBlock into pixel buffer.
Notes:
Returns false in case of error and true for success.
Works only on non planar pixel buffers.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 19.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
Returns false in case of error and true for success.
Works only on non planar pixel buffers.
CVPixelBufferMBS.UnlockBaseAddress(flags as Integer = 0)
Function:
Unlocks the base address of the pixel buffer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CVPixelBufferMBS.WidthOfPlane(planeIndex as Integer) as Integer
Function:
Returns the width of the plane at a given index in the pixel buffer.
Notes:
pixelBuffer: The pixel buffer whose plane width you want to obtain.
planeIndex: The plane index that contains the plane's width value.
Returns the width of the plane, in pixels, or 0 for nonplanar pixel buffers.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
pixelBuffer: The pixel buffer whose plane width you want to obtain.
planeIndex: The plane index that contains the plane's width value.
Returns the width of the plane, in pixels, or 0 for nonplanar pixel buffers.
The items on this page are in the following plugins: MBS AVFoundation Plugin.
