-
Notifications
You must be signed in to change notification settings - Fork 26
/
imagefile.h
96 lines (78 loc) · 1.49 KB
/
imagefile.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef IMAGEFILE_H
#define IMAGEFILE_H
#include <QFileInfo>
#include <QList>
#include "platefile.h"
/*
* Represents a single image with associated YAML files
*
* If an image file is "car.jpg", associated YAML files will be named
*
* car-0.yaml
* car-1.yaml
* etc.
*/
class ImageFile
{
public:
ImageFile();
ImageFile(const QFileInfo &fileInfo);
/*
* Image file info
*/
const QFileInfo &fileInfo() const;
/*
* Plate name template
*/
QString plateNameTemplate() const;
/*
* Associated plates
*/
PlateFileList plates() const;
/*
* Add new non-autonumbered plate
*/
void addPlate(const PlateFile &plateFile);
/*
* Update plates
*/
void setPlates(const PlateFileList &newPlateFileList);
/*
* Image has been moved and its methods and properties
* should not be used anymore
*/
bool moved() const;
void setMoved(bool moved);
private:
QFileInfo m_fileInfo;
QString m_plateNameTemplate;
PlateFileList m_plates;
bool m_moved;
};
inline
const QFileInfo &ImageFile::fileInfo() const
{
return m_fileInfo;
}
inline
QString ImageFile::plateNameTemplate() const
{
return m_plateNameTemplate;
}
inline
PlateFileList ImageFile::plates() const
{
return m_plates;
}
inline
bool ImageFile::moved() const
{
return m_moved;
}
inline
void ImageFile::setMoved(bool moved)
{
m_moved = moved;
}
using ImageFileList = QList<ImageFile>;
#endif // IMAGEFILE_H