j2k-core 0.7.0

Shared codec contracts and backend types for j2k
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-License-Identifier: MIT OR Apache-2.0

use crate::sample::Sample;

/// Destination for row-streaming decode output.
pub trait RowSink<S: Sample> {
    /// Error returned by the sink when it cannot accept a row.
    type Error: core::error::Error + Send + Sync + 'static;

    /// Write one decoded row at source/output row index `y`.
    ///
    /// # Errors
    ///
    /// Returns [`Self::Error`] when the destination cannot accept the row.
    fn write_row(&mut self, y: u32, row: &[S]) -> Result<(), Self::Error>;
}