-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathImage.h
54 lines (43 loc) · 1.23 KB
/
Image.h
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
50
51
52
53
//========================================================================
// Image.h
//========================================================================
// Declarations for Image.
#ifndef IMAGE_H
#define IMAGE_H
#include "Vector.h"
#include <iostream>
#include <cstddef>
class Image
{
public:
// Constructors
Image();
Image( const Vector<int>& vec, size_t ncols, size_t nrows );
// Methods
size_t get_ncols() const;
size_t get_nrows() const;
int at( size_t x, size_t y ) const;
void set_label( char l );
char get_label() const;
int get_intensity() const;
void print() const;
// Operator overloading
int operator- ( const Image& rhs ) const;
bool operator< ( const Image& rhs ) const;
bool operator> ( const Image& rhs ) const;
bool operator<=( const Image& rhs ) const;
bool operator>=( const Image& rhs ) const;
bool operator==( const Image& rhs ) const;
bool operator!=( const Image& rhs ) const;
friend std::ostream& operator<<( std::ostream& output,
const Image& image );
private:
Vector<int> m_vec;
size_t m_cols;
size_t m_rows;
int m_intensity;
char m_label;
};
// Include inline definitions
#include "Image.inl"
#endif // IMAGE_H