// 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.
if (ext == ".jpg") return Codec::kJPG; if (ext == ".jpeg") return Codec::kJPG;
if (ext == ".pgx") return Codec::kPGX;
if (ext == ".pam") return Codec::kPNM; if (ext == ".pnm") return Codec::kPNM; if (ext == ".pgm") return Codec::kPNM; if (ext == ".ppm") return Codec::kPNM; if (ext == ".pfm") { if (bits_per_sample != nullptr) *bits_per_sample = 32; return Codec::kPNM;
}
if (ext == ".gif") return Codec::kGIF;
if (ext == ".exr") return Codec::kEXR;
return Codec::kUnknown;
}
bool CanDecode(Codec codec) { switch (codec) { case Codec::kEXR: return CanDecodeEXR(); case Codec::kGIF: return CanDecodeGIF(); case Codec::kJPG: return CanDecodeJPG(); case Codec::kPNG: return CanDecodeAPNG(); case Codec::kPNM: case Codec::kPGX: case Codec::kJXL: returntrue; default: returnfalse;
}
}
std::string ListOfDecodeCodecs() {
std::string list_of_codecs("JXL, PPM, PNM, PFM, PAM, PGX"); if (CanDecode(Codec::kPNG)) list_of_codecs.append(", PNG, APNG"); if (CanDecode(Codec::kGIF)) list_of_codecs.append(", GIF"); if (CanDecode(Codec::kJPG)) list_of_codecs.append(", JPEG"); if (CanDecode(Codec::kEXR)) list_of_codecs.append(", EXR"); return list_of_codecs;
}
Status DecodeBytes(const Span<const uint8_t> bytes, const ColorHints& color_hints, extras::PackedPixelFile* ppf, const SizeConstraints* constraints, Codec* orig_codec) { if (bytes.size() < kMinBytes) return JXL_FAILURE("Too few bytes");
*ppf = extras::PackedPixelFile();
// Default values when not set by decoders.
ppf->info.uses_original_profile = JXL_TRUE;
ppf->info.orientation = JXL_ORIENT_IDENTITY;
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.