-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBitmapImageGenerator.h
More file actions
49 lines (36 loc) · 1.27 KB
/
Copy pathBitmapImageGenerator.h
File metadata and controls
49 lines (36 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include <stdio.h>
class BitmapImageGenerator
{
const int bytesPerPixel = 3; /// red -> green -> blue
const int fileHeaderSize = 14;
const int infoHeaderSize = 40;
public:
BitmapImageGenerator();
void generateBitmapImage(unsigned char *image, int height, int width, char *imageFileName);
unsigned char *createBitmapFileHeader(int height, int width);
unsigned char *createBitmapInfoHeader(int height, int width);
~BitmapImageGenerator();
};
//TODO
// add constructor(height, width, filename)
// add function that filles image array from file
//MAIN ex:
// BitmapImageGenerator gen;
// int height = 1024;
// int width = 920;
// unsigned char image[height][width][3];
// char *imageFileName = "test22.bmp";
// int i, j;
// int x = 0;
// for (i = 0; i < height; i++)
// {
// for (j = 0; j < width; j++)
// {
// image[i][j][2] = (unsigned char)( (x^0)*100) ; ///red
// image[i][j][1] = (unsigned char)( (x^1)*100); ///green
// image[i][j][0] = (unsigned char)( (x^2)*100); ///blue
// }
// x = (x+1)%3;
// }
// gen.generateBitmapImage((unsigned char *)image, height, width, imageFileName);