mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibGfx: Move FourCC to its own file
These are used in fonts too, so let's not limit them to ImageLoader.
This commit is contained in:
parent
9f2ee86e4d
commit
2c24192e1f
Notes:
sideshowbarker
2024-07-17 03:35:16 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/2c24192e1f Pull-request: https://github.com/SerenityOS/serenity/pull/22004
4 changed files with 28 additions and 15 deletions
26
Userland/Libraries/LibGfx/FourCC.h
Normal file
26
Userland/Libraries/LibGfx/FourCC.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
struct FourCC {
|
||||
constexpr FourCC(char const* name)
|
||||
{
|
||||
cc[0] = name[0];
|
||||
cc[1] = name[1];
|
||||
cc[2] = name[2];
|
||||
cc[3] = name[3];
|
||||
}
|
||||
|
||||
bool operator==(FourCC const&) const = default;
|
||||
bool operator!=(FourCC const&) const = default;
|
||||
|
||||
char cc[4];
|
||||
};
|
||||
|
||||
}
|
|
@ -8,6 +8,7 @@
|
|||
#include <AK/Debug.h>
|
||||
#include <AK/Endian.h>
|
||||
#include <AK/FixedArray.h>
|
||||
#include <LibGfx/FourCC.h>
|
||||
#include <LibGfx/ImageFormats/ILBMLoader.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
|
|
@ -84,19 +84,4 @@ private:
|
|||
NonnullOwnPtr<ImageDecoderPlugin> mutable m_plugin;
|
||||
};
|
||||
|
||||
struct FourCC {
|
||||
constexpr FourCC(char const* name)
|
||||
{
|
||||
cc[0] = name[0];
|
||||
cc[1] = name[1];
|
||||
cc[2] = name[2];
|
||||
cc[3] = name[3];
|
||||
}
|
||||
|
||||
bool operator==(FourCC const&) const = default;
|
||||
bool operator!=(FourCC const&) const = default;
|
||||
|
||||
char cc[4];
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <AK/Format.h>
|
||||
#include <AK/MemoryStream.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/FourCC.h>
|
||||
#include <LibGfx/ImageFormats/WebPLoader.h>
|
||||
#include <LibGfx/ImageFormats/WebPLoaderLossless.h>
|
||||
#include <LibGfx/ImageFormats/WebPLoaderLossy.h>
|
||||
|
|
Loading…
Reference in a new issue