34 lines
537 B
C
34 lines
537 B
C
|
#ifndef __IMAGE__
|
||
|
#define __IMAGE__
|
||
|
|
||
|
#include <errno.h>
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
#include "../libcproject/libcproject.h"
|
||
|
|
||
|
struct pixel {
|
||
|
byte_t red;
|
||
|
byte_t green;
|
||
|
byte_t blue;
|
||
|
};
|
||
|
|
||
|
struct image {
|
||
|
struct pixel** pixels;
|
||
|
size_t width;
|
||
|
size_t height;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* @brief Initializes a new image (with all colors defaulting to 0 => black).
|
||
|
*
|
||
|
* @param width
|
||
|
* @param height
|
||
|
* @return struct image*
|
||
|
*/
|
||
|
struct image* image_initialization(size_t width, size_t height);
|
||
|
|
||
|
void image_free(struct image* image);
|
||
|
|
||
|
#endif
|