Array of pointers to QUANTUM pointers

Boudewijn Rempt boud at valdyas.org
Tue Jun 28 15:04:39 CEST 2005


On Tuesday 28 June 2005 15:04, Bart Coppens wrote:
> On Tuesday 28 June 2005 14:57, Michael Thaler wrote:
> > QUANTUM **tmpRows = new QUANTUM[ width * m_pixelSize * sizeof( QUANTUM )
> > ] [ (int)(fwidth * 2 + 1) ];
>
> Afaik, you need to do that in 2 steps: first create an array of QUANTUM*,
> and then there arrays of QUANTUM:
> QUANTUM **tmpRows = new QUANTUM*[size1];
> for (int i = 0; i < size1; i++)
>  tmpRows[i] = new QUANTUM[size2];

Oh, and we really should replace the QUANTUM with Q_UINT8, shouldn't we?

-- 
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/20050628/29778196/attachment.pgp


More information about the kimageshop mailing list