-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitmap.hpp
More file actions
34 lines (27 loc) · 728 Bytes
/
bitmap.hpp
File metadata and controls
34 lines (27 loc) · 728 Bytes
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
/* This header presents the classes and methods for opening, reading and writing to
the bitmap file that kmeans++ will be used on.
Fluturel Adrian, (c) 2018
*/
#pragma once
#include <stdio.h>
#include "pixel.hpp"
#define HEADER_SIZE 40
#define DIB_SIZE 14
class BitmapImage {
Pixels values;
long width, height;
short bitDepth;
char header[HEADER_SIZE+DIB_SIZE];
FILE* stream;
public:
explicit BitmapImage(const char* filename);
int readHeader();
long readArray();
int writeToFile(const char *filename) const;
char& operator[](const int &index);
const char& operator[](const int &index) const;
~BitmapImage();
const long& getHeight() const;
const long& getWidth() const;
const short& getBitDepth() const;
};