1#![no_std]
8#![warn(unreachable_pub)]
9
10extern crate alloc;
11
12#[doc(hidden)]
13#[macro_export]
14macro_rules! __j2k_fnv1a64_init {
15 () => {
16 0xcbf2_9ce4_8422_2325_u64
17 };
18}
19
20#[doc(hidden)]
21#[macro_export]
22macro_rules! __j2k_fnv1a64_update {
23 ($hash:ident, $byte:expr) => {{
24 $hash ^= u64::from($byte);
25 $hash = $hash.wrapping_mul(0x0000_0100_0000_01B3_u64);
26 }};
27}
28
29#[doc(hidden)]
30#[macro_export]
31macro_rules! __j2k_fnv1a64_bytes {
32 ($bytes:expr) => {{
33 let mut hash = $crate::__j2k_fnv1a64_init!();
34 for &byte in $bytes {
35 $crate::__j2k_fnv1a64_update!(hash, byte);
36 }
37 hash
38 }};
39}
40
41pub mod accelerator;
43mod backend;
45mod batch;
47mod buffer;
48mod context;
50mod device;
52mod error;
54mod host_allocation;
55mod passthrough;
56mod pixel;
58mod row_sink;
59mod sample;
61mod scale;
63mod scratch;
64mod traits;
66mod types;
68
69pub use accelerator::{
70 AcceleratorSession, DeviceMemoryRange, ExecutionStats, SurfaceMetadata, SurfaceResidency,
71};
72pub use backend::{BackendCapabilities, BackendKind, BackendRequest, CpuFeatures};
73pub use batch::{
74 checked_batch_count_product, checked_batch_count_sum, tile_batch_worker_count,
75 try_batch_reserve_for_push, try_batch_reserve_to, try_collect_indexed_batch_results,
76 try_collect_ordered_batch_results, try_collect_ordered_batch_results_with_limits,
77 BatchAllocationBudget, BatchAllocationRequest, BatchDecodeError, BatchInfrastructureError,
78 BatchResultSlot, IndexedBatchResult, TileBatchError, TileBatchOptions, TileDecodeJob,
79 TileRegionDecodeJob, TileRegionScaledDecodeJob, TileRegionScaledDeviceDecodeRequest,
80 TileScaledDecodeJob,
81};
82pub use buffer::{
83 checked_surface_len, copy_tight_pixels_to_strided_output, ensure_allocation_within_cap,
84 strided_output_len, strided_output_len_capped, validate_strided_output_buffer,
85 DEFAULT_MAX_HOST_ALLOCATION_BYTES,
86};
87pub use context::{CacheStats, CodecContext, DecoderContext};
88pub use device::validate_cuda_surface_backend_request;
89pub use error::{
90 adapter_error_is_buffer_error, adapter_error_is_not_implemented, adapter_error_is_truncated,
91 adapter_error_is_unsupported, AdapterErrorKind, AdapterErrorParts, BufferError, CodecError,
92 InputError, NotImplemented, Unsupported,
93};
94#[doc(hidden)]
95pub use host_allocation::{
96 host_capacity_bytes, try_host_vec_filled, try_host_vec_from_slice, try_host_vec_resize,
97 try_host_vec_with_capacity, HostAllocationBudget, HostAllocationError,
98 HostAllocationLimitError,
99};
100pub use passthrough::{
101 CompressedPayloadKind, CompressedTransferSyntax, PassthroughCandidate, PassthroughDecision,
102 PassthroughRejectReason, PassthroughRequirements,
103};
104pub use pixel::{PixelFormat, PixelLayout};
105pub use row_sink::RowSink;
106pub use sample::{Sample, SampleType};
107pub use scale::Downscale;
108pub use scratch::ScratchPool;
109pub use traits::{
110 submit_ready_device, CpuBackedImageDecode, DecodeRowsError, DeviceSubmission,
111 DeviceSubmitSession, DeviceSurface, ImageCodec, ImageDecode, ImageDecodeDevice,
112 ImageDecodeRows, ImageDecodeSubmit, ReadySubmission, TileBatchDecode, TileBatchDecodeDevice,
113 TileBatchDecodeManyDevice, TileBatchDecodeSubmit, TileDecompress,
114};
115pub use types::{CodedUnitLayout, Colorspace, DecodeOutcome, Info, Rect, TileLayout};