Skip to content

Commit

Permalink
fix flipbook color mask for tlv (#2537)
Browse files Browse the repository at this point in the history
  • Loading branch information
shun-iwasawa authored and masafumi-inoue committed Apr 1, 2019
1 parent 2e274c7 commit de71c0d
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions toonz/sources/toonzlib/imagepainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,26 +394,22 @@ void Painter::doFlushRasterImages(const TRasterP &rin, int bg,

bool showChannelsOnMatte =
(chan != TRop::MChan && chan != 0 && !m_vSettings.m_greytones);
if ((!showChannelsOnMatte && !m_vSettings.m_useTexture && chan != 0) ||
(!showChannelsOnMatte && m_vSettings.m_useTexture &&
(chan == TRop::MChan || m_vSettings.m_greytones))) {
TRasterP app = _rin->create(_rin->getLx(), _rin->getLy());
try {
TRop::setChannel(_rin, app, chan, m_vSettings.m_greytones);
if (!m_vSettings.m_useTexture)
_rin = app;
else
ras = app;
} catch (...) {
}
}

if (m_vSettings.m_useTexture) {
TRaster32P checkBoardRas = buildCheckboard(bg, _rin->getSize());
GLRasterPainter::drawRaster(aff, checkBoardRas->getRawData(),
checkBoardRas->getWrap(), 4,
checkBoardRas->getSize(), true);
if (showChannelsOnMatte) ras = keepChannels(_rin, m_palette, chan);
if (showChannelsOnMatte)
ras = keepChannels(_rin, m_palette, chan);
else if (chan == TRop::MChan || m_vSettings.m_greytones) {
TRasterP app = ras->create(ras->getLx(), ras->getLy());
try {
TRop::setChannel(ras, app, chan, m_vSettings.m_greytones);
ras = app;
} catch (...) {
}
}
GLRasterPainter::drawRaster(aff, ras->getRawData(), ras->getWrap(), 4,
ras->getSize(), true);
ras->unlock();
Expand All @@ -437,9 +433,19 @@ void Painter::doFlushRasterImages(const TRasterP &rin, int bg,
quickput(ras, keepChannels(_rin, m_palette, chan), m_palette,
m_vSettings.m_useTexture ? TAffine() : aff * TTranslation(offs),
m_vSettings.m_useChecks);
else
else if (chan != 0) {
TRasterP app = ras->create(_rin->getLx(), _rin->getLy());
quickput(app, _rin, m_palette, TAffine(), m_vSettings.m_useChecks);
try {
TRop::setChannel(app, app, chan, m_vSettings.m_greytones);
} catch (...) {
}
quickput(ras, app, m_palette, aff * TTranslation(offs),
m_vSettings.m_useChecks);
} else {
quickput(ras, _rin, m_palette, aff * TTranslation(offs),
m_vSettings.m_useChecks);
}

glDisable(GL_BLEND);

Expand Down

0 comments on commit de71c0d

Please sign in to comment.