Commit 6ad878a7 authored by Cyrille Berger's avatar Cyrille Berger

add a function for testing if two KoColor are equals

svn path=/trunk/koffice/; revision=678612
parent 4f32d1d0
......@@ -133,6 +133,12 @@ KoColor & KoColor::operator=(const KoColor & rhs)
return * this;
}
bool KoColor::operator==(const KoColor &other)
{
if(colorSpace() != other.colorSpace()) return false;
return memcmp(d->data, other.d->data, d->colorSpace->pixelSize()) == 0;
}
void KoColor::convertTo(KoColorSpace * cs)
{
//kDebug(DBG_AREA_CMS) << "Our colormodel: " << d->colorSpace->id().name()
......
......@@ -64,6 +64,8 @@ public:
* @return this color
*/
KoColor &operator=(const KoColor &other);
bool operator==(const KoColor &other);
/// return the current colorSpace
KoColorSpace * colorSpace() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment