LMPacker indents fix

This commit is contained in:
MihailRis 2024-03-08 22:31:32 +03:00
parent 07dc12143e
commit 93979b2e53
2 changed files with 124 additions and 124 deletions

View file

@ -10,44 +10,44 @@
#include <vector>
struct rectangle {
unsigned int idx;
int x;
int y;
int width;
int height;
int extX = 0;
int extY = 0;
unsigned int idx;
int x;
int y;
int width;
int height;
int extX = 0;
int extY = 0;
rectangle(unsigned int idx, int x, int y, int width, int height)
: idx(idx), x(x), y(y), width(width), height(height){
}
rectangle(unsigned int idx, int x, int y, int width, int height)
: idx(idx), x(x), y(y), width(width), height(height){
}
};
class LMPacker {
std::vector<rectangle> rects;
std::vector<rectangle*> placed;
uint32_t width = 0;
uint32_t height = 0;
rectangle*** matrix = nullptr;
uint32_t mbit = 0;
std::vector<rectangle> rects;
std::vector<rectangle*> placed;
uint32_t width = 0;
uint32_t height = 0;
rectangle*** matrix = nullptr;
uint32_t mbit = 0;
void cleanup();
bool place(rectangle* rect, uint32_t vstep);
void cleanup();
bool place(rectangle* rect, uint32_t vstep);
public:
LMPacker(const uint32_t sizes[], size_t length);
virtual ~LMPacker();
LMPacker(const uint32_t sizes[], size_t length);
virtual ~LMPacker();
bool buildCompact(uint32_t width, uint32_t height, uint16_t extension) {
return build(width, height, extension, 0, 1);
}
bool buildFast(uint32_t width, uint32_t height, uint16_t extension) {
return build(width, height, extension, 1, 2);
}
bool build(uint32_t width, uint32_t height, uint16_t extension, uint32_t mbit, uint32_t vstep);
bool buildCompact(uint32_t width, uint32_t height, uint16_t extension) {
return build(width, height, extension, 0, 1);
}
bool buildFast(uint32_t width, uint32_t height, uint16_t extension) {
return build(width, height, extension, 1, 2);
}
bool build(uint32_t width, uint32_t height, uint16_t extension, uint32_t mbit, uint32_t vstep);
std::vector<rectangle> getResult() {
return rects;
}
std::vector<rectangle> getResult() {
return rects;
}
};
#endif /* LMPACKER_H_ */