> This page is for version 3.0 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 3.0 (Latest) (default): https://docs.nvidia.com/holoscan/sensor-bridge/3-0/llms.txt
> - 2.7: https://docs.nvidia.com/holoscan/sensor-bridge/2-7/llms.txt
> - Archives: https://docs.nvidia.com/holoscan/sensor-bridge/archives/llms.txt

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

# hololink::module::csi::CsiConverterV1

> Tells the component that interprets received image data how that data is laid out in the receive buffer.

Tells the component that interprets received image data how that data is laid out in the receive buffer.

The device delivers each frame into a buffer as CSI-2 data: possibly some leading bytes (metadata, framing), then the image lines, each padded to whatever alignment the receiving hardware or software requires, then possibly some trailing bytes. The component that converts that buffer into an image (a converter operator, or a capture operator that does so itself) implements this interface. A sensor driver uses it to find out how the receiver arranges the data, and then tells the converter where within that arrangement the image is.

Typical use, by a sensor driver:

1. Ask for the receiver's geometry with receiver_start_byte(), transmitted_line_bytes() and received_line_bytes().
2. Add the sensor's own non-image content to the start offset (for example metadata lines and optical-black lines that precede the image).
3. Call configure() with the resulting layout.

The geometry depends on the converter in use: for example, how many bytes a RAW_10 line occupies, and the alignment of received lines, differ between converters. Applications and drivers must therefore ask the converter and not assume.

This is not a service obtained from a [Module](../../../classes/module); the application hands the converter to the sensor driver as a `std::shared_ptr`.

```cpp showLineNumbers={false}
#include <hololink/module/csi/csi_converter.hpp>
```

---

## Methods

### configure \[#configure]

```cpp showLineNumbers={false}
virtual void hololink::module::csi::CsiConverterV1::configure(
    uint32_t start_byte,
    uint32_t received_bytes_per_line,
    uint32_t pixel_width,
    uint32_t pixel_height,
    PixelFormat pixel_format,
    uint32_t trailing_bytes = 0
)
```

Tell the converter where the image is in the receive buffer and how it is encoded.

Call this before frames are processed, once the geometry above is known.

**Parameters**

**`start_byte`** `uint32_t`

Offset, from the start of the receive buffer, of the first byte of the first image line; everything before it (leading framing, metadata, and any sensor lines that are not image) is skipped.

---

**`received_bytes_per_line`** `uint32_t`

Distance in bytes from the start of one image line to the start of the next, including padding (see received_line_bytes()).

---

**`pixel_width`** `uint32_t`

Image width, in pixels.

---

**`pixel_height`** `uint32_t`

Image height, in lines.

---

**`pixel_format`** `PixelFormat`

How pixels are encoded in the received data.

---

**`trailing_bytes`** `uint32_t` — default: 0

Bytes in the buffer, after the last image line, that are not image data.

---

### receiver_start_byte \[#receiverstartbyte]

```cpp showLineNumbers={false}
virtual uint32_t hololink::module::csi::CsiConverterV1::receiver_start_byte()
```

Offset in the receive buffer at which the receiver puts the first byte of the data the sensor sent.

Accounts for anything the receiver places before the sensor's data. Add the sensor's own leading non-image bytes to this to obtain the `start_byte` for configure().

**Returns:** The offset, in bytes.

### received_line_bytes \[#receivedlinebytes]

```cpp showLineNumbers={false}
virtual uint32_t hololink::module::csi::CsiConverterV1::received_line_bytes(
    uint32_t line_bytes
)
```

The distance, in the receive buffer, from the start of one line to the start of the next.

The receiver pads each line it stores to a multiple of an alignment it requires, so this is `line_bytes` rounded up accordingly.

**Returns:** The spacing between received lines, in bytes.

**Parameters**

**`line_bytes`** `uint32_t`

Bytes the sensor transmits for a line, as given by transmitted_line_bytes() (or the size of any other sensor line, such as metadata).

---

### transmitted_line_bytes \[#transmittedlinebytes]

```cpp showLineNumbers={false}
virtual uint32_t hololink::module::csi::CsiConverterV1::transmitted_line_bytes(
    PixelFormat pixel_format,
    uint32_t pixel_width
)
```

The number of bytes the sensor transmits for one image line.

Depends on how many bits the pixel format uses and on how the converter packs pixels (for example RAW_8 uses one byte per pixel, while RAW_10 and RAW_12 pack several pixels across a smaller number of bytes). The count excludes any padding the receiver adds; see received_line_bytes().

**Returns:** Bytes per transmitted line.

**Throws:** `std::runtime_error` if the converter does not support `pixel_format`, or if it needs to be told which format to expect before it can answer and has not been.

**Parameters**

**`pixel_format`** `PixelFormat`

How pixels are encoded.

---

**`pixel_width`** `uint32_t`

Image width, in pixels.

---