112 srand(
unsigned(time(NULL)) );
118 QImage*
editedImage =
new QImage( originalImage->width(),
119 originalImage->height(),
120 originalImage->depth() );
123 editedImage->fill( qRgb(255,255,255) );
130 const int BLOCK_SIZE = 8;
133 int blocksWide = editedImage->width() / BLOCK_SIZE;
134 if(blocksWide*BLOCK_SIZE < editedImage->
width())
137 int blocksTall = editedImage->height() / BLOCK_SIZE;
138 if(blocksTall*BLOCK_SIZE < editedImage->
height())
143 for(
int i=0; i<10; i++)
146 for(bx=0; bx<blocksWide; bx++)
148 for(by=0; by<blocksTall; by++)
152 editedImage->height(),
161 if( curGrayVal > goalGrayVal )
168 delete originalImage;
169 originalImage = NULL;
double computeLocalGrayVal(QImage *image, int x, int y)
void drawDotAt(QImage *image, int x, int y, int)
QImage * blackWhiteEffect(QString filename, ManipulationOptions *options)
void pickRandomPixelWithinBlock(int width, int height, int blockX, int blockY, int BLOCK_SIZE, int &x, int &y)