hi
how can i use QImage::scanLine() to compare pixel data of 2 images.
Qt Code:
  1. QImage image("C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Winter.jpg");
  2. int height=image.height();
  3. int width=image.width();
  4. QImage image1("C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Winter.jpg");
  5. int height1=image1.height();
  6. int width1=image1.width();
  7.  
  8. if(height1!=height||width1!=width){
  9. qDebug()<<"Images are different";
  10. }
  11. else
  12. for(int i=0,j=0;i<height,j<height1;i++,j++){
  13.  
  14. QRgb * img=(QRgb *)image.scanLine(i);
  15. QRgb * img1=(QRgb *)image.scanLine(j);
  16. if(*img==*img1){
  17. qDebug()<<"images matched:";
  18.  
  19. }
  20. else
  21. qDebug()<<"images do not match";
  22. }
To copy to clipboard, switch view to plain text mode 

i know this code is error prone, kindly explain to me how scanLine works

thanx