bresenham line algorithm verilog
#1

I want to see which is the verilog code for drawing a line using bresenham line algorithm
Reply
#2

Introduction

The goal for this project was to design a capable, generically definable graphics processing unit (GPU) in hardware that could easily be interfaced to a CPU or other onboard hardware to provide easy and efficient graphics capabilities. The GPU provides support for many useful functions, including drawing points, rectangles, lines, images (via bitmap file decoding), and text. Additionally, the GPU provides dual-layer display capabilities, allowing the user to draw a transparent top overlay over a bottom graphics layer. The hardware was designed to allow for easy inclusion of additional graphics drawing features through use of a standard hardware function interface, and allows a Nios II developer to generate elaborate graphical displays with minimal effort.

As a proof of concept, the graphics engine was demonstrated by developing a rudimentary digital picture frame using a Nios II processor core. The processor drew a selection of images to the screen and overlayed the images with menus a user could use to control various features. Development of the C code for the picture frame was quick and simple, confirming the usefulness of the GPU.

// Author: Jason Morley (Source: http://morleydev.co.uk/blog/2010/11/18/g...basic-net/)
using System;

namespace Bresenhams
{
/// <summary>
/// The Bresenham algorithm collection
/// </summary>
public static class Algorithms
{
private static void Swap<T>(ref T lhs, ref T rhs) { T temp; temp = lhs; lhs = rhs; rhs = temp; }

/// <summary>
/// The plot function delegate
/// </summary>
/// <param name="x">The x co-ord being plotted</param>
/// <param name="y">The y co-ord being plotted</param>
/// <returns>True to continue, false to stop the algorithm</returns>
public delegate bool PlotFunction(int x, int y);

/// <summary>
/// Plot the line from (x0, y0) to (x1, y10
/// </summary>
/// <param name="x0">The start x</param>
/// <param name="y0">The start y</param>
/// <param name="x1">The end x</param>
/// <param name="y1">The end y</param>
/// <param name="plot">The plotting function (if this returns false, the algorithm stops early)</param>
public static void Line(int x0, int y0, int x1, int y1, PlotFunction plot)
{
bool steep = Math.Abs(y1 - y0) > Math.Abs(x1 - x0);
if (steep) { Swap<int>(ref x0, ref y0); Swap<int>(ref x1, ref y1); }
if (x0 > x1) { Swap<int>(ref x0, ref x1); Swap<int>(ref y0, ref y1); }
int dX = (x1 - x0), dY = Math.Abs(y1 - y0), err = (dX / 2), ystep = (y0 < y1 ? 1 : -1), y = y0;

for (int x = x0; x <= x1; ++x)
{
if (!(steep ? plot(y, x) : plot(x, y))) return;
err = err - dY;
if (err < 0) { y += ystep; err += dX; }
}
}
}
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: bresenham line drawing algorithm vhdl fpgae, xy routing algorithm verilog, bresenham s circle drawing algorithm pdf, param 10000, thaip param bil, draw a flowchart for bresenham algorithm, advantages of bresenham s circle drawing algorithm,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  image encryption and decryption using rsa algorithm in matlab 2 7,916 29-05-2017, 04:17 PM
Last Post: Priyanka Bidikar
  source code for task scheduling using genetic algorithm using java 2 8,534 11-04-2017, 08:31 PM
Last Post: Guest
  vhdl code for radix 2 modified booth algorithm 4 1,022 04-04-2017, 10:24 AM
Last Post: Garlapati nikitha
  secure chat using RSA algorithm karthik1218 2 2,583 14-10-2016, 02:48 PM
Last Post: info togel
  f5 algorithm steganography matlab code 2 871 04-10-2016, 03:00 AM
Last Post: [email protected]
  color image segmentation using jseg algorithm in matlab code 2 868 29-09-2016, 12:07 PM
Last Post: Guest
  matlab xy routing algorithm 2 830 12-08-2016, 09:16 PM
Last Post: khant
  matlab code energy based spectrum sensing in cognitive radio energy threshold based algorithm 2 1,063 06-08-2016, 03:30 PM
Last Post: murthyhs
  solved examples on audio steganography using genetic algorithm 2 628 21-07-2016, 03:12 PM
Last Post: dhanabhagya
  tcl source code for genetic algorithm to find the shortest path in ns2 2 822 21-07-2016, 03:04 PM
Last Post: dhanabhagya

Forum Jump: