No description
Find a file
2025-05-01 20:27:15 +02:00
include feat: new Set::set to make it easier to set a specific value to a specific state 2025-05-01 20:27:15 +02:00
src Fixed small math issue in HSV to RGB formule 2024-11-19 22:04:39 +01:00
.gitignore The first custom container, a custom bitset to hold enum values as options. 2024-09-30 22:23:24 +02:00
example.cpp The first custom container, a custom bitset to hold enum values as options. 2024-09-30 22:23:24 +02:00
LICENSE The first custom container, a custom bitset to hold enum values as options. 2024-09-30 22:23:24 +02:00
README.md Added new classes to store color information 2024-10-26 13:40:59 +00:00

Custom C++ Containers

A collection of custom data containers for use in C++.

Set

The Set class provides various methods to Insert, Erase, and check (Contains) for the presence of elements in the set, all while maintaining efficient storage and calculation using bitwise operations on a single integer.

enum class Options {
  kOptions1,
  kOptions2,
  kOptions3,
  kOptions4,
  kOptions5,
  kOptions6,
  kOptions7,
  kOptions8,
  kOptions9,
  kOptions10
};

typedef Set<Options, Options::kOptions1, Options::kOptions10> SetType;

SetType set;
set << Options::kOptions1 << Options::kOptions2 << Options::kOptions3;

if (set.Contains(Options::kOptions1)) {
  printf("The set contains kOptions1\n");
}

Color (ColorRgb, ColorHsv, ColorTemp)

Classes to store, manipulate and convert between RGB color values (0-255), HSV color values (0 - 360, 0 - 100, 0 - 100), and color temperature values in Kelvin.

License

MIT - see LICENSE file for details.