forked from larrylindsey/imageprocessing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImageStack.h
58 lines (35 loc) · 1.36 KB
/
ImageStack.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
#ifndef IMAGEPROCESSING_IMAGE_STACK_H__
#define IMAGEPROCESSING_IMAGE_STACK_H__
#include <pipeline/all.h>
#include <imageprocessing/Image.h>
class ImageStack : public pipeline::Data {
// Image objects are shared between ImageStack
typedef std::vector<boost::shared_ptr<Image> > sections_type;
public:
typedef sections_type::iterator iterator;
typedef sections_type::const_iterator const_iterator;
/**
* Remove all sections.
*/
void clear();
/**
* Add a single section to this set of sections.
*/
void add(boost::shared_ptr<Image> section);
/**
* Add a set of sections to this set of sections.
*/
void addAll(boost::shared_ptr<ImageStack> stack);
const const_iterator begin() const { return _sections.begin(); }
iterator begin() { return _sections.begin(); }
const const_iterator end() const { return _sections.end(); }
iterator end() { return _sections.end(); }
boost::shared_ptr<Image> operator[](unsigned int i) { return _sections[i]; }
boost::shared_ptr<const Image> operator[](unsigned int i) const { return _sections[i]; }
unsigned int size() const { return _sections.size(); }
unsigned int width() const { return (size() > 0 ? _sections[0]->width() : 0); }
unsigned int height() const { return (size() > 0 ? _sections[0]->height() : 0); }
private:
sections_type _sections;
};
#endif // IMAGEPROCESSING_IMAGE_STACK_H__