mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibGfx: Move ICC::Profile::read_tag() out of class
This commit is contained in:
parent
7f530c0753
commit
006dff6878
Notes:
sideshowbarker
2024-07-17 00:25:02 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/006dff6878 Pull-request: https://github.com/SerenityOS/serenity/pull/17476
@ -603,7 +603,7 @@ ErrorOr<void> Profile::read_header(ReadonlyBytes bytes)
|
||||
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)"
|
||||
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
|
||||
|
||||
// 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);
|
||||
}));
|
||||
|
||||
|
@ -226,7 +226,6 @@ public:
|
||||
|
||||
private:
|
||||
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> check_required_tags();
|
||||
ErrorOr<void> check_tag_types();
|
||||
|
Loading…
Reference in New Issue
Block a user