#include <RectanizerSkyline.h>
Definition at line 24 of file RectanizerSkyline.h.
◆ RectanizerSkyline()
skgpu::RectanizerSkyline::RectanizerSkyline |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
|
inline |
◆ ~RectanizerSkyline()
skgpu::RectanizerSkyline::~RectanizerSkyline |
( |
| ) |
|
|
inlinefinal |
◆ addRect()
Implements skgpu::Rectanizer.
Definition at line 17 of file RectanizerSkyline.cpp.
17 {
18 if ((
unsigned)
width > (
unsigned)this->
width() ||
20 return false;
21 }
22
23
24 int bestWidth = this->
width() + 1;
25 int bestX = 0;
26 int bestY = this->
height() + 1;
27 int bestIndex = -1;
28 for (
int i = 0;
i < fSkyline.
size(); ++
i) {
31
32 if (
y < bestY || (
y == bestY && fSkyline[
i].fWidth < bestWidth)) {
34 bestWidth = fSkyline[
i].fWidth;
35 bestX = fSkyline[
i].fX;
37 }
38 }
39 }
40
41
42 if (-1 != bestIndex) {
43 this->addSkylineLevel(bestIndex, bestX, bestY,
width,
height);
46
48 return true;
49 }
50
53 return false;
54}
int16_t fY
y-axis value used by SkIPoint16
int16_t fX
x-axis value used by SkIPoint16
◆ percentFull()
float skgpu::RectanizerSkyline::percentFull |
( |
| ) |
const |
|
inlinefinalvirtual |
◆ reset()
void skgpu::RectanizerSkyline::reset |
( |
| ) |
|
|
inlinefinalvirtual |
The documentation for this class was generated from the following files: