mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:57:35 +00:00
LibGfx: Add start of an ICC profile writer
For now, this can write the profile header. `icc` refuses to dump its contents since the required copyrightTag, profileDescriptionTag, and required per-device-class tags are missing, but it looks ok in a hex editor.
This commit is contained in:
parent
e8a2c17f8f
commit
8b8b7b232e
3 changed files with 92 additions and 0 deletions
23
Userland/Libraries/LibGfx/ICC/BinaryWriter.h
Normal file
23
Userland/Libraries/LibGfx/ICC/BinaryWriter.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
|
||||
namespace Gfx::ICC {
|
||||
|
||||
class Profile;
|
||||
|
||||
// Serializes a Profile object.
|
||||
// Ignores the Profile's on_disk_size() and id() and recomputes them instead.
|
||||
// Also ignores and the offsets and sizes in tag data.
|
||||
// But if the profile has its tag data in tag order and has a computed id,
|
||||
// it's a goal that encode(Profile::try_load_from_externally_owned_memory(bytes) returns `bytes`.
|
||||
// Unconditionally computes a Profile ID (which is an MD5 hash of most of the contents, see Profile::compute_id()) and writes it to the output.
|
||||
ErrorOr<ByteBuffer> encode(Profile const&);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue