Delphi基本图像处理方法文档格式.docx

上传人:b****3 文档编号:6792169 上传时间:2023-05-07 格式:DOCX 页数:16 大小:24.35KB
下载 相关 举报
Delphi基本图像处理方法文档格式.docx_第1页
第1页 / 共16页
Delphi基本图像处理方法文档格式.docx_第2页
第2页 / 共16页
Delphi基本图像处理方法文档格式.docx_第3页
第3页 / 共16页
Delphi基本图像处理方法文档格式.docx_第4页
第4页 / 共16页
Delphi基本图像处理方法文档格式.docx_第5页
第5页 / 共16页
Delphi基本图像处理方法文档格式.docx_第6页
第6页 / 共16页
Delphi基本图像处理方法文档格式.docx_第7页
第7页 / 共16页
Delphi基本图像处理方法文档格式.docx_第8页
第8页 / 共16页
Delphi基本图像处理方法文档格式.docx_第9页
第9页 / 共16页
Delphi基本图像处理方法文档格式.docx_第10页
第10页 / 共16页
Delphi基本图像处理方法文档格式.docx_第11页
第11页 / 共16页
Delphi基本图像处理方法文档格式.docx_第12页
第12页 / 共16页
Delphi基本图像处理方法文档格式.docx_第13页
第13页 / 共16页
Delphi基本图像处理方法文档格式.docx_第14页
第14页 / 共16页
Delphi基本图像处理方法文档格式.docx_第15页
第15页 / 共16页
Delphi基本图像处理方法文档格式.docx_第16页
第16页 / 共16页
亲,该文档总共16页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

Delphi基本图像处理方法文档格式.docx

《Delphi基本图像处理方法文档格式.docx》由会员分享,可在线阅读,更多相关《Delphi基本图像处理方法文档格式.docx(16页珍藏版)》请在冰点文库上搜索。

Delphi基本图像处理方法文档格式.docx

0thenSrcRGB1:

=SrcBmp.ScanLine[i-1]elseSrcRGB1:

=SrcRGB;

Inc(SrcRGB1;

SrcRGB2:

Inc(SrcRGB2;

endelseif(AzimuthChange>

=-135and(AzimuthChange<

-90thenbeginifi>

=SrcRGB1;

=-90and(AzimuthChange<

-45thenbeginifi>

=-45and(AzimuthChange<

0thenbeginSrcRGB1:

ifi>

0thenSrcRGB2:

=SrcBmp.ScanLine[i-1]elseSrcRGB2:

=0and(AzimuthChange<

45thenbeginSrcRGB2:

if(i<

SrcBmp.Height-1thenSrcRGB1:

=SrcBmp.ScanLine[i+1]elseSrcRGB1:

=45and(AzimuthChange<

90thenbeginif(i<

=90and(AzimuthChange<

135thenbeginif(i<

=135and(AzimuthChange<

=180thenbeginif(i<

SrcBmp.Height-1thenSrcRGB2:

=SrcBmp.ScanLine[i+1]elseSrcRGB2:

SrcRGB1:

end;

forj:

=0toSrcBmp.Width-1dobeginif(AzimuthChange>

-135thenbeginAzimuthvalue:

=AzimuthChange+180;

R:

=SrcRGB.rgbtRed-((SrcRGB1.rgbtRed*Azimuthvaluediv45-((SrcRGB2.rgbtRed*(45-Azimuthvaluediv45+78;

G:

=SrcRGB.rgbtGreen-((SrcRGB1.rgbtGreen*Azimuthvaluediv45-((SrcRGB2.rgbtGreen*(45-Azimuthvaluediv45+78;

B:

=SrcRGB.rgbtBlue-((SrcRGB1.rgbtBlue*Azimuthvaluediv45-((SrcRGB2.rgbtBlue*(45-Azimuthvaluediv45+78;

-90thenbeginAzimuthvalue:

=AzimuthChange+135;

=SrcR

GB.rgbtBlue-((SrcRGB1.rgbtBlue*Azimuthvaluediv45-((SrcRGB2.rgbtBlue*(45-Azimuthvaluediv45+78;

-45thenbeginifj=1thenInc(SrcRGB1,-1;

Azimuthvalue:

=AzimuthChange+90;

0thenbeginifj=1thenbeginInc(SrcRGB1,-1;

Inc(SrcRGB2,-1;

=AzimuthChange+45;

45thenbeginifj=1thenbeginInc(SrcRGB1,-1;

=AzimuthChange;

90thenbeginifj=1thenInc(SrcRGB2,-1;

=AzimuthChange-45;

135thenbeginAzimuthvalue:

=AzimuthChange-90;

=180thenbeginAzimuthvalue:

=AzimuthChange-135;

=SrcRGB.rgbtGreen-((SrcRGB1.rgbtGreen*Azimuthvaluediv45-((SrcRGB2.rgbtGree

n*(45-Azimuthvaluediv45+78;

=Min(R,255;

=Max(R,0;

=Min(G,255;

=Max(G,0;

=Min(B,255;

=Max(B,0;

Gray:

=(Rshr2+(Rshr4+(Gshr1+(Gshr4+(Bshr3;

DestRGB.rgbtRed:

=Gray;

DestRGB.rgbtGreen:

DestRGB.rgbtBlue:

if(j=-180and(AzimuthChange<

-135or((AzimuthChange>

=90and(AzimuthChange<

=180thenbeginInc(SrcRGB1;

if(j=135and(AzimuthChange<

180or((AzimuthChange>

=-180and(AzimuthChange<

=-90thenbeginInc(SrcRGB2;

Inc(SrcRGB;

Inc(DestRGB;

procedureEmboss(Bmp:

ElevationChange:

WeightChange:

varDestBmp:

begin  DestBmp:

=TBitmap.Create;

  DestBmp.Assign(Bmp;

  Emboss(Bmp,DestBmp,AzimuthChange,ElevationChange,WeightChange;

  Bmp.Assign(DestBmp;

//反色procedureNegative(Bmp:

vari,j:

Integer;

PRGB:

beginBmp.PixelFormat:

=pf24Bit;

fori:

=0toBmp.Height-1dobeginPRGB:

=Bmp.ScanLine[i];

=0toBmp.Width-1dobeginPRGB^.rgbtRed:

=notPRGB^.rgbtRed;

PRGB^.rgbtGreen:

=notPRGB^.rgbtGreen;

PRGB^.rgbtBlue:

=notPRGB^.rgbtBlue;

Inc(PRGB;

//曝光procedureExposure(Bmp:

=0toBmp.Width-1dobeginifPRGB^.rgbtRed<

128thenPRGB^.rgbtRed:

ifPRGB^.rgbtGreen<

128thenPRGB^.rgbtGreen:

ifPRGB^.rgbtBlue<

128thenPRGB^.rgbtBlue:

//模糊procedureBlur(SrcBmp:

Integer;

SrcRGB:

pRGBTriple;

SrcNextRGB:

SrcPreRGB:

Value:

procedureIncRGB;

beginInc(SrcPreRGB;

Inc(SrcNextRGB;

procedureDecRGB;

beginInc(SrcPreRGB,-1;

Inc(SrcRGB,-1;

Inc(SrcNextRGB,-1;

beginSrcBmp.PixelFormat:

=0toSrcBmp.Height-1dobeginifi>

0thenSrcPreRGB:

=SrcBmp.ScanLine[i-1]elseSrcPreRGB:

SrcRGB:

ifi<

SrcBmp.Height-1thenSrcNextRGB:

=SrcBmp.ScanLine[i+1]elseSrcNextRGB:

=SrcBmp.ScanLine[i];

=0toSrcBmp.Width-1dobeginifj>

0thenDecRGB;

=SrcPreRGB.rgbtRed+SrcRGB.rgbtRed+SrcNextRGB.rgbtRed;

ifj>

0thenIncRGB;

=Value+SrcPreRGB.rgbtRed+SrcRGB.rgbtRed+SrcNextRGB.rgbtRed;

ifj<

SrcBmp.Width-1thenIncRGB;

=(Value+SrcPreRGB.rgbtRed+SrcRGB.rgbtRed+SrcNextRGB.rgbtReddiv9;

DecRGB;

SrcRGB.rgbtRed:

=value;

ifj>

=SrcPreRGB.rgbtGreen+SrcRGB.rgbtGreen+SrcNextRGB.rgbtGreen;

=Value+SrcPreRGB.rgbtGreen+SrcRGB.rgbtGreen+SrcNextRGB.rgbtGreen;

=(Value+SrcPreRGB.rgbtGreen+SrcRGB.rgbtGreen+SrcNextRGB.rgbtGreendiv9;

SrcRGB.rgbtGreen:

=SrcPreRGB.rgbtBlue+SrcRGB.rgbtBlue+SrcNextRGB.rgbtBlue;

=Value+SrcPreRGB.rgbtBlue+SrcRGB.rgbtBlue+SrcNextRGB.rgbtBlue;

=(Value+SrcPreRGB.rgbtBlue+SrcRGB.rgbtBlue+SrcNextRGB.rgbtBluediv9;

SrcRGB.rgbtBlue:

IncRGB;

//锐化procedureSharpen(SrcBmp:

=SrcBmp.ScanLine[i-1]elseSrcPreRGB:

=0toSrcBmp.Width-1dobeginifj=1thenDec(SrcPreRGB;

=SrcRGB.rgbtRed+(SrcRGB.rgbtRed-SrcPreRGB.rgbtReddiv2;

=Max(0,Value;

=Min(255,Value;

=SrcRGB.rgbtGreen+(SrcRGB.rgbtGreen-SrcPreRGB.rgbtGreendiv2;

=SrcRGB.rgbtBlue+(SrcRGB.rgbtBlue-SrcPreRGB.rgbtBluediv2;

Inc(SrcPreRGB;

[图像的旋转和翻转]以下代码用ScanLine配合指针移动实现,用于24位色!

//旋转90度procedureRotate90(constBitmap:

vari,j:

rowIn,rowOut:

Bmp:

Width,Height:

beginBmp:

Bmp.Width:

=Bitmap.Height;

Bmp.Height:

=Bitmap.Width;

Bmp.PixelFormat:

=pf24bit;

Width:

=Bitmap.Width-1;

Height:

=Bitmap.Height-1;

=0toHeightdobeginrowIn:

=Bitmap.ScanLine[j];

=0toWidthdobeginrowOut:

Inc(rowOut,Height-j;

rowOut^:

=rowIn^;

Inc(rowIn;

Bitmap.Assign(Bmp;

//旋转180度procedureRotate180(constBitmap:

Bmp.Pixe

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 法律文书 > 调解书

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2