Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. anti-aliasing algorithm

anti-aliasing algorithm

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsalgorithmsquestion
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    There anybody know anti-aliasing algorithm?? I want to make free-drawing application program. and want to adopt there anti-aliasing algorithm.. to avoid jagged How do am I??

    P 1 Reply Last reply
    0
    • L Lost User

      There anybody know anti-aliasing algorithm?? I want to make free-drawing application program. and want to adopt there anti-aliasing algorithm.. to avoid jagged How do am I??

      P Offline
      P Offline
      Philip Nicoletti
      wrote on last edited by
      #2

      The basic idea is this : 1) you calculate the percent coverage of each pixel when drawing the line. 2) you set the pixel color based on the percent coverage. For example, if drawing a white line RGB(255,255,255) : * if the pixel is 100 % covered, set the pixel color to RGB(255,255,255) * if the pixel is 50 % covered, set the pixel color to RGB(127,127,127) etc. The hard part is step 1. The way to see what coverage means is to take a piece of graph paper - each grid cell represents a pixel. Draw a line from a start pixel to an end pixel. But the line is really a long rectangle, in which 2 of the sides are of unit length. You will see that some pixels are nearly fully covered, others on slightly covered. Unfortunately, the details of calculating these coverage values are complex. Maybe some OLD graphics text book will have more info on how to calculate the values. What graphics package are you using ? I know that both openGL and Direct3D support antialiasing. I have not used Direct3D, but the openGL implementation is very easy to use.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups