mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-18 21:29:18 +02:00
Added bitmap_fill
This commit is contained in:
parent
da7baa0fbf
commit
f0e45111e4
2 changed files with 13 additions and 0 deletions
|
@ -96,6 +96,18 @@ int bitmap_set(RGBBitmap *img, int x, int y, int r, int g, int b)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void bitmap_fill(RGBBitmap *img, int r, int g, int b)
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
// TODO: could use pointers directly or even memcpy
|
||||||
|
// to make this faster
|
||||||
|
for (y = 0; y < img->height; y++) {
|
||||||
|
for (x = 0; x < img->height; x++) {
|
||||||
|
bitmap_set(img, x, y, r, g, b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//int main()
|
//int main()
|
||||||
//{
|
//{
|
||||||
// const char path[] = "test.png";
|
// const char path[] = "test.png";
|
||||||
|
|
|
@ -32,5 +32,6 @@ typedef struct _RGBBitmap {
|
||||||
int bitmap_init(RGBBitmap *img, int width, int height);
|
int bitmap_init(RGBBitmap *img, int width, int height);
|
||||||
int bitmap_set(RGBBitmap *img, int x, int y, int r, int g, int b);
|
int bitmap_set(RGBBitmap *img, int x, int y, int r, int g, int b);
|
||||||
int bitmap_save_to_png(RGBBitmap *bitmap, const char *path);
|
int bitmap_save_to_png(RGBBitmap *bitmap, const char *path);
|
||||||
|
void bitmap_fill(RGBBitmap *img, int r, int g, int b);
|
||||||
|
|
||||||
#endif /* WRITE_PNG_H */
|
#endif /* WRITE_PNG_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue