Platforms to show: All Mac Windows Linux Cross-Platform

Back to CVPixelBufferMBS class.

CVPixelBufferMBS.BaseAddressOfPlane(planeIndex as Integer) as Ptr

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the base address of the plane at the specified plane index.

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the number of bytes per row for a plane at the specified index in the pixel buffer.

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 19.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates CIImageMBS object for given pixel buffer.

CVPixelBufferMBS.Constructor(pic as picture)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a pixel buffer for a picture.
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:

CVPixelBufferMBS.Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 19.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a pixel buffer for a given size and pixel format containing data specified by a memory location.

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:

CVPixelBufferMBS.Constructor(Width as Integer, Height as Integer, PixelFormat as Integer, pixelBufferAttributes as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 19.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a single pixel buffer for a given size and pixel format.

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:

CVPixelBufferMBS.Constructor(Width as Integer, Height as Integer, PixelFormat as String, data as MemoryBlock, bytesPerRow as Integer, pixelBufferAttributes as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 19.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a pixel buffer for a given size and pixel format containing data specified by a memory location.

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:

CVPixelBufferMBS.Constructor(Width as Integer, Height as Integer, PixelFormat as String, pixelBufferAttributes as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 19.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a single pixel buffer for a given size and pixel format.

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:

CVPixelBufferMBS.FillExtendedPixels

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Fills the extended pixels of the pixel buffer.

This function replicates edge pixels to fill the entire extended region of the image.

CVPixelBufferMBS.Flush

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Flushes output to the image buffer.

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)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the amount of extended pixel padding in the pixel buffer.

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the height of the plane at planeIndex in the pixel buffer.

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)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Locks the base address of the pixel buffer.

lockFlags: You can pass zero or kLockReadonly.

CVPixelBufferMBS.PixelData as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 19.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Copies pixel data into MemoryBlock.

Returns nil in case of error.
Works only on non planar pixel buffers.

CVPixelBufferMBS.SetPixelData(data as MemoryBlock) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 19.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Copies pixel data from MemoryBlock into pixel buffer.

Returns false in case of error and true for success.
Works only on non planar pixel buffers.

CVPixelBufferMBS.UnlockBaseAddress(flags as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Unlocks the base address of the pixel buffer.

CVPixelBufferMBS.WidthOfPlane(planeIndex as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the width of the plane at a given index in the pixel buffer.

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.


The biggest plugin in space...