增加:选区马赛克
This commit is contained in:
parent
d5e5195ef1
commit
0025f266a8
|
@ -11,5 +11,5 @@
|
|||

|
||||
### 1.2 新增导入图形
|
||||
### 1.1 新增灰度和反色
|
||||

|
||||

|
||||

|
||||

|
|
@ -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){
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 688 KiB |
BIN
invert.png
BIN
invert.png
Binary file not shown.
Before Width: | Height: | Size: 5.2 MiB |
BIN
mosaic.png
BIN
mosaic.png
Binary file not shown.
Before Width: | Height: | Size: 7.6 MiB After Width: | Height: | Size: 484 KiB |
Loading…
Reference in New Issue