fastbmp

所属分类:Pascal/Delphi编程
开发工具:Delphi
文件大小:111KB
下载次数:21
上传日期:2014-04-17 15:35:34
上 传 者457273
说明:  delphi 快速图像处理代码,修改版,可用于多版本delphi 。
(delphi fast write hooks, and write very well.)

文件列表:
TFastBmp\Demo\fastbmp.bmp (77880, 1999-01-19)
TFastBmp\Demo\sample.bmp (77880, 1999-01-19)
TFastBmp\Demo\Source\Project1.dpr (679, 1999-01-19)
TFastBmp\Demo\Source\Unit1.dfm (3181, 1999-01-19)
TFastBmp\Demo\Source\Unit1.pas (6942, 1999-01-20)
TFastBmp\Demo\Source\Unit2.dfm (1048, 1999-01-19)
TFastBmp\Demo\Source\Unit2.pas (1397, 1999-01-19)
TFastBmp\Demo\Source\Unit3.dfm (1326, 1999-01-19)
TFastBmp\Demo\Source\Unit3.pas (2037, 1999-01-19)
TFastBmp\Demo\Source\Unit4.dfm (994, 1999-01-19)
TFastBmp\Demo\Source\Unit4.pas (1395, 1999-01-19)
TFastBmp\Demo\Source\Unit5.dfm (1413, 1999-01-19)
TFastBmp\Demo\Source\Unit5.pas (2023, 1999-01-19)
TFastBmp\Demo\Source\Unit6.dfm (1428, 1999-01-19)
TFastBmp\Demo\Source\Unit6.pas (2139, 1999-01-19)
TFastBmp\Demo\Source\Unit7.dfm (1499, 1999-01-19)
TFastBmp\Demo\Source\Unit7.pas (1635, 1999-01-19)
TFastBmp\FastBMP.pas (10535, 1999-01-14)
TFastBmp\FastFX.pas (32145, 1999-01-20)
TFastBmp\FastRGB.pas (1203, 1999-01-20)

à±á>   Root Entry Fào×DWordDocument +CompObj^:;LMNVW…–—·áèéêòùúüíéá×°§¤’‰}zwtq]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b]b] U]^b c U]^b c]]]]]]]c]c]c]c U]^b c$ U]^b c$+ü$%&01278ABQRXYbcstz{…·ìí÷-.23üùóíê×·±¨¤—”’…]]]]b ]]]]]]b ]]]]]]b ]]]]]]b ]]]]]]b ]]]]]b ]b ]]]]]^ U]^b c U]^b c]]b]b]b]b]b]b]b]b23<=IJPQZ[klopyz–—¤,-UVpq}~–·òéá—”‰}z]b]b]b]b]b]bU]bU]b]b]b]b]b]b]b]b]b]b]b]bU]b]b U]^b c U]^b c]]]]]]]]]]]b ]]]]]]b ]]]]]]b ]]0()DEtu‰—c d e l m ü   ( ) 4 5 T U V ó ù üù訖”’|yur]bU]b]bU]b]]]]]]]]]]]]]]]U]cU]c]]]U]cU]cU]cU]c U]^b c$ U]^b c$U]c U]^b c]b]b]b]b]b]b]bU]bU]b]b]b+    $ & ' = > ? x y z ’ ` a b o p + , - 0 1 = > ? O ~  íêà·°¤–”~{]b]b ]b]b]b]b]bU]b]]]U]U]]]]U]U]]]]U]cU]c]]b]b]b]b]b]b]b ]b]]]]]]b]bU]b]bU]b]bU]b]bU]b. § è é ê 014567IJíê౨–“}zwt]b ]b]b]b]b]bU]b]]]U]U]]]b]bU]b]b ]b ]b]b]bU]b]b]b ]b ]b ]bU]b]b]bU]b]bU]b]bU]b]b]bU]b]bU]b]bU]b]bU]b,èú  %&*:;HIKNOPv‘’–—¤ üê਒…~|zx]]]]U]cU]c] U]^c ]bU]b]b]b ]b]b]bU]b]b]b]b]b ]b ]b]bU]b]b]bU]b]bU]b]bU]b]b]bU]b]bU]b]bU]b]bU]b]b );MNWò%&12Rt·üùòìêá°“     8F8F8F8F8F8Fe# + ,*l,*l** * e(*ì**T* eTimes New Roman Symbol Arial Arial0Courier NewTimes New RomanTFastBMP v1.0 G. Alex Cowie www.jps.net/gfody 1-20-***: This version has completely new architecture. TFastBMP is a descendant of TFastRGB to make way for upcoming TFastDDB (direct draw bitmap). The scanlines read/write method has been replaced with a smart pixels property. All effects are in FastFX.pas (compatible with anything derrived from TFastRGB). Types TFColor = record b,g,r:Byte end; PFColor = ^TFColor; TLine = array[0..0]of TFColor; PLine = ^TLine; TPLines = array[0..0]of PLine; PPLines = ^TPLines; Properties Width : Integer Width of Bitmap Height : Integer Height of Bitmap Pixels : PPLines Modified pointer to bits (pixels[y,x] accessable) Gap : Integer Size of buffer between scanlines RowInc : Integer Space between scanlines Bits : Pointer Pointer to Bits Size : Integer Size of Bits Handle : Integer Handle of Bitmap hDC : Integer GDI surface of Bitmap bmInfo : TBITMAPINFO bmHeader : TBITMAPINFOHEADER Methods constructors Create(cx,cy:Integer); CreateFromFile(lpFile:string); CreateFromhBmp(hBmp:Integer); CreateFromRes(Inst:Integer;Name:string); CreateCopy(hBmp:TFastBMP); gdi routines Draw(hDst,x,y:Integer); Stretch(hDst,x,y,cx,cy:Integer); DrawRect(hDst,x,y,sx,sy,cx,cy:Integer); TileDraw(hDst,x,y,cx,cy:Integer); software routines Resize(Dst:TFastBMP); SmoothResize(Dst:TFastBMP); CopyRect(Dst:TFastBMP;x,y,sx,sy,cx,cy:Integer); Tile(Dst:TFastBMP); Documentation Width / Height: These are the logical width and height of the bitmap, but the actual pixel array is zero base. When accessing the pixels in a loop you should go through 0 to Width-1, or 0 to Height-1. Pixels: This pointer has a special structure to allow access to the bits through y,x coordinates. x and y must be variables since its a dynamic array. Pixels[y] points to the scanline y (PLine) Pixels[y,x] is the pixel at [y,x] (TFColor) You should always access the pixels in order, from top to bottom going side to side. This keeps your pointer from jumping all over the place. Example: for y:=0 to Bmp.Height-1 do for x:=0 to Bmp.Width-1 do Bmp.Pixels[y,x].r:=23; Also note that you must use variables with this property: Bmp.Pixels[5,7].r:=23; //compile error y:=5; x:=7; Bmp.Pixels[y,x].r:=23; Gap / RowInc: These are properties to help with incremental and linear access to pixels. There are 3 different ways to access the pixels in your bitmap: Random Access For random access to pixels you must use the pixels property. Linear Access Use this method when accessing the lines incrementally, but you need random access to the pixels of that line. var Line: PLine; Line:=Bmp.Bits; //initialize pointer (now points to scanline 0) for y:=0 to Bmp.Height-1 do begin for x:=0 to Bmp.Width-1 do begin //random access to Line[x] end; Line:=Pointer(Integer(Line)+Bmp.RowInc); //move pointer to next line end; Incremental Access This is the fastest method for incremental access to each pixel: var PFC: PFColor; PFC:=Bmp.Bits; //initialize pointer (now points to pixels[0,0]) for y:=0 to Bmp.Height-1 do begin for x:=0 to Bmp.Width-1 do begin //access to PFC^ Inc(PFC); end; PFC:=Pointer(Integer(PFC)+Bmp.Gap); //scoot pointer pass buffer end; Bits / Size: You can copy the bits of one FastBMP to another with CopyMemory: CopyMemory(Dst.Bits,Bmp.Bits,Dst.Size); .Jl-Vq~–·)Euí·§—“      u‰d e m ) U V ' > ? y z ùòìêèàhhhhhhhìì a b p , - 1 > ?  ê 167Jùíéá±*h************hh&;IP’—÷ó×************  'K@Normala "A@ò"Default Paragraph Font@ FMicrosoft Word 6.0 Document MSWordDoc9q

近期下载者

相关文件


收藏者