# `Kreuzberg.OcrRotation`
[🔗](https://github.com/kreuzberg-dev/kreuzberg/blob/main/lib/kreuzberg/ocr_rotation.ex#L1)

Rotation information for OCR-detected text.

Represents the rotation angle of text as detected by OCR,
including the confidence of the angle detection.

## Fields

  * `:angle_degrees` - Rotation angle in degrees (-180 to 180), or nil
  * `:confidence` - Confidence score for rotation detection (0.0-1.0), or nil

## Examples

    iex> rotation = %Kreuzberg.OcrRotation{
    ...>   angle_degrees: 15.5,
    ...>   confidence: 0.88
    ...> }
    iex> rotation.angle_degrees
    15.5

# `t`

```elixir
@type t() :: %Kreuzberg.OcrRotation{
  angle_degrees: float() | nil,
  confidence: float() | nil
}
```

# `from_map`

```elixir
@spec from_map(map()) :: t()
```

Creates an OcrRotation struct from a map.

## Parameters

  * `data` - A map containing rotation fields

## Returns

An `OcrRotation` struct with properly typed fields.

## Examples

    iex> rotation_map = %{"angle_degrees" => 15.5, "confidence" => 0.88}
    iex> rotation = Kreuzberg.OcrRotation.from_map(rotation_map)
    iex> rotation.angle_degrees
    15.5

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Converts an OcrRotation struct to a map.

## Parameters

  * `rotation` - An `OcrRotation` struct

## Returns

A map with string keys representing all fields.

## Examples

    iex> rotation = %Kreuzberg.OcrRotation{
    ...>   angle_degrees: 15.5,
    ...>   confidence: 0.88
    ...> }
    iex> Kreuzberg.OcrRotation.to_map(rotation)
    %{"angle_degrees" => 15.5, "confidence" => 0.88}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
