mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-14 22:42:46 +00:00
Expose shared embedded ICC extraction
This commit is contained in:
2 files changed
+9
-1
No files matched your search
@@ -3,6 +3,14 @@
|
||||
use crate::error::CodecError;
|
||||
use crate::{ChannelLayout, DecodeOptions, Format, Limits, SampleType, decode_with};
|
||||
|
||||
/// Return an embedded ICC profile using the selected format decoder.
|
||||
///
|
||||
/// This fully decodes the image; callers that already need the pixels should read `Image::meta.icc`
|
||||
/// from that decode instead of invoking this helper separately.
|
||||
pub fn embedded_icc(bytes: &[u8]) -> Result<Option<Vec<u8>>, CodecError> {
|
||||
Ok(decode_with(bytes, &DecodeOptions::default())?.icc)
|
||||
}
|
||||
|
||||
/// The source pixel model reported by an image container, before decode normalizes it.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum RasterColorType {
|
||||
|
||||
@@ -48,7 +48,7 @@ pub use crate::image::{
|
||||
ChannelLayout, CryptomatteBuffer, CryptomatteLayer, DecodeWarning, DeepChannel, DeepImage, ExrChannelInfo, ExrPartInfo, ExtraSample, Image,
|
||||
MAX_EXTRA_SAMPLES, Metadata, SampleType, convert_samples,
|
||||
};
|
||||
pub use crate::inspection::{RasterColorType, RasterInspection, ToneClass, classify_tone, inspect_raster};
|
||||
pub use crate::inspection::{RasterColorType, RasterInspection, ToneClass, classify_tone, embedded_icc, inspect_raster};
|
||||
pub use crate::options::{
|
||||
DdsCompression, DdsOptions, DecodeOptions, DpxBits, EncodeOptions, ExrCompression, JpegFormat, Limits, PngCompression, PngStereo,
|
||||
TIFF_PYRAMID_MIN, TiffCompression,
|
||||
|
||||
Reference in new issue
Block a user