2#include <NDEVR/Vector.h>
50 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};
64 std::ofstream ico_file(icon.
c_str(), std::ios::binary);
65 if (!ico_file.is_open())
69 ico_file.write(
reinterpret_cast<char*
>(&icon_dir),
sizeof(
IconDir) -
sizeof(icon_dir.
entries));
70 ico_file.write(
reinterpret_cast<char*
>(&iconDirEntry),
sizeof(iconDirEntry));
73 ico_file.write(
reinterpret_cast<char*
>(&bmpInfoHeader),
sizeof(bmpInfoHeader));
76 ico_file.write(
reinterpret_cast<const char*
>(rgba), image_size);
NDEVR_BASE_API void create(bool override_file) const
Definition File.cpp:1744
NDEVR_BASE_API File getParentDirectory() const
Definition File.cpp:1692
Definition ConvertToIco.h:9
static bool ConvertRGBAToIcon(const File &icon, const uint01 *rgba, Vector< 2, uint04 > size)
Definition ConvertToIco.h:46
NDEVR_BASE_API const char * c_str() const
Definition String.cpp:490
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
constexpr t_type product() const
Definition Vector.hpp:526
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:76
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:109
@ Y
Definition BaseValues.hpp:202
@ X
Definition BaseValues.hpp:200
Definition ConvertToIco.h:12
uint01 width
Definition ConvertToIco.h:13
uint01 height
Definition ConvertToIco.h:14
uint01 colorCount
Definition ConvertToIco.h:15
uint01 reserved
Definition ConvertToIco.h:16
uint04 imageOffset
Definition ConvertToIco.h:20
uint02 bitCount
Definition ConvertToIco.h:18
uint02 planes
Definition ConvertToIco.h:17
uint04 bytesInRes
Definition ConvertToIco.h:19
Definition ConvertToIco.h:24
uint02 type
Definition ConvertToIco.h:26
IconDirEntry entries[1]
Definition ConvertToIco.h:28
uint02 reserved
Definition ConvertToIco.h:25
uint02 count
Definition ConvertToIco.h:27