Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

consider alpha channel of the filter color

shun-iwasawa646fd4f121c6
diff --git a/toonz/sources/toonz/xshcolumnviewer.cpp b/toonz/sources/toonz/xshcolumnviewer.cpp
index ca2cc4b1d..d9e38f37e 100644
--- a/toonz/sources/toonz/xshcolumnviewer.cpp
+++ b/toonz/sources/toonz/xshcolumnviewer.cpp
@@ -116,7 +116,21 @@ bool containsRasterLevel(TColumnSelection *selection) {
const QIcon getColorChipIcon(TPixel32 color) {
QColor qCol((int)color.r, (int)color.g, (int)color.b, (int)color.m);
QPixmap pixmap(12, 12);
- pixmap.fill(qCol);
+ if (color.m == TPixel32::maxChannelValue) {
+ pixmap.fill(qCol);
+ return QIcon(pixmap);
+ }
+ static QPixmap checkPm;
+ if (checkPm.isNull()) {
+ checkPm = QPixmap(12, 12);
+ checkPm.fill(Qt::white);
+ QPainter cp(&checkPm);
+ cp.fillRect(0, 0, 6, 6, Qt::black);
+ cp.fillRect(6, 6, 6, 6, Qt::black);
+ }
+ pixmap = checkPm;
+ QPainter p(&pixmap);
+ p.fillRect(0, 0, 12, 12, qCol);
return QIcon(pixmap);
}
diff --git a/toonz/sources/toonzlib/scenefx.cpp b/toonz/sources/toonzlib/scenefx.cpp
index 1bf546894..691b5a129 100644
--- a/toonz/sources/toonzlib/scenefx.cpp
+++ b/toonz/sources/toonzlib/scenefx.cpp
@@ -977,7 +977,9 @@ PlacedFx FxBuilder::makePF(TLevelColumnFx *lcfx) {
TPixel32 colorScale = m_scene->getProperties()->getColorFilterColor(
column->getColorFilterId());
if (colorScale != TPixel::Black) {
- colorScale.m = column->getOpacity();
+ colorScale.m = (typename TPixel32::Channel)((int)colorScale.m *
+ (int)column->getOpacity() /
+ TPixel32::maxChannelValue);
pf.m_fx = TFxUtil::makeColumnColorFilter(pf.m_fx, colorScale);
}
}
diff --git a/toonz/sources/toonzlib/stagevisitor.cpp b/toonz/sources/toonzlib/stagevisitor.cpp
index 304ba5362..5e1c90c82 100644
--- a/toonz/sources/toonzlib/stagevisitor.cpp
+++ b/toonz/sources/toonzlib/stagevisitor.cpp
@@ -549,7 +549,9 @@ void RasterPainter::flushRasterImages() {
} else {
if (m_nodes[i].m_filterColor != TPixel32::Black) {
colorscale = m_nodes[i].m_filterColor;
- colorscale.m = m_nodes[i].m_alpha;
+ colorscale.m = (typename TPixel32::Channel)((int)colorscale.m *
+ (int)m_nodes[i].m_alpha /
+ TPixel32::maxChannelValue);
}
inksOnly = tc & ToonzCheck::eInksOnly;
}
@@ -843,9 +845,9 @@ void RasterPainter::onVectorImage(TVectorImage *vi,
TPalette *vPalette = vi->getPalette();
TPixel32 bgColor = TPixel32::White;
- int tc = (m_checkFlags && player.m_isCurrentColumn)
- ? ToonzCheck::instance()->getChecks()
- : 0;
+ int tc = (m_checkFlags && player.m_isCurrentColumn)
+ ? ToonzCheck::instance()->getChecks()
+ : 0;
bool inksOnly = tc & ToonzCheck::eInksOnly;
int oldFrame = vPalette->getFrame();
@@ -1017,7 +1019,7 @@ void RasterPainter::onRasterImage(TRasterImage *ri,
? 0.9
: (1.0 - OnionSkinMask::getOnionSkinFade(
player.m_onionSkinDistance));
- alpha = tcrop(tround(onionSkiFade * 255.0), 0, 255);
+ alpha = tcrop(tround(onionSkiFade * 255.0), 0, 255);
if (player.m_isShiftAndTraceEnabled &&
!Preferences::instance()->areOnionColorsUsedForShiftAndTraceGhosts())
onionMode = Node::eOnionSkinNone;
@@ -1080,7 +1082,7 @@ void RasterPainter::onToonzImage(TToonzImage *ti, const Stage::Player &player) {
? 0.9
: (1.0 - OnionSkinMask::getOnionSkinFade(
player.m_onionSkinDistance));
- alpha = tcrop(tround(onionSkiFade * 255.0), 0, 255);
+ alpha = tcrop(tround(onionSkiFade * 255.0), 0, 255);
if (player.m_isShiftAndTraceEnabled &&
!Preferences::instance()->areOnionColorsUsedForShiftAndTraceGhosts())
@@ -1369,9 +1371,9 @@ void onMeshImage(TMeshImage *mi, const Stage::Player &player,
assert(mi);
static const double soMinColor[4] = {0.0, 0.0, 0.0,
- 0.6}; // Translucent black
+ 0.6}; // Translucent black
static const double soMaxColor[4] = {1.0, 1.0, 1.0,
- 0.6}; // Translucent white
+ 0.6}; // Translucent white
static const double rigMinColor[4] = {0.0, 1.0, 0.0,
0.6}; // Translucent green
static const double rigMaxColor[4] = {1.0, 0.0, 0.0, 0.6}; // Translucent red