mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
LibGfx/TIFF: Move Formatter<Rational>
's definition to TIFFMetadata.h
This will soon be used in TIFFTagHandler.cpp, so the definition needs to be shared.
This commit is contained in:
parent
71fdf0860e
commit
1d345109c4
2 changed files with 12 additions and 13 deletions
|
@ -511,11 +511,3 @@ ErrorOr<Optional<ReadonlyBytes>> TIFFImageDecoderPlugin::icc_data()
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct AK::Formatter<Gfx::TIFF::Rational<T>> : Formatter<FormatString> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, Gfx::TIFF::Rational<T> value)
|
||||
{
|
||||
return Formatter<FormatString>::format(builder, "{} ({}/{})"sv, static_cast<double>(value.numerator) / value.denominator, value.numerator, value.denominator);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue