scanline

How to implement the scanline access of TBitmap correctly?

帅比萌擦擦* 提交于 2021-02-08 15:26:10
问题 I am trying to access the scanline of a Bitmap according to an article on Embarcadero. Using scanlines like for y := 0 to n do begin line := bitmap.scanline [y]; for x := 0 to n do line [x] := value; I have implemented before. I noticed that accessing a scanline takes relatively much time and the article mentioned above offers a solution to that. I am not able to implement it correctly. My code is: unit SCTester; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics,

How to get scanlines over background image in CSS

守給你的承諾、 提交于 2020-05-15 08:05:09
问题 I have a full-page background image that I'd like to overlay scanlines over. I'm wanting to replicate the more traditional diagonal scanline effects that I grew up seeing in digital art of the noughties, such as implemented here in Bootstrap's pattern mask 5: I've seen a few tutorials for diagonal scanlines, but haven't been able to find anything like this. How would I accomplish it in CSS? 回答1: here is an approximation using multiple background: html { height:100%; background: radial

converting a PNGImage to grayscale using delphi

自闭症网瘾萝莉.ら 提交于 2019-12-21 02:43:52
问题 hi there here it is my code: procedure TForm4.Button1Click(Sender: TObject); var png: TPNGImage; data: PRGBQarray; p: ^tagRGBQuad; i, o: integer; begin png := TPNGImage.Create; try png.LoadFromFile('C:\Untitled.png'); for o := 1 to 100 do begin data:=png.Scanline[o]; for I := 1 to 400 do begin p := @data^[i]; p.rgbGreen := p.rgbBlue; p.rgbRed := p.rgbGreen; end; end; img.picture.Assign(png); finally png.Free; end; end; it doesn't work and it makes the pic messy, I'm sure it's because of the

scanline: finding intersection points

☆樱花仙子☆ 提交于 2019-12-11 07:58:11
问题 I want to fill a polygon with the scanline algorith. for this I have to know all points where the scanline comes in contact with the polygon. I wrote a loop for this, but its obviously not working (it never adds a point to the list which means it can't find any points which cuts the polygon) I can create a Polygon and have all Edges from it. Here is my code for getting the points of the scanline which intersect the polygon xmin, xmax, ymin and ymax are the max points from the polygon. They

Scan Lines for Particle Filter with openGL

江枫思渺然 提交于 2019-12-10 17:56:20
问题 I am implementing a Particle Filter for a 3D cube tracking in C++. I faced a significant problem when assigning weights for the particles, because weights are based on the error in distance (in this case) between a sample point and a pixel (explained below). Currently I am able to get a video stream from the camera on my laptop, display it on a screen and draw particles on top of that. Also I am able to extract edges of objects detected from the camera and find their contours' coordinates.

Delphi TBitmap - why are Pixels and ScanLine different?

浪尽此生 提交于 2019-12-01 22:10:01
问题 While using a 32 bit TBitmap, I switched from Canvas.Pixels to ScanLine. I then set the value to Red, only to find it was displayed as blue. Any idea why? Here's a code excerpt: procedure TForm1.FormPaint(Sender: TObject); var varBitmap: TBitmap; pLock: PIntegerArray; iColor: integer; begin varBitmap := TBitmap.Create; varBitmap.PixelFormat := pf32bit; varBitmap.Width := 800; varBitmap.Height := 600; // Set Pixels to Red varBitmap.Canvas.Pixels[0, 0] := $0000FF; // Shows $FF0000 (blue) pLock

Delphi TBitmap - why are Pixels and ScanLine different?

≡放荡痞女 提交于 2019-12-01 19:40:01
While using a 32 bit TBitmap, I switched from Canvas.Pixels to ScanLine. I then set the value to Red, only to find it was displayed as blue. Any idea why? Here's a code excerpt: procedure TForm1.FormPaint(Sender: TObject); var varBitmap: TBitmap; pLock: PIntegerArray; iColor: integer; begin varBitmap := TBitmap.Create; varBitmap.PixelFormat := pf32bit; varBitmap.Width := 800; varBitmap.Height := 600; // Set Pixels to Red varBitmap.Canvas.Pixels[0, 0] := $0000FF; // Shows $FF0000 (blue) pLock := varBitmap.ScanLine[0]; iColor := pLock[0]; ShowMessageFmt('%x', [iColor]); // Set ScanLine to Red