mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-16 06:22:17 +00:00
LibGfx/ISOBMFF: Introduce JPEG2000ResolutionSubboxBase
No behavior change.
This commit is contained in:
parent
a971625c49
commit
a9ef2fac01
Notes:
sideshowbarker
2024-07-17 07:25:39 +09:00
Author: https://github.com/nico
Commit: a9ef2fac01
Pull-request: https://github.com/SerenityOS/serenity/pull/23725
2 changed files with 20 additions and 5 deletions
|
@ -144,7 +144,7 @@ void JPEG2000ResolutionBox::dump(String const& prepend) const
|
|||
SuperBox::dump(prepend);
|
||||
}
|
||||
|
||||
ErrorOr<void> JPEG2000CaptureResolutionBox::read_from_stream(BoxStream& stream)
|
||||
ErrorOr<void> JPEG2000ResolutionSubboxBase::read_from_stream(BoxStream& stream)
|
||||
{
|
||||
vertical_capture_grid_resolution_numerator = TRY(stream.read_value<BigEndian<u16>>());
|
||||
vertical_capture_grid_resolution_denominator = TRY(stream.read_value<BigEndian<u16>>());
|
||||
|
@ -155,13 +155,23 @@ ErrorOr<void> JPEG2000CaptureResolutionBox::read_from_stream(BoxStream& stream)
|
|||
return {};
|
||||
}
|
||||
|
||||
void JPEG2000CaptureResolutionBox::dump(String const& prepend) const
|
||||
void JPEG2000ResolutionSubboxBase::dump(String const& prepend) const
|
||||
{
|
||||
Box::dump(prepend);
|
||||
outln("{}- vertical_capture_grid_resolution = {}/{} * 10^{}", prepend, vertical_capture_grid_resolution_numerator, vertical_capture_grid_resolution_denominator, vertical_capture_grid_resolution_exponent);
|
||||
outln("{}- horizontal_capture_grid_resolution = {}/{} * 10^{}", prepend, horizontal_capture_grid_resolution_numerator, horizontal_capture_grid_resolution_denominator, horizontal_capture_grid_resolution_exponent);
|
||||
}
|
||||
|
||||
ErrorOr<void> JPEG2000CaptureResolutionBox::read_from_stream(BoxStream& stream)
|
||||
{
|
||||
return JPEG2000ResolutionSubboxBase::read_from_stream(stream);
|
||||
}
|
||||
|
||||
void JPEG2000CaptureResolutionBox::dump(String const& prepend) const
|
||||
{
|
||||
JPEG2000ResolutionSubboxBase::dump(prepend);
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
@ -55,9 +55,9 @@ struct JPEG2000ResolutionBox final : public SuperBox {
|
|||
BOX_SUBTYPE(JPEG2000ResolutionBox);
|
||||
};
|
||||
|
||||
// I.5.3.7.1 Capture Resolution box
|
||||
struct JPEG2000CaptureResolutionBox final : public Box {
|
||||
BOX_SUBTYPE(JPEG2000CaptureResolutionBox);
|
||||
struct JPEG2000ResolutionSubboxBase : public Box {
|
||||
ErrorOr<void> read_from_stream(BoxStream&);
|
||||
virtual void dump(String const& prepend) const override;
|
||||
|
||||
u16 vertical_capture_grid_resolution_numerator { 0 };
|
||||
u16 vertical_capture_grid_resolution_denominator { 0 };
|
||||
|
@ -67,6 +67,11 @@ struct JPEG2000CaptureResolutionBox final : public Box {
|
|||
i8 horizontal_capture_grid_resolution_exponent { 0 };
|
||||
};
|
||||
|
||||
// I.5.3.7.1 Capture Resolution box
|
||||
struct JPEG2000CaptureResolutionBox final : public JPEG2000ResolutionSubboxBase {
|
||||
BOX_SUBTYPE(JPEG2000CaptureResolutionBox);
|
||||
};
|
||||
|
||||
// I.5.4 Contiguous Codestream box
|
||||
struct JPEG2000ContiguousCodestreamBox final : public Box {
|
||||
BOX_SUBTYPE(JPEG2000ContiguousCodestreamBox);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue