Everywhere: Hoist the Libraries folder to the top-level

This commit is contained in:
Timothy Flynn 2024-11-09 12:25:08 -05:00 committed by Andreas Kling
commit 93712b24bf
Notes: github-actions[bot] 2024-11-10 11:51:52 +00:00
4547 changed files with 104 additions and 113 deletions

View file

@ -0,0 +1,46 @@
/*
* Copyright (c) 2024, Gregory Bertilson <zaggy1024@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGfx/Size.h>
namespace Media {
struct Subsampling {
public:
Subsampling(bool x, bool y)
: m_x(x)
, m_y(y)
{
}
Subsampling() = default;
bool x() const { return m_x; }
bool y() const { return m_y; }
static u32 subsampled_size(bool subsampled, u32 size)
{
u32 subsampled_as_int = static_cast<u32>(subsampled);
return (size + subsampled_as_int) >> subsampled_as_int;
}
template<Integral T>
Gfx::Size<T> subsampled_size(Gfx::Size<T> size) const
{
return {
subsampled_size(x(), size.width()),
subsampled_size(y(), size.height())
};
}
private:
bool m_x = false;
bool m_y = false;
};
}