---
title: "IOSurfaceGetBytesPerElementOfPlane(_:_:)"
framework: iosurface
role: symbol
role_heading: Function
path: "iosurface/iosurfacegetbytesperelementofplane(_:_:)"
---

# IOSurfaceGetBytesPerElementOfPlane(_:_:)

Returns the size of each element (in bytes) in the specified plane.

## Declaration

```swift
func IOSurfaceGetBytesPerElementOfPlane(_ buffer: IOSurfaceRef, _ planeIndex: Int) -> Int
```

## Discussion

Discussion If the planeIndex is greater than or equal to the plane count of the IOSurface, zero is returned…. with one exception. If this IOSurface has zero planes and a planeIndex of zero is passed in, the routines function just like the non-planar APIs. This is to allow higher level code to treat planar and non-planar buffers is a more uniform fashion.

## See Also

### Functions

- [IOSurfaceAlignProperty(_:_:)](iosurface/iosurfacealignproperty(_:_:).md)
- [IOSurfaceAllowsPixelSizeCasting(_:)](iosurface/iosurfaceallowspixelsizecasting(_:).md)
- [IOSurfaceCopyAllValues(_:)](iosurface/iosurfacecopyallvalues(_:).md)
- [IOSurfaceCopyValue(_:_:)](iosurface/iosurfacecopyvalue(_:_:).md)
- [IOSurfaceCreate(_:)](iosurface/iosurfacecreate(_:).md)
- [IOSurfaceCreateMachPort(_:)](iosurface/iosurfacecreatemachport(_:).md)
- [IOSurfaceCreateXPCObject(_:)](iosurface/iosurfacecreatexpcobject(_:).md)
- [IOSurfaceDecrementUseCount(_:)](iosurface/iosurfacedecrementusecount(_:).md)
- [IOSurfaceGetAllocSize(_:)](iosurface/iosurfacegetallocsize(_:).md)
- [IOSurfaceGetBaseAddress(_:)](iosurface/iosurfacegetbaseaddress(_:).md)
- [IOSurfaceGetBaseAddressOfPlane(_:_:)](iosurface/iosurfacegetbaseaddressofplane(_:_:).md)
- [IOSurfaceGetBitDepthOfComponentOfPlane(_:_:_:)](iosurface/iosurfacegetbitdepthofcomponentofplane(_:_:_:).md)
- [IOSurfaceGetBitOffsetOfComponentOfPlane(_:_:_:)](iosurface/iosurfacegetbitoffsetofcomponentofplane(_:_:_:).md)
- [IOSurfaceGetBytesPerElement(_:)](iosurface/iosurfacegetbytesperelement(_:).md)
- [IOSurfaceGetBytesPerRow(_:)](iosurface/iosurfacegetbytesperrow(_:).md)
