tahoma2d/toonz/sources/toonzlib/tvectorimageutils.cpp

27 lines
752 B
C++
Raw Normal View History

2016-03-19 06:57:51 +13:00
#include "toonz/tvectorimageutils.h"
#include "tpalette.h"
//-------------------------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
void getGroupsList(const TVectorImageP &vi, std::vector<TVectorImageP> &list) {
// Scan vi's strokes
unsigned int i, j, strokeCount = vi->getStrokeCount();
for (i = 0; i < strokeCount;) {
std::vector<int> indexes;
// Find the group interval
for (j = i;
j < strokeCount && vi->areDifferentGroup(i, false, j, false) == -1;
++j)
indexes.push_back(j);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
// Fill a new list item with the strokes
TVectorImageP item(vi->splitImage(indexes, false));
if (item->getPalette() == 0) item->setPalette(new TPalette);
list.push_back(item);
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
i = j;
}
2016-03-19 06:57:51 +13:00
}