2#include <NDEVR/Vector.h>
53 BitmapInfoHeader bmpInfoHeader = { 40,
cast<sint04>(size[
X]),
cast<sint04>(size[
Y]) * 2, 1, 32, 0,
static_cast<uint32_t
>(image_size), 0, 0, 0, 0};
67 std::ofstream ico_file(icon.
c_str(), std::ios::binary);
68 if (!ico_file.is_open())
72 ico_file.write(
reinterpret_cast<char*
>(&icon_dir),
sizeof(
IconDir) -
sizeof(icon_dir.
entries));
73 ico_file.write(
reinterpret_cast<char*
>(&iconDirEntry),
sizeof(iconDirEntry));
76 ico_file.write(
reinterpret_cast<char*
>(&bmpInfoHeader),
sizeof(bmpInfoHeader));
79 ico_file.write(
reinterpret_cast<const char*
>(rgba), image_size);
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
void create(bool override_file) const
File getParentDirectory() const
Logic for handling files with the .ico extension.
Definition ConvertToIco.h:12
static bool ConvertRGBAToIcon(const File &icon, const uint01 *rgba, Vector< 2, uint04 > size)
Definition ConvertToIco.h:49
const char * c_str() const
Used to access the raw memory of this string.
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
constexpr t_type product() const
Definition Vector.hpp:488
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:64
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:88
@ Y
Definition BaseValues.hpp:169
@ X
Definition BaseValues.hpp:167
Definition ConvertToIco.h:15
uint01 width
Definition ConvertToIco.h:16
uint01 height
Definition ConvertToIco.h:17
uint01 colorCount
Definition ConvertToIco.h:18
uint01 reserved
Definition ConvertToIco.h:19
uint04 imageOffset
Definition ConvertToIco.h:23
uint02 bitCount
Definition ConvertToIco.h:21
uint02 planes
Definition ConvertToIco.h:20
uint04 bytesInRes
Definition ConvertToIco.h:22
Definition ConvertToIco.h:27
uint02 type
Definition ConvertToIco.h:29
IconDirEntry entries[1]
Definition ConvertToIco.h:31
uint02 reserved
Definition ConvertToIco.h:28
uint02 count
Definition ConvertToIco.h:30