# ImageSourceStateListener

Defines a listener for image source state changes.

>Note: Subclasses inheriting from this class must ensure that the parent class constructor (`super().__init__()`) is properly called to guarantee correct initialization.

## Definition

*Module:* cvr

```python
class ImageSourceStateListener(ABC)
```

## Methods

| Method                                                    | Description                                        |
| --------------------------------------------------------- | -------------------------------------------------- |
| [`on_image_source_state_received`](#on_image_source_state_received) | Called when the state of the image source changes. |

### on_image_source_state_received

This method is called when the state of the image source changes.

```python
@abstractmethod
def on_image_source_state_received(self, state: int) -> None:
```

**Parameters**

`state` The state of the image source. It is one of the values of the `EnumImageSourceState` enumeration.

**See Also**

[EnumImageSourceState](https://www.dynamsoft.com/capture-vision/docs/server/programming/python/api-reference/capture-vision-router/enum-image-source-state.md)
