Commit 226a91f2 authored by Boudewijn Rempt's avatar Boudewijn Rempt

* Fix memory leak in palette manager

* Fix focus bug with dockers
* Removed superfluous headers here and there
* Made sure we code against the interface, not the implementation of KisColorSpace.
* More API separation from implementation
* Replaced all QUANTUM with Q_UINT8 -- we will never do the ImageMagick trick of
  redefining QUANTUM to Q_UINT16 to have instant 16-bit support. We can do better 
  than that.
* Removed obsolete and empty toolbar 
* Added a little documentation about the sdk effort.

svn path=/trunk/koffice/; revision=460097
parent f921d284
INCLUDES = $(KOFFICE_INCLUDES) -I$(interfacedir) $(KOPAINTER_INCLUDES) $(all_includes)
INCLUDES = -I$(srcdir)/sdk \
$(KOFFICE_INCLUDES) -I$(interfacedir) $(KOPAINTER_INCLUDES) $(all_includes)
## The common lib, shared between the part, the plugins, and the filters
lib_LTLIBRARIES = libkritacommon.la
......@@ -30,7 +31,7 @@ kdemimedir = $(kde_mimedir)/application
rcdir = $(kde_datadir)/krita
rc_DATA = krita.rc krita_readonly.rc
SUBDIRS = ui core sdk . dtd paintops tools modules plugins data pics
SUBDIRS = sdk ui core . dtd paintops tools modules plugins data pics
# Needed to compile libkritacommon.la, which has no source files to itself
# but everything in static libs.
......
Bugs
* Save separations as grayscale -> save is not at all colorspace aware!
* On opening a second image after loading first image but not changing it,
the second image should be loaded in a second view and not replace the
first image in the first view.
* On opening a second image after loading first image but not changing it,
the second image should be loaded in a second view and not replace the
first image in the first view.
Transform tool (CBR)
......@@ -31,7 +30,8 @@ Integration
* There is currently no kimgio module for Krita images: implement one by
saving a rendered png image into the krita file and extracting that from
kimgio.
kimgio. (Saving of a png image in .kra files is done; now we just need to
add the kimgio file)
* Hack koMainWindow so the save warning doesn't happen for Krita (BSAR)
......@@ -51,7 +51,7 @@ Colorspace independence (found with the test colorstrategy)
* get rid of QUANTUM
* Check and double check the cms capabilities: especially the use of
profiles in the render/convert/edit paths.
* Merge grayscale layers back into one color image.
* Merge grayscale layers back into one color image.
Core
......@@ -75,7 +75,6 @@ Core
* On copying paint devices, do not actually copy the tiles, but only create
new tiles when there is change. Also create a memory pool for creating new tiles (BART)
File Format:
* Save & load all annotations in .kra files
......@@ -85,40 +84,36 @@ File Format:
Import/Export
* Fix gimp XCF PSD and import/export (ImageMagick hacking...)
* Fix imports to import metadata and image files in non-rgb encodings -> move import
export code to color strategies.
* Fix imports to import metadata.
User Interface
* Add a good crosshair cursor and a crosshair cursor that extends to the rulers.
* Add a cheatsheet widget that integrates with knewstuff to have tutorials that people
can download and follow from Krita.
* Add opacity widget (One that grows more white or transparent (showing those gray blocks) based on the
* Add opacity widget (One that grows more white or transparent (showing those gray blocks) based on the
input)
* Add out-of-gamut selection
* Fix crash with tablet because of tool refactoring.
* Fix layout problems in tool option widgets.
* Disable dragging the toolbox from dock position to dock position (see Karbon)
* Disable all relevant actions when a layer is locked or invisible. See bug #90456. Show locked status of current layer in statusbar.
* Add link check to new image dialog to sync width and height
* Rounding in opacity spinner is wrong: what starts out as 100% is actually not OPACITY_MAX...
* The description field in color settings is empty
* Create brush-shape outline cursor
* Implement the following dialogs / widgets:
* Add out-of-gamut selection
* Fix crash with tablet because of tool refactoring.
* Fix layout problems in tool option widgets.
* Disable dragging the toolbox from dock position to dock position (see Karbon)
* Disable all relevant actions when a layer is locked or invisible. See bug #90456. Show locked status of current layer in statusbar.
* Add link check to new image dialog to sync width and height
* Rounding in opacity spinner is wrong: what starts out as 100% is actually not OPACITY_MAX...
* The description field in color settings is empty
* Implement the following dialogs / widgets:
- Variations (#Boudewijn)
- Gradient: remove the autogradient dialog and make into a proper
gradient dialog, and allow saving gradients.
* Improve the preview widget - see "doc/the preview widget"
* Show which tool is associated with which pointer (mouse, stylus, eraser, other stylusses) In the statusbar.
* Allow guides to be disabled. Allow diagonal guides (useful
for perspective drawings) Bug #108398
* Allow snapping to guides.
* Create templates for often-used image formats. Add save-as-template
* Make rotate actions consistent between layer and image
* Add deselect with rmb -- maybe also selectable actions with other tools on rmb?
* Fix crop tool: when pressing shift, keep aspect ratio, implement gray mask.
* Improve the preview widget - see "doc/the preview widget"
* Show which tool is associated with which pointer (mouse, stylus, eraser, other stylusses) In the statusbar.
* Allow guides to be disabled. Allow diagonal guides (useful
for perspective drawings) Bug #108398
* Allow snapping to guides.
* Create templates for often-used image formats. Add save-as-template
* Add deselect with rmb -- maybe also selectable actions with other tools on rmb?
* Fix crop tool: when pressing shift, keep aspect ratio, implement gray mask.
(Michael Thaler)
* Allow shape tools to be filled with gradients
* Allow shape tools to be filled with gradients
Dockers
* Tabs in dockers drag-and-droppable (vector of docker
......
......@@ -42,7 +42,7 @@ libkritacore_la_SOURCES = kis_color.cc kis_paint_device_impl.cc kis_layer.cc kis
kis_view_iface.skel kis_doc_iface.cc kis_doc_iface.skel kis_image_iface.cc kis_image_iface.skel \
kis_selection_manager.cc kis_scale_visitor.cc kis_transform_visitor.cc kis_rotate_visitor.cc \
kis_clipboard.cc kis_filter.cc kis_filter_registry.cc kis_filter_strategy.cc \
kis_composite_op.cc kis_part_layer.cc kis_filter_manager.cc kis_tool_manager.cc \
kis_part_layer.cc kis_filter_manager.cc kis_tool_manager.cc \
kis_paint_device_iface.cc kis_paint_device_iface.skel kis_histogram.cc \
kis_boundary.cc kis_histogram_producer.cc
......@@ -53,7 +53,7 @@ noinst_HEADERS = kis_paint_device_impl.h kis_layer.h kis_image.h kis_doc.h \
kis_transaction.h kis_vec.h kis_rect.h \
kis_iteratorpixeltrait.h kis_iterators_pixel.h kis_view_iface.h kis_doc_iface.h kis_image_iface.h \
kis_matrix.h kis_selection_manager.h kis_scale_visitor.h kis_rotate_visitor.h \
kis_filter.h kis_filter_registry.h kis_composite_op.h kis_part_layer.h \
kis_filter.h kis_filter_registry.h kis_part_layer.h \
kis_filter_manager.h kis_tool_manager.h kis_pixel_op.h kis_histogram.h \
kis_paint_device_iface.h kis_boundary.h kis_histogram_producer.h
......
......@@ -26,7 +26,6 @@
#include "kis_abstract_colorspace.h"
#include "kis_pixel.h"
#include "kis_global.h"
#include "kis_factory.h"
#include "kis_profile.h"
#include "kis_config.h"
#include "kis_id.h"
......@@ -102,8 +101,8 @@ bool KisAbstractColorSpace::convertTo(KisPixel& src, KisPixel& dst, Q_INT32 rend
renderingIntent);
}
bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, KisProfileSP srcProfile,
Q_UINT8 * dst, KisAbstractColorSpace * dstColorSpace, KisProfileSP dstProfile,
bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, KisProfile * srcProfile,
Q_UINT8 * dst, KisColorSpace * dstColorSpace, KisProfile * dstProfile,
Q_UINT32 numPixels,
Q_INT32 renderingIntent)
{
......@@ -180,7 +179,7 @@ bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, KisProfileSP sr
// we still wouldn't be able to get a transform. That's why we're here...
while (numPixels > 0) {
QColor color;
QUANTUM opacity;
Q_UINT8 opacity;
toQColor(src, &color, &opacity);
dstColorSpace -> fromQColor(color, opacity, dst);
......@@ -311,14 +310,14 @@ void KisAbstractColorSpace::convolveColors(Q_UINT8** colors, Q_INT32 * kernelVal
if (channelFlags & FLAG_COLOR) {
const_cast<KisAbstractColorSpace *>(this)->fromQColor(QColor(CLAMP((totalRed / factor) + offset, 0, QUANTUM_MAX),
CLAMP((totalGreen / factor) + offset, 0, QUANTUM_MAX),
CLAMP((totalBlue / factor) + offset, 0, QUANTUM_MAX)),
const_cast<KisAbstractColorSpace *>(this)->fromQColor(QColor(CLAMP((totalRed / factor) + offset, 0, Q_UINT8_MAX),
CLAMP((totalGreen / factor) + offset, 0, Q_UINT8_MAX),
CLAMP((totalBlue / factor) + offset, 0, Q_UINT8_MAX)),
dstOpacity,
dst);
}
if (channelFlags & FLAG_ALPHA) {
const_cast<KisAbstractColorSpace *>(this)->fromQColor(dstColor, CLAMP((totalAlpha/ factor) + offset, 0, QUANTUM_MAX), dst);
const_cast<KisAbstractColorSpace *>(this)->fromQColor(dstColor, CLAMP((totalAlpha/ factor) + offset, 0, Q_UINT8_MAX), dst);
}
}
......@@ -352,7 +351,7 @@ void KisAbstractColorSpace::darken(const Q_UINT8 * src, Q_UINT8 * dst, Q_INT32 s
Q_UINT8 KisAbstractColorSpace::intensity8(const Q_UINT8 * src) const
{
QColor c;
QUANTUM opacity;
Q_UINT8 opacity;
const_cast<KisAbstractColorSpace *>(this)->toQColor(src, &c, &opacity);
return (Q_UINT8)((c.red() * 0.30 + c.green() * 0.59 + c.blue() * 0.11) + 0.5);
......@@ -361,17 +360,17 @@ Q_UINT8 KisAbstractColorSpace::intensity8(const Q_UINT8 * src) const
void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst,
Q_INT32 dststride,
KisAbstractColorSpace * srcSpace,
KisColorSpace * srcSpace,
const Q_UINT8 *src,
Q_INT32 srcRowStride,
const Q_UINT8 *srcAlphaMask,
Q_INT32 maskRowStride,
QUANTUM opacity,
Q_UINT8 opacity,
Q_INT32 rows,
Q_INT32 cols,
const KisCompositeOp& op,
KisProfileSP srcProfile,
KisProfileSP dstProfile)
KisProfile * srcProfile,
KisProfile * dstProfile)
{
if (rows <= 0 || cols <= 0)
return;
......@@ -434,7 +433,7 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst,
}
}
vKisProfileSP KisAbstractColorSpace::profiles()
QValueVector<KisProfile *> KisAbstractColorSpace::profiles()
{
return KisColorSpaceRegistry::instance()->profilesFor( this );
}
......@@ -445,14 +444,14 @@ Q_INT32 KisAbstractColorSpace::profileCount()
}
QImage KisAbstractColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height,
KisProfileSP srcProfile, KisProfileSP dstProfile,
KisProfile * srcProfile, KisProfile * dstProfile,
Q_INT32 renderingIntent, float /*exposure*/)
{
QImage img = QImage(width, height, 32, 0, QImage::LittleEndian);
img.setAlphaBuffer( true );
KisAbstractColorSpace * dstCS = KisColorSpaceRegistry::instance() -> get("RGBA");
KisColorSpace * dstCS = KisColorSpaceRegistry::instance() -> get("RGBA");
if (! srcProfile && ! dstProfile) {
srcProfile = getDefaultProfile();
......@@ -467,9 +466,9 @@ QImage KisAbstractColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width
}
cmsHTRANSFORM KisAbstractColorSpace::createTransform(KisAbstractColorSpace * dstColorSpace,
KisProfileSP srcProfile,
KisProfileSP dstProfile,
cmsHTRANSFORM KisAbstractColorSpace::createTransform(KisColorSpace * dstColorSpace,
KisProfile * srcProfile,
KisProfile * dstProfile,
Q_INT32 renderingIntent)
{
KisConfig cfg;
......
......@@ -30,6 +30,7 @@
#include "kis_profile.h"
#include "kis_id.h"
#include "kis_composite_op.h"
#include "kis_colorspace.h"
#include "koffice_export.h"
......@@ -43,7 +44,7 @@ class KisPixelRO;
// need something that combines the two profiles + the rendering
// intent + the lcms colortype -- a certain profile can be used with
// many varieties of, e.g. RGB(a).
typedef QPair<KisProfileSP, KisProfileSP> KisProfilePair;
typedef QPair<KisProfile * , KisProfile * > KisProfilePair;
// This would be better, I guess.
struct transform {
......@@ -54,13 +55,12 @@ struct transform {
Q_UINT32 renderIntent;
};
struct KisColorAdjustment;
/**
* A colorspace strategy is the definition of a certain color model
* in Krita.
*/
class KRITACORE_EXPORT KisAbstractColorSpace : public KShared {
class KRITACORE_EXPORT KisAbstractColorSpace : public KisColorSpace {
public:
......@@ -93,7 +93,7 @@ public:
//========== Channels =====================================================//
// Return a vector describing all the channels this color model has.
virtual vKisChannelInfoSP channels() const = 0;
virtual QValueVector<KisChannelInfo *> channels() const = 0;
/**
* The total number of channels for a single pixel in this color model
......@@ -150,7 +150,7 @@ public:
* Krita definition for use in .kra files and internally: unchanging name +
* i18n'able description.
*/
inline KisID id() const { return m_id; }
virtual KisID id() const { return m_id; }
/**
* lcms colorspace type definition.
......@@ -158,12 +158,7 @@ public:
void setColorSpaceType(Q_UINT32 type) { m_cmType = type; }
Q_UINT32 colorSpaceType() { return m_cmType; }
/**
* icc profile files colorspace id
*/
void setColorSpaceSignature(icColorSpaceSignature signature) { m_colorSpaceSignature = signature; }
icColorSpaceSignature colorSpaceSignature() { return m_colorSpaceSignature; }
virtual icColorSpaceSignature colorSpaceSignature() { return m_colorSpaceSignature; }
//========== Capabilities =================================================//
......@@ -174,7 +169,6 @@ public:
*/
virtual KisCompositeOpList userVisiblecompositeOps() const = 0;
virtual bool valid() { return true; }
......@@ -183,7 +177,7 @@ public:
/**
* Get a list of profiles that apply to this color space
*/
vKisProfileSP profiles();
QValueVector<KisProfile *> profiles();
/**
......@@ -207,8 +201,8 @@ public:
*
* XXX: We actually do not use the display yet, nor the paint device profile
*/
virtual void fromQColor(const QColor& c, Q_UINT8 *dst, KisProfileSP profile = 0) = 0;
virtual void fromQColor(const QColor& c, QUANTUM opacity, Q_UINT8 *dst, KisProfileSP profile = 0) = 0;
virtual void fromQColor(const QColor& c, Q_UINT8 *dst, KisProfile * profile = 0) = 0;
virtual void fromQColor(const QColor& c, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * profile = 0) = 0;
/**
* The toQColor methods take a byte array that is at least pixelSize() long
......@@ -218,12 +212,12 @@ public:
* XXX: We actually do not use the display yet, nor the paint device profile
*
*/
virtual void toQColor(const Q_UINT8 *src, QColor *c, KisProfileSP profile= 0 ) = 0;
virtual void toQColor(const Q_UINT8 *src, QColor *c, QUANTUM *opacity, KisProfileSP profile = 0) = 0;
virtual void toQColor(const Q_UINT8 *src, QColor *c, KisProfile * profile= 0 ) = 0;
virtual void toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * profile = 0) = 0;
virtual KisPixelRO toKisPixelRO(const Q_UINT8 *src, KisProfileSP profile) = 0;
virtual KisPixel toKisPixel(Q_UINT8 *src, KisProfileSP profile) = 0;
virtual KisPixelRO toKisPixelRO(const Q_UINT8 *src, KisProfile * profile) = 0;
virtual KisPixel toKisPixel(Q_UINT8 *src, KisProfile * profile) = 0;
/**
* This function is used to convert a KisPixelRepresentation from this color strategy to the specified
......@@ -247,7 +241,7 @@ public:
* @param exposure The exposure setting for rendering a preview of a high dynamic range image.
*/
virtual QImage convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height,
KisProfileSP srcProfile, KisProfileSP dstProfile,
KisProfile * srcProfile, KisProfile * dstProfile,
Q_INT32 renderingIntent = INTENT_PERCEPTUAL,
float exposure = 0.0f);
......@@ -259,8 +253,8 @@ public:
*
* Returns false if the conversion failed, true if it succeeded
*/
virtual bool convertPixelsTo(const Q_UINT8 * src, KisProfileSP srcProfile,
Q_UINT8 * dst, KisAbstractColorSpace * dstColorSpace, KisProfileSP dstProfile,
virtual bool convertPixelsTo(const Q_UINT8 * src, KisProfile * srcProfile,
Q_UINT8 * dst, KisColorSpace * dstColorSpace, KisProfile * dstProfile,
Q_UINT32 numPixels,
Q_INT32 renderingIntent = INTENT_PERCEPTUAL);
......@@ -366,25 +360,25 @@ public:
*/
virtual void bitBlt(Q_UINT8 *dst,
Q_INT32 dststride,
KisAbstractColorSpace * srcSpace,
KisColorSpace * srcSpace,
const Q_UINT8 *src,
Q_INT32 srcRowStride,
const Q_UINT8 *srcAlphaMask,
Q_INT32 maskRowStride,
QUANTUM opacity,
Q_UINT8 opacity,
Q_INT32 rows,
Q_INT32 cols,
const KisCompositeOp& op,
KisProfileSP srcProfile = 0,
KisProfileSP dstProfile = 0);
KisProfile * srcProfile = 0,
KisProfile * dstProfile = 0);
/**
* Return the default profile for this colorspace. This may be 0.
*/
KisProfileSP getDefaultProfile() { return m_defaultProfile; };
void setDefaultProfile(KisProfileSP profile) { m_defaultProfile = profile; };
virtual KisProfile * getDefaultProfile() { return m_defaultProfile; };
void setDefaultProfile(KisProfile * profile) { m_defaultProfile = profile; };
//========================== END of Public API ========================================//
......@@ -401,14 +395,14 @@ protected:
Q_INT32 srcRowStride,
const Q_UINT8 *srcAlphaMask,
Q_INT32 maskRowStride,
QUANTUM opacity,
Q_UINT8 opacity,
Q_INT32 rows,
Q_INT32 cols,
const KisCompositeOp& op) = 0;
virtual cmsHTRANSFORM createTransform(KisAbstractColorSpace * dstColorSpace,
KisProfileSP srcProfile,
KisProfileSP dstProfile,
virtual cmsHTRANSFORM createTransform(KisColorSpace * dstColorSpace,
KisProfile * srcProfile,
KisProfile * dstProfile,
Q_INT32 renderingIntent);
......@@ -416,7 +410,7 @@ protected:
protected:
QStringList m_profileFilenames;
KisProfileSP m_defaultProfile;
KisProfile * m_defaultProfile;
Q_UINT8 * m_qcolordata; // A small buffer for conversion from and to qcolor.
Q_INT32 m_alphaPos; // The position in _bytes_ of the alpha channel
Q_INT32 m_alphaSize; // The width in _bytes_ of the alpha channel
......@@ -426,11 +420,11 @@ protected:
cmsHTRANSFORM m_defaultToXYZ;
cmsHTRANSFORM m_defaultFromXYZ;
KisProfileSP m_lastUsedSrcProfile;
KisProfileSP m_lastUsedDstProfile;
KisProfile * m_lastUsedSrcProfile;
KisProfile * m_lastUsedDstProfile;
cmsHTRANSFORM m_lastUsedTransform;
vKisChannelInfoSP m_channels;
QValueVector<KisChannelInfo *> m_channels;
private:
......
......@@ -51,12 +51,12 @@ KisAlphaColorSpace::~KisAlphaColorSpace()
{
}
void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, Q_UINT8 *dst, KisProfileSP /*profile*/)
void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, Q_UINT8 *dst, KisProfile * /*profile*/)
{
dst[PIXEL_MASK] = OPACITY_OPAQUE;
}
void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, QUANTUM opacity, Q_UINT8 *dst, KisProfileSP /*profile*/)
void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * /*profile*/)
{
dst[PIXEL_MASK] = opacity;
}
......@@ -66,12 +66,12 @@ void KisAlphaColorSpace::getAlpha(const Q_UINT8 *pixel, Q_UINT8 *alpha)
*alpha = *pixel;
}
void KisAlphaColorSpace::toQColor(const Q_UINT8 */*src*/, QColor *c, KisProfileSP /*profile*/)
void KisAlphaColorSpace::toQColor(const Q_UINT8 */*src*/, QColor *c, KisProfile * /*profile*/)
{
c -> setRgb(255, 255, 255);
}
void KisAlphaColorSpace::toQColor(const Q_UINT8 *src, QColor *c, QUANTUM *opacity, KisProfileSP /*profile*/)
void KisAlphaColorSpace::toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * /*profile*/)
{
c -> setRgb(255, 255, 255);
*opacity = src[PIXEL_MASK];
......@@ -96,7 +96,7 @@ void KisAlphaColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weight
}
}
vKisChannelInfoSP KisAlphaColorSpace::channels() const
QValueVector<KisChannelInfo *> KisAlphaColorSpace::channels() const
{
return m_channels;
}
......@@ -109,7 +109,7 @@ bool KisAlphaColorSpace::hasAlpha() const
// etc. No need to actually use the profiles here to create a mask image -- they don't
// need to be true color.
QImage KisAlphaColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height,
KisProfileSP /*srcProfile*/, KisProfileSP /*dstProfile*/,
KisProfile * /*srcProfile*/, KisProfile * /*dstProfile*/,
Q_INT32 /*renderingIntent*/, float /*exposure*/)
{
......@@ -143,8 +143,8 @@ QImage KisAlphaColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q
}
#endif
bool KisAlphaColorSpace::convertPixelsTo(const Q_UINT8 *src, KisProfileSP /*srcProfile*/,
Q_UINT8 *dst, KisAbstractColorSpace * dstColorSpace, KisProfileSP dstProfile,
bool KisAlphaColorSpace::convertPixelsTo(const Q_UINT8 *src, KisProfile * /*srcProfile*/,
Q_UINT8 *dst, KisAbstractColorSpace * dstColorSpace, KisProfile * dstProfile,
Q_UINT32 numPixels,
Q_INT32 /*renderingIntent*/)
{
......@@ -175,7 +175,7 @@ void KisAlphaColorSpace::bitBlt(Q_UINT8 *dst,
Q_INT32 srcRowStride,
const Q_UINT8 *srcAlphaMask,
Q_INT32 maskRowStride,
QUANTUM opacity,
Q_UINT8 opacity,
Q_INT32 rows,
Q_INT32 cols,
const KisCompositeOp& op)
......@@ -325,6 +325,6 @@ void KisAlphaColorSpace::convolveColors(Q_UINT8** colors, Q_INT32 * kernelValues
}
if (channelFlags & FLAG_ALPHA) {
dst[PIXEL_MASK] = CLAMP((totalAlpha/ factor) + offset, 0, QUANTUM_MAX);
dst[PIXEL_MASK] = CLAMP((totalAlpha/ factor) + offset, 0, Q_UINT8_MAX);
}
}
......@@ -37,21 +37,21 @@ public:
virtual ~KisAlphaColorSpace();
public:
virtual void fromQColor(const QColor& c, Q_UINT8 *dst, KisProfileSP profile = 0);
virtual void fromQColor(const QColor& c, QUANTUM opacity, Q_UINT8 *dst, KisProfileSP profile = 0);
virtual void fromQColor(const QColor& c, Q_UINT8 *dst, KisProfile * profile = 0);
virtual void fromQColor(const QColor& c, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * profile = 0);
virtual void getAlpha(const Q_UINT8 *pixel, Q_UINT8 *alpha);
virtual void toQColor(const Q_UINT8 *src, QColor *c, KisProfileSP profile = 0);
virtual void toQColor(const Q_UINT8 *src, QColor *c, QUANTUM *opacity, KisProfileSP profile = 0);
virtual void toQColor(const Q_UINT8 *src, QColor *c, KisProfile * profile = 0);
virtual void toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * profile = 0);
virtual KisPixelRO toKisPixelRO(const Q_UINT8 *src, KisProfileSP profile = 0) { return KisPixelRO (src, src, this, profile); }
virtual KisPixel toKisPixel(Q_UINT8 *src, KisProfileSP profile = 0) { return KisPixel (src, src, this, profile); }
virtual KisPixelRO toKisPixelRO(const Q_UINT8 *src, KisProfile * profile = 0) { return KisPixelRO (src, src, this, profile); }
virtual KisPixel toKisPixel(Q_UINT8 *src, KisProfile * profile = 0) { return KisPixel (src, src, this, profile); }
virtual Q_INT8 difference(const Q_UINT8 *src1, const Q_UINT8 *src2);
virtual void mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const;
virtual vKisChannelInfoSP channels() const;
virtual QValueVector<KisChannelInfo *> channels() const;
virtual bool hasAlpha() const;
virtual Q_INT32 nChannels() const { return 1; };