KisColor

Boudewijn Rempt boud at valdyas.org
Mon Jun 6 18:11:40 CEST 2005


Casper -- I think I'm getting confused about what you mean, and what I mean, 
so I have made a quick mockup of what I think you meant -- and given this 
mockup I don't see the added value above adding a toXYZ and fromXYZ method to 
KisStrategyColorSpace, but no doubt you can enlighten me:

class KisColor {

public:

	// Create a KisColor using the universal xyz color space.
	KisColor(Q_UINT16 x, Q_UINT16 y, Q_UINT16 z, 
                 KisStrategyColorSpaceSP colorStrategy = 0, KisProfileSP 
profile = 0)
		: m_native(false);

	// Create a KisColor using a native color strategy. The data is copied.
	KisColor(Q_UINT8 * data, 
                 KisStrategyColorSpaceSP colorStrategy = 0, KisProfileSP 
profile = 0)
		: m_native(true);
	
	virtual ~KisColor();

	Q_UINT8 * colorChannels() { return m_colorChannels; }
	Q_UINT8 * alphaChannel() { return m_alphaChannel; }
	Q_UINT8 * substanceChannels() { return m_substanceChannels(); }
	Q_UINT8 * substrateChannels() { return m_substrateChannels(); }

	Q_UINT8 * channel(Q_INT32 pos);
	
	Q_INT16 x() { return m_x; }
	Q_INT16 y() { return m_y; }
	Q_INT16 z() { return m_z; }


	bool native() { return m_native; }

private:

	private bool m_native;

	Q_UINT16 m_x;
	Q_UINT16 m_y;
	Q_UINT16 m_z;

	Q_UINT8 * m_colorChannels;
	Q_UINT8 * m_alphaChannel;
	Q_UINT8 * m_substanceChannels;
	Q_UINT8 * m_substrateChannels;
	
	KisStrategyColorSpaceSP m_colorStrategy;
	KisProfileSP m_profile;

};

-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20050606/31aa5780/attachment.pgp


More information about the kimageshop mailing list