Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tusooa Zhu
Krita
Commits
b617b09a
Commit
b617b09a
authored
Feb 19, 2012
by
Halla Rempt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove obsolete enums
Substance and substrate channels won't happen anytime soon.
parent
3e9957a6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
25 deletions
+23
-25
krita/image/kis_async_merger.cpp
krita/image/kis_async_merger.cpp
+1
-0
krita/image/kis_convolution_painter.h
krita/image/kis_convolution_painter.h
+1
-1
krita/image/kis_layer.cc
krita/image/kis_layer.cc
+4
-4
krita/image/kis_paint_layer.cc
krita/image/kis_paint_layer.cc
+4
-4
krita/image/kis_painter.cc
krita/image/kis_painter.cc
+3
-3
krita/plugins/extensions/dockers/channeldocker/channelmodel.cpp
...plugins/extensions/dockers/channeldocker/channelmodel.cpp
+3
-2
krita/ui/kis_selection_manager_p.h
krita/ui/kis_selection_manager_p.h
+2
-2
libs/pigment/KoColorSpace.cpp
libs/pigment/KoColorSpace.cpp
+3
-5
libs/pigment/KoColorSpace.h
libs/pigment/KoColorSpace.h
+2
-4
No files found.
krita/image/kis_async_merger.cpp
View file @
b617b09a
...
...
@@ -320,6 +320,7 @@ bool KisAsyncMerger::compositeWithProjection(KisLayerSP layer, const QRect &rect
QBitArray
channelFlags
=
layer
->
channelFlags
();
// if the color spaces don't match we will have a problem with the channel flags
// because the channel flags from the source layer doesn't match with the colorspace of the projection device
// this leads to the situation that the wrong channels will be enabled/disabled
...
...
krita/image/kis_convolution_painter.h
View file @
b617b09a
...
...
@@ -52,7 +52,7 @@ public:
*
* The border op decides what to do with pixels too close to the edge of the rect as defined above.
*
* The channels flag determines which set out of color channels, alpha channels
, substance or substrate
* The channels flag determines which set out of color channels, alpha channels
.
* channels we convolve.
*
* Note that we do not (currently) support different kernels for
...
...
krita/image/kis_layer.cc
View file @
b617b09a
...
...
@@ -189,17 +189,17 @@ void KisLayer::setSectionModelProperties(const KoDocumentSectionModel::PropertyL
void
KisLayer
::
disableAlphaChannel
(
bool
disable
)
{
if
(
m_d
->
channelFlags
.
isEmpty
())
m_d
->
channelFlags
=
colorSpace
()
->
channelFlags
(
true
,
true
,
true
,
true
);
m_d
->
channelFlags
=
colorSpace
()
->
channelFlags
(
true
,
true
);
if
(
disable
)
m_d
->
channelFlags
&=
colorSpace
()
->
channelFlags
(
true
,
false
,
true
,
true
);
m_d
->
channelFlags
&=
colorSpace
()
->
channelFlags
(
true
,
false
);
else
m_d
->
channelFlags
|=
colorSpace
()
->
channelFlags
(
false
,
true
,
false
,
false
);
m_d
->
channelFlags
|=
colorSpace
()
->
channelFlags
(
false
,
true
);
}
bool
KisLayer
::
alphaChannelDisabled
()
const
{
QBitArray
flags
=
colorSpace
()
->
channelFlags
(
false
,
true
,
false
,
false
)
&
m_d
->
channelFlags
;
QBitArray
flags
=
colorSpace
()
->
channelFlags
(
false
,
true
)
&
m_d
->
channelFlags
;
return
flags
.
count
(
true
)
==
0
&&
!
m_d
->
channelFlags
.
isEmpty
();
}
...
...
krita/image/kis_paint_layer.cc
View file @
b617b09a
...
...
@@ -214,19 +214,19 @@ QRect KisPaintLayer::exactBounds() const
bool
KisPaintLayer
::
alphaLocked
()
const
{
QBitArray
flags
=
colorSpace
()
->
channelFlags
(
false
,
true
,
false
,
false
)
&
m_d
->
paintChannelFlags
;
QBitArray
flags
=
colorSpace
()
->
channelFlags
(
false
,
true
)
&
m_d
->
paintChannelFlags
;
return
flags
.
count
(
true
)
==
0
&&
!
m_d
->
paintChannelFlags
.
isEmpty
();
}
void
KisPaintLayer
::
setAlphaLocked
(
bool
lock
)
{
if
(
m_d
->
paintChannelFlags
.
isEmpty
())
m_d
->
paintChannelFlags
=
colorSpace
()
->
channelFlags
(
true
,
true
,
true
,
true
);
m_d
->
paintChannelFlags
=
colorSpace
()
->
channelFlags
(
true
,
true
);
if
(
lock
)
m_d
->
paintChannelFlags
&=
colorSpace
()
->
channelFlags
(
true
,
false
,
true
,
true
);
m_d
->
paintChannelFlags
&=
colorSpace
()
->
channelFlags
(
true
,
false
);
else
m_d
->
paintChannelFlags
|=
colorSpace
()
->
channelFlags
(
false
,
true
,
false
,
false
);
m_d
->
paintChannelFlags
|=
colorSpace
()
->
channelFlags
(
false
,
true
);
}
...
...
krita/image/kis_painter.cc
View file @
b617b09a
...
...
@@ -2324,11 +2324,11 @@ void KisPainter::setMaskImageSize(qint32 width, qint32 height)
void
KisPainter
::
setLockAlpha
(
bool
protect
)
{
if
(
d
->
paramInfo
.
channelFlags
.
isEmpty
())
{
d
->
paramInfo
.
channelFlags
=
d
->
colorSpace
->
channelFlags
(
true
,
true
,
true
,
true
);
d
->
paramInfo
.
channelFlags
=
d
->
colorSpace
->
channelFlags
(
true
,
true
);
}
QBitArray
switcher
=
d
->
colorSpace
->
channelFlags
(
protect
,
!
protect
,
protect
,
protect
);
d
->
colorSpace
->
channelFlags
(
protect
,
!
protect
);
if
(
protect
)
{
d
->
paramInfo
.
channelFlags
&=
switcher
;
...
...
@@ -2342,7 +2342,7 @@ void KisPainter::setLockAlpha(bool protect)
bool
KisPainter
::
alphaLocked
()
const
{
QBitArray
switcher
=
d
->
colorSpace
->
channelFlags
(
false
,
true
,
false
,
false
);
QBitArray
switcher
=
d
->
colorSpace
->
channelFlags
(
false
,
true
);
return
!
(
d
->
paramInfo
.
channelFlags
&
switcher
).
count
(
true
);
}
...
...
krita/plugins/extensions/dockers/channeldocker/channelmodel.cpp
View file @
b617b09a
...
...
@@ -95,14 +95,15 @@ bool ChannelModel::setData(const QModelIndex& index, const QVariant& value, int
if
(
index
.
column
()
==
0
)
{
QBitArray
flags
=
m_currentLayer
->
channelFlags
();
flags
=
flags
.
isEmpty
()
?
m_currentLayer
->
colorSpace
()
->
channelFlags
(
true
,
true
,
true
,
true
)
:
flags
;
flags
=
flags
.
isEmpty
()
?
m_currentLayer
->
colorSpace
()
->
channelFlags
(
true
,
true
)
:
flags
;
flags
.
setBit
(
channelIndex
,
value
.
toInt
()
==
Qt
::
Checked
);
m_currentLayer
->
setChannelFlags
(
flags
);
}
else
{
//if (index.column() == 1)
KisPaintLayer
*
paintLayer
=
dynamic_cast
<
KisPaintLayer
*>
(
m_currentLayer
.
data
());
QBitArray
flags
=
paintLayer
->
channelLockFlags
();
flags
=
flags
.
isEmpty
()
?
m_currentLayer
->
colorSpace
()
->
channelFlags
(
true
,
true
,
true
,
true
)
:
flags
;
flags
=
flags
.
isEmpty
()
?
m_currentLayer
->
colorSpace
()
->
channelFlags
(
true
,
true
)
:
flags
;
flags
.
setBit
(
channelIndex
,
value
.
toInt
()
==
Qt
::
Unchecked
);
paintLayer
->
setChannelLockFlags
(
flags
);
}
...
...
krita/ui/kis_selection_manager_p.h
View file @
b617b09a
...
...
@@ -481,12 +481,12 @@ public:
KisPaintDeviceSP
interm
=
new
KisPaintDevice
(
pixelSelection
->
colorSpace
());
KisConvolutionPainter
horizPainter
(
interm
);
horizPainter
.
setChannelFlags
(
interm
->
colorSpace
()
->
channelFlags
(
false
,
true
,
false
,
false
));
horizPainter
.
setChannelFlags
(
interm
->
colorSpace
()
->
channelFlags
(
false
,
true
));
horizPainter
.
applyMatrix
(
kernelHoriz
,
pixelSelection
,
rect
.
topLeft
(),
rect
.
topLeft
(),
rect
.
size
(),
BORDER_AVOID
);
horizPainter
.
end
();
KisConvolutionPainter
verticalPainter
(
pixelSelection
);
verticalPainter
.
setChannelFlags
(
pixelSelection
->
colorSpace
()
->
channelFlags
(
false
,
true
,
false
,
false
));
verticalPainter
.
setChannelFlags
(
pixelSelection
->
colorSpace
()
->
channelFlags
(
false
,
true
));
verticalPainter
.
applyMatrix
(
kernelVertical
,
interm
,
rect
.
topLeft
(),
rect
.
topLeft
(),
rect
.
size
(),
BORDER_AVOID
);
verticalPainter
.
end
();
}
...
...
libs/pigment/KoColorSpace.cpp
View file @
b617b09a
...
...
@@ -104,17 +104,15 @@ QList<KoChannelInfo *> KoColorSpace::channels() const
return
d
->
channels
;
}
QBitArray
KoColorSpace
::
channelFlags
(
bool
color
,
bool
alpha
,
bool
substance
,
bool
substrate
)
const
QBitArray
KoColorSpace
::
channelFlags
(
bool
color
,
bool
alpha
)
const
{
QBitArray
ba
(
d
->
channels
.
size
());
if
(
!
color
&&
!
alpha
&&
!
substance
&&
!
substrate
)
return
ba
;
if
(
!
color
&&
!
alpha
)
return
ba
;
for
(
int
i
=
0
;
i
<
d
->
channels
.
size
();
++
i
)
{
KoChannelInfo
*
channel
=
d
->
channels
.
at
(
i
);
if
((
color
&&
channel
->
channelType
()
==
KoChannelInfo
::
COLOR
)
||
(
alpha
&&
channel
->
channelType
()
==
KoChannelInfo
::
ALPHA
)
||
(
substrate
&&
channel
->
channelType
()
==
KoChannelInfo
::
SUBSTRATE
)
||
(
substance
&&
channel
->
channelType
()
==
KoChannelInfo
::
SUBSTANCE
))
(
alpha
&&
channel
->
channelType
()
==
KoChannelInfo
::
ALPHA
))
ba
.
setBit
(
i
,
true
);
}
return
ba
;
...
...
libs/pigment/KoColorSpace.h
View file @
b617b09a
...
...
@@ -118,7 +118,7 @@ public:
virtual
quint32
channelCount
()
const
=
0
;
/**
* The total number of color channels (excludes alpha
and substance
) for a single
* The total number of color channels (excludes alpha) for a single
* pixel in this color model.
*/
virtual
quint32
colorChannelCount
()
const
=
0
;
...
...
@@ -129,13 +129,11 @@ public:
*
* @param color if true, set all color channels to true
* @param alpha if true, set all alpha channels to true
* @param substance if true, set all substance channels to true
* @param substrate if true, set all substrate channels to true
*
* The order of channels is the colorspace descriptive order,
* not the pixel order.
*/
QBitArray
channelFlags
(
bool
color
=
true
,
bool
alpha
=
false
,
bool
substance
=
false
,
bool
substrate
=
false
)
const
;
QBitArray
channelFlags
(
bool
color
=
true
,
bool
alpha
=
false
)
const
;
/**
* The size in bytes of a single pixel in this color model
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment