增加:选区马赛克

This commit is contained in:
sonichy 2018-12-05 16:30:32 +08:00
parent d5e5195ef1
commit 0025f266a8
8 changed files with 3 additions and 3 deletions

BIN
HTYPaint

Binary file not shown.

View File

@ -11,5 +11,5 @@
![alt](blur.jpg)
### 1.2 新增导入图形
### 1.1 新增灰度和反色
![alt](gray.png)
![alt](invert.png)
![alt](gray.jpg)
![alt](invert.jpg)

BIN
gray.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 KiB

BIN
gray.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 MiB

View File

@ -740,7 +740,7 @@ void ImageWidget::mosaic(int p)
if(startPnt.x()>endPnt.x() && startPnt.y()<endPnt.y()){xs=endPnt.x(); ys=startPnt.y(); xe=startPnt.x(); ye=endPnt.y();}
if(startPnt.x()>endPnt.x() && startPnt.y()>endPnt.y()){xs=endPnt.x(); ys=endPnt.y(); xe=startPnt.x(); ye=startPnt.y();}
if(startPnt.x()<endPnt.x() && startPnt.y()>endPnt.y()){xs=startPnt.x(); ys=endPnt.y(); xe=endPnt.x(); ye=startPnt.y();}
QImage imgMosaic(qAbs(endPnt.x()-startPnt.x())+2, qAbs(endPnt.y()-startPnt.y())+2, QImage::Format_RGB32);
QImage imgMosaic(qAbs(endPnt.x()-startPnt.x()), qAbs(endPnt.y()-startPnt.y()), QImage::Format_RGB32);
QPainter painterm(&imgMosaic);
for(int x=xs; x<xe; x+=p){
for(int y=ys; y<ye; y+=p){

BIN
invert.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 MiB

After

Width:  |  Height:  |  Size: 484 KiB