This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
585 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
typedef struct { | ||
uint8_t r; | ||
uint8_t g; | ||
uint8_t b; | ||
} IMAGE_PIXEL; | ||
|
||
typedef struct { | ||
int32_t width; | ||
int32_t height; | ||
IMAGE_PIXEL *data; | ||
} IMAGE; | ||
|
||
IMAGE *Image_Create(int width, int height); | ||
IMAGE *Image_CreateFromFile(const char *path); | ||
void Image_Free(IMAGE *image); | ||
|
||
bool Image_SaveToFile(const IMAGE *image, const char *path); | ||
|
||
IMAGE *Image_ScaleFit( | ||
const IMAGE *source_image, size_t target_width, size_t target_height); | ||
|
||
IMAGE *Image_ScaleCover( | ||
const IMAGE *source_image, size_t target_width, size_t target_height); | ||
|
||
IMAGE *Image_ScaleStretch( | ||
const IMAGE *source_image, size_t target_width, size_t target_height); | ||
|
||
IMAGE *Image_ScaleSmart( | ||
const IMAGE *source_image, size_t target_width, size_t target_height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.