欢迎来到天天文库
浏览记录
ID:6674990
大小:74.00 KB
页数:22页
时间:2018-01-21
《2744.图像效果算法设计 ——静态效果 毕业论文 相关代码》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、目录90度旋转—————————————————————————————2垂直旋转—————————————————————————————3水平旋转—————————————————————————————4灰度———————————————————————————————4添加噪点—————————————————————————————5彩色噪点—————————————————————————————6喷溅———————————————————————————————6马赛克———————————————————————————
2、———6RGB调整—————————————————————————————7亮度调整—————————————————————————————9对比度调整————————————————————————————11饱和度调整————————————————————————————12曝光———————————————————————————————14浮雕———————————————————————————————14雕刻———————————————————————————————16模糊—————————————————————
3、——————————17锐化———————————————————————————————18霓虹———————————————————————————————1922//90度旋转procedureTForm1.Rotatepicture(Bitmap:TBitmap);varaStream:TMemorystream;//内存流header:TBITMAPINFO;dc:hDC;P:^THelpRGB;x,y,b,h:Integer;RowOut:pRGBArray;begin//创建内存流aStream:=TMemoryStrea
4、m.Create;//设置大小,必须是4的倍数aStream.SetSize(Bitmap.Height*Bitmap.Width*4);withheader.bmiHeaderdo//操作位图文件beginbiSize:=SizeOf(TBITMAPINFOHEADER);//大小biWidth:=Bitmap.Width;//位图宽biHeight:=Bitmap.Height;//位图高biPlanes:=1;biBitCount:=32;//无压缩biCompression:=0;biSizeimage:=aStream.Siz
5、e;biXPelsPerMeter:=1;//水平分辨率biYPelsPerMeter:=1;//竖直分辨率biClrUsed:=0;biClrImportant:=0;end;dc:=GetDC(0);P:=aStream.Memory;GetDIBits(dc,Bitmap.Handle,0,Bitmap.Height,P,header,dib_RGB_Colors);ReleaseDC(0,dc);b:=bitmap.Height;//源图高h:=bitmap.Width;//源图宽//指定要创建的位图的大小尺寸bitmap.Wi
6、dth:=b;bitmap.height:=h;fory:=0to(h-1)dobeginrowOut:=Bitmap.ScanLine[y];//获取新的位图信息P:=aStream.Memory;//设置文件指针22inc(p,y);//指针移位forx:=0to(b-1)dobeginrowout[x]:=p^.rgb;//进行数据转移inc(p,h);end;end;aStream.Free;//释放资源end;//垂直翻转procedureTForm1.bsSkinSpeedButton3Click(Sender:TObjec
7、t);varbmp1,bmp2:Tbitmap;i,j:integer;p,p1:pbyteArray;beginimage1.Stretch:=true;bmp1:=Tbitmap.Create;bmp2:=Tbitmap.Create;bmp1.Assign(Self.Image1.Picture.Bitmap);bmp2.Assign(Self.image1.Picture.Bitmap);bmp1.PixelFormat:=pf24bit;bmp2.PixelFormat:=pf24bit;forj:=0toSelf.image
8、1.Picture.Graphic.Height-1dobeginp:=bmp1.ScanLine[j];p1:=bmp2.ScanLine[Self.IMAGE1.Picture.Graphic.Heig
此文档下载收益归作者所有