Re: Programmable pulse generator



jimwalsh142@xxxxxxxxxxx wrote:
Kolja Sulimma wrote:
I have't heard of that... could you post some links?

Bresenham invented famous algorithms for efficiently drawing lines and circles on bitmaps.
The point here is to realized that the line drawing algorithm can be used for any kind of scaling with factors less than one.
Bresenhams algorithm computes when you need to go up when drawing a line X pixels to the right and Y pixels up.
This is the same problem as producing Y pulses in X clock cycles. Or scaling a bitmap by a factor Y/X. Or....

The algorithm is really simple:
eps = X;
while(true) {
wait_for_clock_edge();
eps -= Y;
if (eps < 0) {
generate_pulse();
eps += X;
}
}

Kolja Sulimma
.



Relevant Pages

  • Problem with Gdiapi TestCase 225: LineTO
    ... Lines using a proprietory algorithm. ... drawing lines is not pixel accurate with the GDI Line Drawing Function ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Drawing lines of variable widths
    ... "This version of the demo only supports the drawing of lines in the ... I originally coded the algorithm in 1976, but when I published the web ... This is an easy thing to do when I want to draw a line of zero or no ... The algorithm supports non-integer pen thicknesses. ...
    (comp.graphics.misc)
  • Re: Drawing a line - point by point
    ... > I used to have an algorithm for drawing a line pixel by pixel but a ... Alas, Alas, you've probably not been searching for the right thing. ... far and away the fastest alogirhtm is the Bresenham line drawing ...
    (comp.lang.pascal.delphi.misc)
  • Re: High spped drawing with MFC is it possible?
    ... Data drawing function first calculates the location of point on screen ... algorithm so that it first determines whether a point overlaps other points ...
    (microsoft.public.vc.mfc.docview)