mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-25 20:22:18 +03:00
LibGfx/ISOBMFF: Add JPEG2000ResolutionBox
This commit is contained in:
parent
7d137dc480
commit
b386d5bb14
Notes:
sideshowbarker
2024-07-16 22:26:05 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/b386d5bb14 Pull-request: https://github.com/SerenityOS/serenity/pull/23682 Reviewed-by: https://github.com/LucasChollet Reviewed-by: https://github.com/Zaggy1024 Reviewed-by: https://github.com/timschumi ✅
@ -17,6 +17,8 @@ ErrorOr<void> JPEG2000HeaderBox::read_from_stream(BoxStream& stream)
|
||||
return TRY(JPEG2000ColorSpecificationBox::create_from_stream(stream));
|
||||
case BoxType::JPEG2000ImageHeaderBox:
|
||||
return TRY(JPEG2000ImageHeaderBox::create_from_stream(stream));
|
||||
case BoxType::JPEG2000ResolutionBox:
|
||||
return TRY(JPEG2000ResolutionBox::create_from_stream(stream));
|
||||
default:
|
||||
return OptionalNone {};
|
||||
}
|
||||
@ -87,6 +89,24 @@ void JPEG2000ColorSpecificationBox::dump(String const& prepend) const
|
||||
outln("{}- icc_data = {} bytes", prepend, icc_data.size());
|
||||
}
|
||||
|
||||
ErrorOr<void> JPEG2000ResolutionBox::read_from_stream(BoxStream& stream)
|
||||
{
|
||||
auto make_subbox = [](BoxType type, BoxStream&) -> ErrorOr<Optional<NonnullOwnPtr<Box>>> {
|
||||
switch (type) {
|
||||
default:
|
||||
return OptionalNone {};
|
||||
}
|
||||
};
|
||||
|
||||
TRY(SuperBox::read_from_stream(stream, move(make_subbox)));
|
||||
return {};
|
||||
}
|
||||
|
||||
void JPEG2000ResolutionBox::dump(String const& prepend) const
|
||||
{
|
||||
SuperBox::dump(prepend);
|
||||
}
|
||||
|
||||
ErrorOr<void> JPEG2000SignatureBox::read_from_stream(BoxStream& stream)
|
||||
{
|
||||
signature = TRY(stream.read_value<BigEndian<u32>>());
|
||||
|
@ -38,6 +38,11 @@ struct JPEG2000ColorSpecificationBox final : public Box {
|
||||
ByteBuffer icc_data; // Only set if method == 2
|
||||
};
|
||||
|
||||
// I.5.3.7 Resolution box
|
||||
struct JPEG2000ResolutionBox final : public SuperBox {
|
||||
BOX_SUBTYPE(JPEG2000ResolutionBox);
|
||||
};
|
||||
|
||||
struct JPEG2000SignatureBox final : public Box {
|
||||
BOX_SUBTYPE(JPEG2000SignatureBox);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user