Packs rectangles into a specified area without rotating them. More...
#include <rectangle_packer.h>
Public Member Functions | |
virtual | ~RectanglePacker () |
virtual bool | AddRect (int width, int height, IPoint16 *loc)=0 |
Attempt to add a rect without moving already placed rectangles. More... | |
virtual Scalar | PercentFull () const =0 |
Returns how much area has been filled with rectangles. More... | |
virtual void | Reset ()=0 |
Empty out all previously added rectangles. More... | |
Static Public Member Functions | |
static std::shared_ptr< RectanglePacker > | Factory (int width, int height) |
Return an empty packer with area specified by width and height. More... | |
Protected Member Functions | |
RectanglePacker (int width, int height) | |
int | width () const |
int | height () const |
Packs rectangles into a specified area without rotating them.
Definition at line 27 of file rectangle_packer.h.
|
inlinevirtual |
Definition at line 34 of file rectangle_packer.h.
|
inlineprotected |
Definition at line 61 of file rectangle_packer.h.
|
pure virtual |
Attempt to add a rect without moving already placed rectangles.
[in] | width | The width of the rectangle to add. |
[in] | height | The height of the rectangle to add. |
[out] | loc | If successful, will be set to the position of the upper-left corner of the rectangle. |
Implemented in impeller::SkylineRectanglePacker.
|
static |
Return an empty packer with area specified by width and height.
Definition at line 175 of file rectangle_packer.cc.
References height(), and width().
Referenced by impeller::ComputeNextAtlasSize(), impeller::testing::TEST(), and impeller::testing::TEST_P().
|
inlineprotected |
Definition at line 67 of file rectangle_packer.h.
Referenced by impeller::SkylineRectanglePacker::AddRect(), Factory(), impeller::SkylineRectanglePacker::PercentFull(), and RectanglePacker().
|
pure virtual |
Returns how much area has been filled with rectangles.
Implemented in impeller::SkylineRectanglePacker.
|
pure virtual |
Empty out all previously added rectangles.
Implemented in impeller::SkylineRectanglePacker.
|
inlineprotected |
Definition at line 66 of file rectangle_packer.h.
Referenced by impeller::SkylineRectanglePacker::AddRect(), Factory(), impeller::SkylineRectanglePacker::PercentFull(), RectanglePacker(), and impeller::SkylineRectanglePacker::Reset().