mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00:00
LibGfx/ISOBMFF: Implement JPEG2000DefaultDisplayResolutionBox
Found e.g. in http://opf-labs.org/format-corpus/jp2k-formats/balloon.jpf
This commit is contained in:
parent
a9ef2fac01
commit
b3c423e4ca
Notes:
sideshowbarker
2024-07-16 22:26:05 +09:00
Author: https://github.com/nico
Commit: b3c423e4ca
Pull-request: https://github.com/SerenityOS/serenity/pull/23725
2 changed files with 17 additions and 0 deletions
|
@ -130,6 +130,8 @@ ErrorOr<void> JPEG2000ResolutionBox::read_from_stream(BoxStream& stream)
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BoxType::JPEG2000CaptureResolutionBox:
|
case BoxType::JPEG2000CaptureResolutionBox:
|
||||||
return TRY(JPEG2000CaptureResolutionBox::create_from_stream(stream));
|
return TRY(JPEG2000CaptureResolutionBox::create_from_stream(stream));
|
||||||
|
case BoxType::JPEG2000DefaultDisplayResolutionBox:
|
||||||
|
return TRY(JPEG2000DefaultDisplayResolutionBox::create_from_stream(stream));
|
||||||
default:
|
default:
|
||||||
return OptionalNone {};
|
return OptionalNone {};
|
||||||
}
|
}
|
||||||
|
@ -172,6 +174,16 @@ void JPEG2000CaptureResolutionBox::dump(String const& prepend) const
|
||||||
JPEG2000ResolutionSubboxBase::dump(prepend);
|
JPEG2000ResolutionSubboxBase::dump(prepend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> JPEG2000DefaultDisplayResolutionBox::read_from_stream(BoxStream& stream)
|
||||||
|
{
|
||||||
|
return JPEG2000ResolutionSubboxBase::read_from_stream(stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
void JPEG2000DefaultDisplayResolutionBox::dump(String const& prepend) const
|
||||||
|
{
|
||||||
|
JPEG2000ResolutionSubboxBase::dump(prepend);
|
||||||
|
}
|
||||||
|
|
||||||
ErrorOr<void> JPEG2000ContiguousCodestreamBox::read_from_stream(BoxStream& stream)
|
ErrorOr<void> JPEG2000ContiguousCodestreamBox::read_from_stream(BoxStream& stream)
|
||||||
{
|
{
|
||||||
// FIXME: It's wasteful to make a copy of all the image data here. Having just a ReadonlyBytes
|
// FIXME: It's wasteful to make a copy of all the image data here. Having just a ReadonlyBytes
|
||||||
|
|
|
@ -72,6 +72,11 @@ struct JPEG2000CaptureResolutionBox final : public JPEG2000ResolutionSubboxBase
|
||||||
BOX_SUBTYPE(JPEG2000CaptureResolutionBox);
|
BOX_SUBTYPE(JPEG2000CaptureResolutionBox);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// I.5.3.7.2 Default Display Resolution box
|
||||||
|
struct JPEG2000DefaultDisplayResolutionBox final : public JPEG2000ResolutionSubboxBase {
|
||||||
|
BOX_SUBTYPE(JPEG2000DefaultDisplayResolutionBox);
|
||||||
|
};
|
||||||
|
|
||||||
// I.5.4 Contiguous Codestream box
|
// I.5.4 Contiguous Codestream box
|
||||||
struct JPEG2000ContiguousCodestreamBox final : public Box {
|
struct JPEG2000ContiguousCodestreamBox final : public Box {
|
||||||
BOX_SUBTYPE(JPEG2000ContiguousCodestreamBox);
|
BOX_SUBTYPE(JPEG2000ContiguousCodestreamBox);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue