clang-format

This commit is contained in:
2026-03-21 23:19:15 +01:00
parent 55b58ded70
commit 366c00fd22
68 changed files with 5585 additions and 5603 deletions

View File

@@ -5,67 +5,67 @@
namespace GIF {
// Constantes definidas con constexpr, en lugar de macros
constexpr uint8_t EXTENSION_INTRODUCER = 0x21;
constexpr uint8_t IMAGE_DESCRIPTOR = 0x2C;
constexpr uint8_t TRAILER = 0x3B;
constexpr uint8_t GRAPHIC_CONTROL = 0xF9;
constexpr uint8_t APPLICATION_EXTENSION = 0xFF;
constexpr uint8_t COMMENT_EXTENSION = 0xFE;
constexpr uint8_t PLAINTEXT_EXTENSION = 0x01;
// Constantes definidas con constexpr, en lugar de macros
constexpr uint8_t EXTENSION_INTRODUCER = 0x21;
constexpr uint8_t IMAGE_DESCRIPTOR = 0x2C;
constexpr uint8_t TRAILER = 0x3B;
constexpr uint8_t GRAPHIC_CONTROL = 0xF9;
constexpr uint8_t APPLICATION_EXTENSION = 0xFF;
constexpr uint8_t COMMENT_EXTENSION = 0xFE;
constexpr uint8_t PLAINTEXT_EXTENSION = 0x01;
#pragma pack(push, 1)
struct ScreenDescriptor {
struct ScreenDescriptor {
uint16_t width;
uint16_t height;
uint8_t fields;
uint8_t background_color_index;
uint8_t pixel_aspect_ratio;
};
};
struct RGB {
struct RGB {
uint8_t r, g, b;
};
};
struct ImageDescriptor {
struct ImageDescriptor {
uint16_t image_left_position;
uint16_t image_top_position;
uint16_t image_width;
uint16_t image_height;
uint8_t fields;
};
};
#pragma pack(pop)
struct DictionaryEntry {
struct DictionaryEntry {
uint8_t byte;
int prev;
int len;
};
};
struct Extension {
struct Extension {
uint8_t extension_code;
uint8_t block_size;
};
};
struct GraphicControlExtension {
struct GraphicControlExtension {
uint8_t fields;
uint16_t delay_time;
uint8_t transparent_color_index;
};
};
struct ApplicationExtension {
struct ApplicationExtension {
uint8_t application_id[8];
uint8_t version[3];
};
};
struct PlaintextExtension {
struct PlaintextExtension {
uint16_t left, top, width, height;
uint8_t cell_width, cell_height;
uint8_t foreground_color, background_color;
};
};
class Gif {
public:
class Gif {
public:
// Descompone (uncompress) el bloque comprimido usando LZW.
// Este método puede lanzar std::runtime_error en caso de error.
static void decompress(int code_length, const uint8_t* input, int input_length, uint8_t* out);
@@ -78,7 +78,7 @@ class Gif {
// asigna el ancho y alto mediante referencias.
static auto loadGif(const uint8_t* buffer, uint16_t& w, uint16_t& h) -> std::vector<uint8_t>;
private:
private:
// Lee los sub-bloques de datos y los acumula en un std::vector<uint8_t>.
static auto readSubBlocks(const uint8_t*& buffer) -> std::vector<uint8_t>;
@@ -87,6 +87,6 @@ class Gif {
// Procesa el stream completo del GIF y devuelve los datos sin comprimir.
static auto processGifStream(const uint8_t* buffer, uint16_t& w, uint16_t& h) -> std::vector<uint8_t>;
};
};
} // namespace GIF