below is the source code of this funciton in version 2.1.1:
void QCPColorMapData::fill(double z) { const int dataCount = mValueSize*mKeySize; memset(mData, z, dataCount*sizeof(*mData)); mDataBounds = QCPRange(z, z); mDataModified = true; }
Pay attention to the line of memset
. The type of z
and mData
is double.
So there is no need for me to explain more.
This function may revert to version 2.1.0, which use for
to fill data:
void QCPColorMapData::fill(double z) { const int dataCount = mValueSize*mKeySize; for (int i=0; i<dataCount; ++i) mData[i] = z; mDataBounds = QCPRange(z, z); mDataModified = true; }