forked from spoutn1k/mcmap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
draw_png.h
22 lines (18 loc) · 875 Bytes
/
draw_png.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef DRAW_PNG_H_
#define DRAW_PNG_H_
// Separate them in case I ever implement 16bit rendering
#define CHANSPERPIXEL 4
#define BYTESPERCHAN 1
#define BYTESPERPIXEL 4
#include "helper.h"
void createImageBuffer(const size_t width, const size_t height, const bool splitUp);
bool createImage(FILE *fh, const size_t width, const size_t height, const bool splitUp);
bool saveImage();
int loadImagePart(const int startx, const int starty, const int width, const int height);
void setPixel(const size_t x, const size_t y, const uint8_t color, const float fsub);
void blendPixel(const size_t x, const size_t y, const uint8_t color, const float fsub);
bool saveImagePart();
bool discardImagePart();
bool composeFinalImage();
uint64_t calcImageSize(const int mapChunksX, const int mapChunksZ, const size_t mapHeight, int &pixelsX, int &pixelsY, const bool tight = false);
#endif