So, I loaded the grayscale image pixels as QImage to an array
QVector<QRgb> szinindextabla = image.colorTable();
QVector<QVector<quint8> > a(image.width(), QVector<quint8>(image.height()));
for(int i=0;i<image.height();i++){
for(int j=0;j<image.width();j++){
a[j][i]=qGray(szinindextabla[image.pixelIndex(j,i)]);
}
}
QVector<QRgb> szinindextabla = image.colorTable();
QVector<QVector<quint8> > a(image.width(), QVector<quint8>(image.height()));
for(int i=0;i<image.height();i++){
for(int j=0;j<image.width();j++){
a[j][i]=qGray(szinindextabla[image.pixelIndex(j,i)]);
}
}
To copy to clipboard, switch view to plain text mode
Now, how to extract the bits?
Added after 14 minutes:
hm, i don't think this is the right approach, but it almost works, i created a QBitarray and do & 2^{bitplane no} then created QBitmap then draw points with QPainter on the QBitMap when bit is true. The LSB bitplane looks quite random and this is normal, but the 8th is complete white and it is not good.
Bookmarks