16#ifndef LIEF_PE_RESOURCE_ICON_H
17#define LIEF_PE_RESOURCE_ICON_H
23#include "LIEF/visibility.h"
25#include "LIEF/span.hpp"
26#include "LIEF/Object.hpp"
28#include "LIEF/PE/enums.hpp"
32class ResourcesManager;
35struct pe_resource_icon_group;
45 ResourceIcon(
const details::pe_resource_icon_group& header);
87 void lang(uint32_t lang);
88 void sublang(uint32_t sublang);
89 void width(uint8_t width);
90 void height(uint8_t height);
91 void color_count(uint8_t color_count);
92 void reserved(uint8_t reserved);
93 void planes(uint16_t planes);
94 void bit_count(uint16_t bit_count);
95 void pixels(
const std::vector<uint8_t>& pixels);
100 void save(
const std::string& filename)
const;
102 void accept(
Visitor& visitor)
const override;
105 LIEF_API
friend std::ostream& operator<<(std::ostream& os,
const ResourceIcon& entry);
110 uint8_t color_count_ = 0;
111 uint8_t reserved_ = 0;
112 uint16_t planes_ = 0;
113 uint16_t bit_count_ = 0;
114 uint32_t id_ = UINT_MAX;
116 uint32_t sublang_ = 0 ;
117 std::vector<uint8_t> pixels_;
Definition ResourceIcon.hpp:39
uint32_t lang() const
Language associated with the icon.
uint32_t sublang() const
Sub language associated with the icon.
uint8_t height() const
Height in pixels of the image.
uint16_t planes() const
Color Planes.
uint32_t id() const
Id associated with the icon.
span< const uint8_t > pixels() const
Pixels of the image (as bytes)
uint8_t reserved() const
Reserved (must be 0)
uint8_t color_count() const
Number of colors in image (0 if >=8bpp)
uint32_t size() const
Size in bytes of the image.
uint16_t bit_count() const
Bits per pixel.
void save(const std::string &filename) const
Save the icon to the given filename.
uint8_t width() const
Width in pixels of the image.
The Resource Manager provides an enhanced API to manipulate the resource tree.
Definition ResourcesManager.hpp:38
Definition Visitor.hpp:219
LIEF namespace.
Definition Abstract/Binary.hpp:32