Skip to main content

j2k_transcode/jpeg_to_htj2k/
output.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3use super::{BatchTranscodeReport, JpegToHtj2kError, TranscodeReport};
4
5/// Encoded transcode output and validation/report metadata.
6#[derive(Debug)]
7pub struct EncodedTranscode {
8    /// HTJ2K codestream bytes.
9    pub codestream: Vec<u8>,
10    /// Summary of the experimental path used.
11    pub report: TranscodeReport,
12}
13
14crate::move_only::assert_move_only!(EncodedTranscode);
15
16/// One JPEG tile input for batch transcode.
17#[derive(Debug, Clone, Copy)]
18pub struct JpegTileBatchInput<'a> {
19    /// JPEG codestream bytes for one tile.
20    pub bytes: &'a [u8],
21}
22
23/// Batch transcode output. Tile-level parse/encode failures are preserved so a
24/// WSI ingest queue can continue past isolated bad tiles.
25#[derive(Debug)]
26pub struct EncodedTranscodeBatch {
27    /// Per-input tile result in input order.
28    pub tiles: Vec<Result<EncodedTranscode, JpegToHtj2kError>>,
29    /// Aggregate batch report.
30    pub report: BatchTranscodeReport,
31}