forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcels_range.h
More file actions
65 lines (49 loc) · 1.21 KB
/
cels_range.h
File metadata and controls
65 lines (49 loc) · 1.21 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Aseprite Document Library
// Copyright (c) 2001-2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef DOC_CELS_RANGE_H_INCLUDED
#define DOC_CELS_RANGE_H_INCLUDED
#pragma once
#include "doc/frame.h"
#include "doc/object_id.h"
#include <set>
namespace doc {
class Cel;
class Sprite;
class CelsRange {
public:
enum Flags {
ALL,
UNIQUE,
};
CelsRange(const Sprite* sprite,
frame_t first, frame_t last, Flags flags = ALL);
class iterator {
public:
iterator();
iterator(const Sprite* sprite, frame_t first, frame_t last, Flags flags);
bool operator==(const iterator& other) const {
return m_cel == other.m_cel;
}
bool operator!=(const iterator& other) const {
return !operator==(other);
}
Cel* operator*() const {
return m_cel;
}
iterator& operator++();
private:
Cel* m_cel;
frame_t m_first, m_last;
Flags m_flags;
std::set<ObjectId> m_visited;
};
iterator begin() { return m_begin; }
iterator end() { return m_end; }
private:
iterator m_begin, m_end;
};
} // namespace doc
#endif