|
- #pragma once
-
- #include <stdint.h>
-
- typedef struct swwImage swwImage;
-
- struct swwImage {
- uint32_t width;
- uint32_t height;
- uint32_t channels;
- int32_t load_from_file;
- int32_t external; ///< bool: external buffer or not
- uint32_t stride;
-
- uint8_t *buffer;
- };
-
- swwImage *swwImage_Create(uint32_t width, uint32_t height, uint32_t channels);
- void swwImage_Destroy(swwImage *o);
-
- swwImage *swwImage_Load(const char *filename);
- int swwImage_Save(swwImage *o, const char *filename);
- void swwImage_ClearWithByte(swwImage *o, uint8_t b);
-
- uint32_t swwImage_GetPixel(swwImage *o, uint32_t x, uint32_t y);
- void swwImage_SetPixel(swwImage *o, uint32_t x, uint32_t y, uint32_t color);
-
- void swwImage_FlipH(swwImage *o);
- void swwImage_FlipV(swwImage *o);
- void swwImage_RGBA2BGRA(swwImage *o);
|