1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

LibGfx: Move ICC::Profile::read_tag() out of class

This commit is contained in:
Nico Weber 2023-02-14 12:57:11 -05:00 committed by Andreas Kling
parent 7f530c0753
commit 006dff6878
2 changed files with 2 additions and 3 deletions

View file

@ -603,7 +603,7 @@ ErrorOr<void> Profile::read_header(ReadonlyBytes bytes)
return {}; return {};
} }
ErrorOr<NonnullRefPtr<TagData>> Profile::read_tag(ReadonlyBytes bytes, u32 offset_to_beginning_of_tag_data_element, u32 size_of_tag_data_element) static ErrorOr<NonnullRefPtr<TagData>> read_tag(ReadonlyBytes bytes, u32 offset_to_beginning_of_tag_data_element, u32 size_of_tag_data_element)
{ {
// "All tag data elements shall start on a 4-byte boundary (relative to the start of the profile data stream)" // "All tag data elements shall start on a 4-byte boundary (relative to the start of the profile data stream)"
if (offset_to_beginning_of_tag_data_element % 4 != 0) if (offset_to_beginning_of_tag_data_element % 4 != 0)
@ -709,7 +709,7 @@ ErrorOr<void> Profile::read_tag_table(ReadonlyBytes bytes)
// FIXME: optionally ignore tags with unknown signature // FIXME: optionally ignore tags with unknown signature
// Dedupe identical offset/sizes. // Dedupe identical offset/sizes.
NonnullRefPtr<TagData> tag_data = TRY(offset_to_tag_data.try_ensure(tag_table_entries[i].offset_to_beginning_of_tag_data_element, [=, this]() { NonnullRefPtr<TagData> tag_data = TRY(offset_to_tag_data.try_ensure(tag_table_entries[i].offset_to_beginning_of_tag_data_element, [&]() {
return read_tag(bytes, tag_table_entries[i].offset_to_beginning_of_tag_data_element, tag_table_entries[i].size_of_tag_data_element); return read_tag(bytes, tag_table_entries[i].offset_to_beginning_of_tag_data_element, tag_table_entries[i].size_of_tag_data_element);
})); }));

View file

@ -226,7 +226,6 @@ public:
private: private:
ErrorOr<void> read_header(ReadonlyBytes); ErrorOr<void> read_header(ReadonlyBytes);
ErrorOr<NonnullRefPtr<TagData>> read_tag(ReadonlyBytes bytes, u32 offset_to_beginning_of_tag_data_element, u32 size_of_tag_data_element);
ErrorOr<void> read_tag_table(ReadonlyBytes); ErrorOr<void> read_tag_table(ReadonlyBytes);
ErrorOr<void> check_required_tags(); ErrorOr<void> check_required_tags();
ErrorOr<void> check_tag_types(); ErrorOr<void> check_tag_types();