Commit 17cbbe32 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Refactored pigment to allow pluggable composite ops -- the bits of

code that blend two pixels together, a la porter-duff. I have disabled
all colorspaces except rgbu8, alpha and lab, and rgbu8 is enabled only
by a hack pending the discussion I expect will happen shortly on how
to discourage code duplication through templates. For now, everything
seems to compile and Krita starts up.

Basically, every composite op for every depth for every colorspace
is now an object with a composite() method that does the work; whether we
need to expose this object outside pigment, or provide merely a proxy KoID
object is up for discussion.

Also added some Krita documentation, updated the todo, removed the old
startkrita for binary (autopackage-type) releases and removed some warnings.

CCMAIL: kimageshop@kde.org

svn path=/trunk/koffice/; revision=583883
parent 5572a4ff
......@@ -47,3 +47,9 @@ Polygone: NTAA
Polyline: NTAA
Duplicate Brush: NTAA
* AchiestDragon:
[20:19] <AchiestDragon> the main down side of using it is when using say the spray tool the mouse pointer shows it fine but once you start drawing it gets in the way , is there a way to get the pointer to change to something that is less in the way like a small crosshair
[20:22] <boud> AchiestDragon: yes, you can choose a crosshair cursor, however, then you won't have the brush outline anymore.
add_subdirectory( rgb_u8 )
add_subdirectory( rgb_u16 )
add_subdirectory( rgb_f32 )
add_subdirectory( gray_u8 )
add_subdirectory( gray_u16 )
add_subdirectory( cmyk_u8 )
add_subdirectory( cmyk_u16 )
add_subdirectory( lms_f32 )
add_subdirectory( wet )
#add_subdirectory( rgb_u16 )
#add_subdirectory( rgb_f32 )
#add_subdirectory( gray_u8 )
#add_subdirectory( gray_u16 )
#add_subdirectory( cmyk_u8 )
#add_subdirectory( cmyk_u16 )
#add_subdirectory( lms_f32 )
#add_subdirectory( wet )
MESSAGE(STATUS "Remember to port ycbcr_u16 and ycbcr_u8")
#add_subdirectory(ycbcr_u16)
#add_subdirectory(ycbcr_u8)
if(OPENEXR_FOUND)
add_subdirectory( rgb_f16half )
# add_subdirectory( rgb_f16half )
endif(OPENEXR_FOUND)
......@@ -563,7 +563,7 @@ void KisCmykU16ColorSpace::bitBlt(quint8 *dst,
quint8 U8_opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
quint16 opacity = UINT8_TO_UINT16(U8_opacity);
......
......@@ -77,7 +77,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint16 opacity);
void compositeMultiply(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint16 opacity);
......
......@@ -561,7 +561,7 @@ void KisCmykColorSpace::bitBlt(quint8 *dst,
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
switch (op.op()) {
......
......@@ -79,7 +79,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeMultiply(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
......
......@@ -508,7 +508,7 @@ void KisGrayU16ColorSpace::bitBlt(quint8 *dst,
quint8 U8_opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
quint16 opacity = UINT8_TO_UINT16(U8_opacity);
......
......@@ -75,7 +75,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint16 opacity);
void compositeMultiply(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint16 opacity);
......
......@@ -202,7 +202,7 @@ void KisGrayColorSpace::bitBlt(quint8 *dst,
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
switch (op.op()) {
case COMPOSITE_OVER:
......
......@@ -65,7 +65,7 @@ public:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
KoCompositeOpList userVisiblecompositeOps() const;
......
......@@ -352,7 +352,7 @@ void KisLmsF32ColorSpace::bitBlt(quint8 *dst,
quint8 U8_opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
float opacity = UINT8_TO_FLOAT(U8_opacity);
......
......@@ -85,7 +85,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, float opacity);
void compositeErase(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, float opacity);
......
......@@ -795,7 +795,7 @@ void KisRgbF16HalfColorSpace::bitBlt(quint8 *dst,
quint8 U8_opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
half opacity = UINT8_TO_HALF(U8_opacity);
......
......@@ -85,7 +85,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, half opacity);
void compositeMultiply(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, half opacity);
......
......@@ -794,7 +794,7 @@ void KisRgbF32ColorSpace::bitBlt(quint8 *dst,
quint8 U8_opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
float opacity = UINT8_TO_FLOAT(U8_opacity);
......
......@@ -89,7 +89,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, float opacity);
void compositeMultiply(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, float opacity);
......
......@@ -715,7 +715,7 @@ void KisRgbU16ColorSpace::bitBlt(quint8 *dst,
quint8 U8_opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
quint16 opacity = UINT8_TO_UINT16(U8_opacity);
......
......@@ -78,7 +78,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint16 opacity);
void compositeMultiply(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint16 opacity);
......
......@@ -10,7 +10,7 @@ endif(KUNITTEST_FOUND)
########### next target ###############
set(kritargb_LIB_SRCS kis_rgb_colorspace.cc )
set(kritargb_LIB_SRCS kis_rgb_colorspace.cc kis_rgb_u8_compositeop.cc)
kde4_automoc(${kritargb_LIB_SRCS})
......@@ -40,43 +40,3 @@ install(TARGETS kritargbplugin DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
install( FILES kritargbplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR})
#original Makefile.am contents follow:
## Install the desktop file needed to detect the plugin
#kde_services_DATA = kritargbplugin.desktop
#
#INCLUDES = -I$(srcdir)/../../sdk \
# -I$(srcdir)/../../kritacolor/color_strategy/ \
# -I$(srcdir)/../../kritacolor/ \
# $(KOFFICE_INCLUDES) \
# $(all_includes)
#
#lib_LTLIBRARIES = libkritargb.la
#libkritargb_la_SOURCES = kis_rgb_colorspace.cc
#libkritargb_la_LDFLAGS = $(all_libraries)
#libkritargb_la_LIBADD = ../../kritacolor/libkritacolor.la
#
## Install this plugin in the KDE modules directory
#kde_module_LTLIBRARIES = kritargbplugin.la
#
## Srcs for the plugin
#kritargbplugin_la_SOURCES = rgb_plugin.cc
#noinst_HEADERS = rgb_plugin.h kis_rgb_colorspace.h
#
#kritargbplugin_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
#kritargbplugin_la_LIBADD = libkritargb.la ../../kritacolor/libkritacolor.la
#
#kritargbplugin_la_METASOURCES = AUTO
##METASOURCES = AUTO # XXX: which of the two?
#
#if include_kunittest_tests
#TESTSDIR = tests
#endif
#
#SUBDIRS = . templates $(TESTSDIR)
#
......@@ -28,6 +28,8 @@ const quint8 PIXEL_BLUE = 0;
const quint8 PIXEL_GREEN = 1;
const quint8 PIXEL_RED = 2;
const quint8 PIXEL_ALPHA = 3;
const qint32 MAX_CHANNEL_RGB = 3;
const qint32 MAX_CHANNEL_RGBA = 4;
class KRITACOLOR_EXPORT KisRgbColorSpace : public KoU8ColorSpaceTrait, public KoLcmsColorSpaceTrait {
public:
......@@ -57,36 +59,6 @@ public:
qint32 renderingIntent = INTENT_PERCEPTUAL,
float exposure = 0.0f);
virtual KoCompositeOpList userVisiblecompositeOps() const;
protected:
virtual void bitBlt(quint8 *dst,
qint32 dstRowStride,
const quint8 *src,
qint32 srcRowStride,
const quint8 *srcAlphaMask,
qint32 maskRowStride,
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeMultiply(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeDivide(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeScreen(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeOverlay(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeDodge(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeBurn(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeDarken(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeLighten(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeHue(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeSaturation(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeValue(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeColor(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeErase(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
};
class KisRgbColorSpaceFactory : public KoColorSpaceFactory
......
This diff is collapsed.
/*
* Copyright (c) 2006 Boudewijn Rempt <boud@valdyas.org>
*
* This program is free software const; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation const; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY const; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program const; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Some code is derived from GraphicsMagick/magick/composite.c and is
subject to the following license and copyright:
Copyright (C) 2002 GraphicsMagick Group, an organization dedicated
to making software imaging solutions freely available.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
("GraphicsMagick"), to deal in GraphicsMagick without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of GraphicsMagick,
and to permit persons to whom GraphicsMagick is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of GraphicsMagick.
The software is provided "as is", without warranty of any kind, express
or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement.
In no event shall GraphicsMagick Group be liable for any claim,
damages or other liability, whether in an action of contract, tort or
otherwise, arising from, out of or in connection with GraphicsMagick
or the use or other dealings in GraphicsMagick.
Except as contained in this notice, the name of the GraphicsMagick
Group shall not be used in advertising or otherwise to promote the
sale, use or other dealings in GraphicsMagick without prior written
authorization from the GraphicsMagick Group.
Other code is derived from gwenview/src/qxcfi.* - this is released under
the terms of the LGPL
*/
#ifndef KIS_RGB_U8_COMPOSITEOP
#define KIS_RGB_U8_COMPOSITEOP
#include <KoCompositeOp.h>
/**
* Ugly class that contains all rgb composite ops
*/
class KisRgbU8CompositeOp : public KoCompositeOp {
public:
KisRgbU8CompositeOp(KoColorSpace * cs, const QString& id, const QString& description, const bool userVisible = true);
virtual ~KisRgbU8CompositeOp() {};
void composite(quint8 *dstRowStart, qint32 dstRowStride,
const quint8 *srcRowStart, qint32 srcRowStride,
const quint8 *maskRowStart, qint32 maskRowStride,
qint32 rows, qint32 numColumns,
quint8 opacity,
const QBitArray & channelFlags) const;
private:
void compositeOver(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeMultiply(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeDivide(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeScreen(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeOverlay(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeDodge(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeBurn(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeDarken(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeLighten(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeHue(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeSaturation(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeValue(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeColor(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeErase(quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowSize, qint32 rows, qint32 columns, quint8 opacity) const;
void compositeIn(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeOut(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeAtop(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeXor(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositePlus(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeMinus(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeAdd(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeSubtract(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeDiff(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeBumpmap(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeCopyChannel(quint8 pixel, quint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeCopyRed(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeCopyGreen(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeCopyBlue(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeCopyOpacity(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeClear(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeDissolve(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
void compositeCopy(qint32 pixelSize, quint8 *dst, qint32 dstRowSize, const quint8 *src, qint32 srcRowSize, const quint8 *mask, qint32 maskRowStride,qint32 rows, qint32 cols, quint8 opacity = OPACITY_OPAQUE) const;
private:
quint8 m_pixelSize;
};
#endif
......@@ -367,7 +367,7 @@ void KisWetColorSpace::bitBlt(quint8 *dst,
quint8 /*opacity*/,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
if (rows <= 0 || cols <= 0)
return;
......
......@@ -169,7 +169,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
private:
// This was static, but since we have only one instance of the color strategy,
......
......@@ -361,7 +361,7 @@ void KisWetStickyColorSpace::bitBlt(quint8 *dst,
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op)
const KoCompositeOp* op)
{
switch (op.op()) {
case COMPOSITE_UNDEF:
......
......@@ -128,7 +128,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
virtual bool convertPixelsTo(const quint8 * src, KoColorProfile * srcProfile,
......
......@@ -213,7 +213,7 @@ QImage KisYCbCrU16ColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width
}
void KisYCbCrU16ColorSpace::bitBlt(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *srcAlphaMask, Q_INT32 maskRowStride, Q_UINT8 opacity, Q_INT32 rows, Q_INT32 cols, const KoCompositeOp& op)
void KisYCbCrU16ColorSpace::bitBlt(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *srcAlphaMask, Q_INT32 maskRowStride, Q_UINT8 opacity, Q_INT32 rows, Q_INT32 cols, const KoCompositeOp* op)
{
switch (op.op()) {
case COMPOSITE_UNDEF:
......
......@@ -73,7 +73,7 @@ class KisYCbCrU16ColorSpace : public KoU16ColorSpaceTrait
Q_UINT8 opacity,
Q_INT32 rows,
Q_INT32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
void compositeOver(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT8 opacity);
void compositeErase(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT8 opacity);
......
......@@ -213,7 +213,7 @@ QImage KisYCbCrU8ColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width,
}
void KisYCbCrU8ColorSpace::bitBlt(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *srcAlphaMask, Q_INT32 maskRowStride, Q_UINT8 opacity, Q_INT32 rows, Q_INT32 cols, const KoCompositeOp& op)
void KisYCbCrU8ColorSpace::bitBlt(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *srcAlphaMask, Q_INT32 maskRowStride, Q_UINT8 opacity, Q_INT32 rows, Q_INT32 cols, const KoCompositeOp* op)
{
switch (op.op()) {
case COMPOSITE_UNDEF:
......
......@@ -73,7 +73,7 @@ class KisYCbCrU8ColorSpace : public KoU8ColorSpaceTrait
Q_UINT8 opacity,
Q_INT32 rows,
Q_INT32 cols,
const KoCompositeOp& op);
const KoCompositeOp* op);
void compositeOver(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT8 opacity);
void compositeErase(Q_UINT8 *dst, Q_INT32 dstRowStride, const Q_UINT8 *src, Q_INT32 srcRowStride, const Q_UINT8 *mask, Q_INT32 maskRowStride, Q_INT32 rows, Q_INT32 columns, Q_UINT8 opacity);
......
From lmarso@gmail.com Fri Jan 6 17:42:13 2006
The following site *legitimately with permission from the author* has
two chapters online of Dan Margulis' exciting book "Photoshop LAB
Color". (I do not know Dan or his publisher and for goodness sake I'm
NOT promoting the book).
http://www.ledet.com/margulis/articles.html
Page 2 of the "Chapter 9" sample depicts color curves under LAB in
Photoshop. You will note that they are "inverted" in that they go
from light at the lower left hand corner to dark at the upper left.
The L channel is luminosity, A rebalances Green and Magenta, and B
rebalances Blue and Yellow. Page 12 has another example of common
manipulations to LAB curves.
Page 10 shows the fascinating color channel layer blending tool in
Photoshop. You can pick a color channel, then selectively decide
where along the gamut you want color blended with the layers below,
including the ability to decide upon a fading range rather than a
fixed endpoint. (This particular widget is probably off in the
future, as it is an adjustment layer, and as I understand it, Krita
developers are struggling with the basic layer model).
The "before and after" of a downtown alongside waterfront on Page 16
shows the use of these two tools together, to modify an image and
selectively blend down the result.
Unfortunately, these samples do not include any images or examples of
the color channel value averaging tool based on a defined radius.
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
From lmarso@gmail.com Fri Jan 6 02:50:59 2006
Boudewijn and I discussed the potential utility of Krita to work on
curves for the channels of LAB colorspace, once the color
profile-aware color adjustment tool (temporarily out of CVS) is
restored to the build sources.
I have offered to write up what I know about the standard presentation
of LAB curves, e.g., in Photoshop, which is generally inverted from
lighter values on the lower left to darker values on the upper right,
and using color values from -128 to zero at midpoint to 128 (that's in
8 bit).
I presume the tool will initially work like the Cinepaint analogue,
doing a proper conversion in each direction, but without inverting the
curves or remapping the color values to the standard scale.
One thing I don't know is if you can resize the curves widget.
Manipulations of curves in the A and B channels, in particular, often
require considerable precision in a small area around the center
point. The ability to significantly enlarge the curves widget would
have great value.
I'll watch for the return of the color profile-aware color adjustment
tool code, and I'll try and help if anyone wants to move toward the
standard presentation of LAB from there.
Boudewijn and I also discussed the Photoshop "color picker" tool which
permits you to select a radius over which values are averaged. In
addition, Photoshop lets you click on multiple points with values
you're focusing on for manipulation by curves. You can click on and
save multiple averages, which appear one atop another. Then, when you
manipulate the curves, a column appears alongside those saved
averages, and you can watch how your curve manipulations change the
average values. It's sort of a "preview" of the effect of your curve
manipulations, expressed in color values averaged over a radius of
pixels.