> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::ops::BufferInfo

> Buffer information, can be initialized either with a tensor or a video buffer.

Buffer information, can be initialized either with a tensor or a video buffer.

```cpp showLineNumbers={false}
#include <holoscan/ops/buffer_info.hpp>
```

***

## Methods

### init \[#init]

```cpp showLineNumbers={false}
gxf_result_t holoscan::ops::BufferInfo::init(
    const nvidia::gxf::Handle<nvidia::gxf::Tensor> &tensor,
    HolovizOp::ImageFormat input_image_format = HolovizOp::ImageFormat::AUTO_DETECT
)
```

Initialize with tensor.

**Returns:** error code

**Parameters**

If HolovizOp::ImageFormat::AUTO\_DETECT then auto detect the image format, else use the provided image format

```cpp showLineNumbers={false}
gxf_result_t holoscan::ops::BufferInfo::init(
    const nvidia::gxf::Handle<nvidia::gxf::VideoBuffer> &video,
    HolovizOp::ImageFormat input_image_format = HolovizOp::ImageFormat::AUTO_DETECT
)
```

Initialize with video buffer.

**Returns:** error code

**Parameters**

The video buffer handle

If HolovizOp::ImageFormat::AUTO\_DETECT then auto detect the image format, else use the provided image format

***

## Static methods

### get\_supported\_tensor\_formats\_str \[#getsupportedtensorformatsstr]

```cpp showLineNumbers={false}
static std::string holoscan::ops::BufferInfo::get_supported_tensor_formats_str(
    const std::vector<HolovizOp::ImageFormat> &device_image_formats
)
```

**Returns:** a string describing the supported tensor formats

### get\_supported\_video\_buffer\_formats\_str \[#getsupportedvideobufferformatsstr]

```cpp showLineNumbers={false}
static std::string holoscan::ops::BufferInfo::get_supported_video_buffer_formats_str(
    const std::vector<HolovizOp::ImageFormat> &device_image_formats
)
```

**Returns:** a string describing the supported video buffer formats

***

## Member variables

| Name                   | Type                                     | Description                                                   |
| ---------------------- | ---------------------------------------- | ------------------------------------------------------------- |
| `rank`                 | `uint32_t`                               |                                                               |
| `components`           | `uint32_t`                               |                                                               |
| `width`                | `uint32_t`                               |                                                               |
| `height`               | `uint32_t`                               |                                                               |
| `element_type`         | `nvidia::gxf::PrimitiveType`             |                                                               |
| `image_format`         | `HolovizOp::ImageFormat`                 |                                                               |
| `component_swizzle`    | `viz::ComponentSwizzle`                  |                                                               |
| `name`                 | `std::string`                            |                                                               |
| `buffer_ptr`           | `const nvidia::byte *`                   | points to the memory owned by either a tensor or video buffer |
| `storage_type`         | `nvidia::gxf::MemoryStorageType`         |                                                               |
| `bytes_size`           | `uint64_t`                               |                                                               |
| `stride`               | `nvidia::gxf::Tensor::stride_array_t`    |                                                               |
| `color_planes`         | `std::vector< nvidia::gxf::ColorPlane >` | plane information                                             |
| `yuv_model_conversion` | `HolovizOp::YuvModelConversion`          |                                                               |
| `yuv_range`            | `HolovizOp::YuvRange`                    |                                                               |