// Copyright (c) the JPEG XL Project Authors. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.
// Holds a preview, a main image or one or more frames, plus the inputs/outputs // to/from decoding/encoding. class CodecInOut { public: explicit CodecInOut(JxlMemoryManager* memory_manager)
: memory_manager(memory_manager),
preview_frame(memory_manager, &metadata.m) {
frames.reserve(1);
frames.emplace_back(memory_manager, &metadata.m);
}
// If c_current.IsGray(), all planes must be identical.
Status SetFromImage(Image3F&& color, const ColorEncoding& c_current) {
JXL_RETURN_IF_ERROR(Main().SetFromImage(std::move(color), c_current));
SetIntensityTarget(&this->metadata.m);
JXL_RETURN_IF_ERROR(SetSize(Main().xsize(), Main().ysize())); returntrue;
}
Status SetSize(size_t xsize, size_t ysize) {
JXL_RETURN_IF_ERROR(metadata.size.Set(xsize, ysize)); returntrue;
}
Status CheckMetadata() const {
JXL_ENSURE(metadata.m.bit_depth.bits_per_sample != 0);
JXL_ENSURE(!metadata.m.color_encoding.ICC().empty());
if (preview_frame.xsize() != 0) {
JXL_RETURN_IF_ERROR(preview_frame.VerifyMetadata());
}
JXL_ENSURE(preview_frame.metadata() == &metadata.m);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.