2021-04-18 09:29:04 -04:00
|
|
|
/*
|
2021-05-29 06:38:28 -04:00
|
|
|
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
2022-01-06 21:36:07 -05:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2021-04-18 09:29:04 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-01-06 21:36:07 -05:00
|
|
|
#include "VectorN.h"
|
2021-04-18 09:29:04 -04:00
|
|
|
|
2022-01-06 21:36:07 -05:00
|
|
|
#include <AK/Error.h>
|
|
|
|
#include <AK/Format.h>
|
|
|
|
#include <AK/StringView.h>
|
2021-04-18 09:29:04 -04:00
|
|
|
|
2022-01-06 21:36:07 -05:00
|
|
|
namespace Gfx {
|
2021-04-18 09:29:04 -04:00
|
|
|
|
2022-01-06 21:36:07 -05:00
|
|
|
template<class T>
|
|
|
|
using Vector4 = VectorN<4, T>;
|
|
|
|
using DoubleVector4 = Vector4<double>;
|
2022-04-29 09:07:59 -04:00
|
|
|
using FloatVector4 = Vector4<float>;
|
|
|
|
using IntVector4 = Vector4<int>;
|
2021-04-18 09:29:04 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-05-14 19:31:28 -04:00
|
|
|
namespace AK {
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
struct Formatter<Gfx::Vector4<T>> : Formatter<StringView> {
|
2021-11-15 19:15:21 -05:00
|
|
|
ErrorOr<void> format(FormatBuilder& builder, Gfx::Vector4<T> const& value)
|
2021-05-14 19:31:28 -04:00
|
|
|
{
|
2023-12-16 09:19:34 -05:00
|
|
|
return Formatter<StringView>::format(builder, value.to_byte_string());
|
2021-05-14 19:31:28 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-04-18 09:29:04 -04:00
|
|
|
using Gfx::DoubleVector4;
|
|
|
|
using Gfx::FloatVector4;
|
2022-04-29 09:07:59 -04:00
|
|
|
using Gfx::IntVector4;
|
2021-04-18 09:29:04 -04:00
|
|
|
using Gfx::Vector4;
|