diff options
Diffstat (limited to 'Source/Graphics/bytecolor.h')
-rw-r--r-- | Source/Graphics/bytecolor.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Source/Graphics/bytecolor.h b/Source/Graphics/bytecolor.h new file mode 100644 index 00000000..37136d4c --- /dev/null +++ b/Source/Graphics/bytecolor.h @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------------- +// Name: bytecolor.h +// Developer: Wolfire Games LLC +// Description: +// License: Read below +//----------------------------------------------------------------------------- +// +// +// Copyright 2022 Wolfire Games LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//----------------------------------------------------------------------------- +#pragma once + +#include <Math/vec4.h> +#include <Math/vec3.h> + +#include <Graphics/textures.h> + +struct ByteColor { + unsigned char color[3]; + + ByteColor(); + ByteColor(unsigned char r, unsigned char g, unsigned char b); + void Set(unsigned char r, unsigned char g, unsigned char b); + const ByteColor &operator=(const ByteColor &other); +}; + +vec4 GetAverageColor( const char* abs_path ); +unsigned distance_squared(const ByteColor &a, const ByteColor &b); +float hue_saturation_distance_squared(const ByteColor &a, const ByteColor &b); +int WeightIndex(const TextureData &data, int i, int j); |