5 views

Uploaded by Princess Yashika

- Accumulator Circuits
- Accredited Hospital list
- Adam Fowler Portfolio 2
- Edexcel IGCSE 2009 Graphic Design & Photography
- The Growth and Yield Performance of Brassica alboglabra (Chinese Kale) apply with difference rate of Vermicompost
- Acti Fisheye Cube Camera
- Tutorial
- Gimp
- A-Novel-Local-Pattern-Descriptor-Local-Vector-Pattern-in-High-Order-Derivative-Space-for-Face-Recognition.pdf
- Olusegun Adebajo CSR
- FluidSynth-LADSPA
- 1 Introduction 16x9
- Brain-2005-Bertone-2430-41
- Brain-2005-Bertone-2430-41
- 36194
- 05 Image Acquisition
- Datasheet_of_DS-2CD1041-I
- 簡報1
- c j ball resume2015
- Bertie Cloutman CV 2018

You are on page 1of 19

.1.

The 1s & 0s select foreground and background color, respectively. For transparent mode, only 1s are written with foreground color. Anchor the pattern at a vertex of a primitive; this choice allows the pattern to move with the primitive Anchor the pattern at the corner of the drawing area; the pattern does not move with the primitive Generating patterns while scan-converting, or scan converting a primitive first into a rectangular work area, and then copy pixels from the rectangular bitmap to the appropriate space in the background.

.2.

ATTRIBUTES In general, any parameter that affects the way a primitive displayed is an attribute parameter. Line attributes type (solid, dashed, dotted), width, cap (butt, round, projecting square caps), join (miter, round, etc.), color, grayscale

.3.

void glPointSize(GLfloat size); void glLineWidth(GLfloat width); glLineStipple(1, 0x3F07); glEnable(GL_LINE_STIPPLE); void glLineStipple(GLint factor, Glushort pattern);

Stippled Lines

.4.

SPECIFYING A COLOR

glColor3f(0.0, 0.0, 0.0); draw_object(A); draw_object(B); glColor3f(1.0, 0.0, 0.0); draw_object(C);

glColor3f(0.0, 0.0, 0.0); glColor3f(1.0, 0.0, 0.0); glColor3f(0.0, 1.0, 0.0); glColor3f(1.0, 1.0, 0.0); glColor3f(0.0, 0.0, 1.0); glColor3f(1.0, 0.0, 1.0); glColor3f(0.0, 1.0, 1.0); glColor3f(1.0, 1.0, 1.0);

.5.

ANTIALIASING

Demo

Antialiasing

.6.

Supersampling (postfiltering) Increase sampling rate, each pixel area is covered by a finer grid We can then use multiple sample points in a pixel that is within a line to determine an appropriate intensity level for the pixel.

Supersampling algorithms often choose more weight to subpixels near the center of a pixel area: pixelwighting masks

1 2 1 2 4 2 1 2 1

.7.

Determine pixel intensity by calculating the areas of overlap of each pixel with the objects to be displayed Unweighted Area Sampling

determines the pixel intensity by the overlap area only Weighted Area Sampling an area closer to the pixels center has greater influence on the pixels intensity than an equal area further away from the pixels center.

.8.

FILTER FUNCTIONS

Cone filter , Gaussian filter, Intensity table, etc.

A simple equation for 3-pixel wide line

Given the current pixels color (r, g, b), we can modify the intensity by: (r, g, b)*(1-D/1.5). When a pixel is exactly on the line (D=0), the pixels intensity is not changed. When a pixel is far away from the center of the line (D=1.5), the pixels intensity is modified to (0, 0, 0). Therefore, the pixels have different intensity levels depending on their distances from the center of the line. For a foreground color F and B, we can use: F*(1-D/1.5) + B*D/1.5. We can read the current pixel color from the framebuffer.

void glGetDoublev(GL_CURRENT_RASTER_COLOR, GLdouble *params );

How to calculate D?

Copyright @ 2002 by Jim X. Chen: jchen@cs.gmu.edu

.9.

Copyright @ 2002 by Jim X. Chen: jchen@cs.gmu.edu

.10.

Antialiasing

r1=r*(1-d/1.5); g1=g*(1-d/1.5); b1=b*(1-d/1.5); glColor3f(r1, g1, b1); writepixel(x,y); }

Example: J1_4_Line

Copyright @ 2002 by Jim X. Chen: jchen@cs.gmu.edu

.11.

void antialiasedLine(int x0,int y0,int xn,int yn) { int dx, dy, incrE, incrNE, d, x, y; Antialiasing float D=0, sin_a, cos_a, smc_a, Denom;

dy=yn-y0; dx=xn-x0; x=x0; y=y0; d=2*dy-dx; incrE=2*dy; incrNE=2*(dy-dx); Denom = sqrt(dx*dx + dy*dy); sin_a = dy / Denom; cos_a = dx / Denom; smc_a = sin_a - cos_a; while (x<xn+1) { IntensifyPixel(x,y,D); // current pixel IntensifyPixel(x,y+1,D-cos_a); // North IntensifyPixel(x,y-1,D+cos_a); // South x++; if (d<=0) { D+=sin_a; d+=incrE; } else { D+=smc_a; y++; d+=incrNE; }; } } /* AntiAliased Midpoint Algorithm */

.12.

Motion in a movie is achieved by projecting a sequence of pictures at 24 frames per second on the screen 60 per second is smoother than 30, and 120 is marginally better than 60. Refresh rates faster than 120 make no difference

open_window(); for (i = 0; i < 1000000; i++) { clear_the_framebuffer (); draw_frame(i); wait_until_a_24th_of_a_second_is_over (); } Double

.13.

Items drawn first are visible for the full 1/24 second and present a solid image on the screen; items drawn toward the end are immediately cleared as the program starts on the next frame. The animation is jerky and blurry. Double-buffering - hardware or software that supplies two complete color buffers. The frontbuffer is displayed while the backbuffer is drawn. When the drawing of a frame is complete, the two buffers are swapped.

open_window_in_double_buffer_mode(); for (i = 0; i < 1000000; i++) { clear_the_backbuffer (); draw_frame_into_backbuffer (i); swap_the_buffers (); }

Copyright @ 2002 by Jim X. Chen: jchen@cs.gmu.edu

Double

.14.

Double Buffers

If you create a single-buffered window, you can't change it. It is rarely used anyway. You can specify to draw into both front and back buffers

gl.glDrawBuffer(GL.GL_FRONT_AND_BACK);

Assuming that your system refreshes the display 60 times per second, this means that the fastest image frame rate you can achieve is 60 frames per second. If all your frames can be cleared and drawn in under 1/60 second, your animation will run smoothly at that rate. What often happens on such a system is that the frame is too complicated to draw in 1/60 second, so each frame is displayed more than once. Notice the difference between the image frame rate and display refresh rate.

.16.

y v2

y v2 v1 x v4 v12 v1

Circle

v3

a) depth=0

b) depth=1

depth=0, draw 4 triangles. depth=1, each triangle is subdivided into two and we draw 8 triangles.

consider v1, v2, and v12 as vectors. Then, v12 is in the direction of (v1 + v2)=(v1x+v2x, v1y+v2y, v1z+v2z) and |v1| = |v2| = |v12|. v12 = normalize(v1 + v2). Normalizing a vector is equivalent to scaling the vector to a unit vector.

Copyright @ 2002 by Jim X. Chen: : jchen@cs.gmu.edu

.17.

Example: J1_5_Circle

subdivideCircle(int radius, float[] v1, float[] v2, int depth) { float v11[] = new float[3]; float v22[] = new float[3]; float v00[] = { 0, 0, 0 }; float v12[] = new float[3]; if (depth == 0) { for (int i = 0; i < 3; i++) { v11[i] = v1[i] * radius; v22[i] = v2[i] * radius; } drawtriangle(v11, v22, v00); return; } v12[0] = v1[0]+v2[0]; v12[1] = v1[1]+v2[1]; v12[2] = v1[2]+v2[2]; normalize(v12); // subdivide a triangle recursively, and draw them subdivideCircle(radius, v1, v12, depth - 1); subdivideCircle(radius, v12, v2, depth - 1); }

Copyright @ 2002 by Jim X. Chen: jchen@cs.gmu.edu

Draw a pentagon with antialiasing that rotates in a circle. Within the star there is a filled circle. The filled circle should be filled through subdivision with your own triangle function. The triangle should have a pattern of your choice. For example, random generated color. Clipping should be still in force.

- Accumulator CircuitsUploaded bycristi_ama
- Accredited Hospital listUploaded byAnuraag Srivastav
- Adam Fowler Portfolio 2Uploaded byAdam Fowler
- Edexcel IGCSE 2009 Graphic Design & PhotographyUploaded byAlejandro
- The Growth and Yield Performance of Brassica alboglabra (Chinese Kale) apply with difference rate of VermicompostUploaded byRaja Hasnizan
- Acti Fisheye Cube CameraUploaded byAbdulkarim Al-shukaili
- TutorialUploaded byapi-3830700
- GimpUploaded byEnescu Iulian
- A-Novel-Local-Pattern-Descriptor-Local-Vector-Pattern-in-High-Order-Derivative-Space-for-Face-Recognition.pdfUploaded bypondyit
- Olusegun Adebajo CSRUploaded byOlusegun Jovictor 'dvc' Adebajo
- FluidSynth-LADSPAUploaded byAdam Robinson
- 1 Introduction 16x9Uploaded byerumati_patil
- Brain-2005-Bertone-2430-41Uploaded bysmosmoroulis
- Brain-2005-Bertone-2430-41Uploaded byCosmin Bejan
- 36194Uploaded byjjpaul
- 05 Image AcquisitionUploaded bygamalielclamor_19
- Datasheet_of_DS-2CD1041-IUploaded byJorge Ortiz
- 簡報1Uploaded byAshley Thomas
- c j ball resume2015Uploaded byapi-296311133
- Bertie Cloutman CV 2018Uploaded bybertiecloutman
- Presentation CVUploaded byAndres Carrion Guijarro
- RikkiarnoldcoveringletterUploaded byRikki Marc Arnold
- Ougd303 Brief 5Uploaded byRobyn Russell-O'Shea
- EKG – Bagian 2Uploaded bylintang andila
- 380 consciousnessJPP-10Uploaded byTito Arecchi
- Darren Tate CvUploaded bydaztate
- Lecture 1Uploaded byAfaf
- Resume 2010 - 4Uploaded bydrewbeck
- JobsUploaded byj
- Creating DigiNegs With the Epson 2200Uploaded bySergio Duarte

- Image FormationUploaded byFinding_Nemo4
- IRJET- Identifying the Blood Group using Image ProcessingUploaded byIRJET Journal
- Image Dilation Without Using 'Imdilate' Function _ IMAGE PROCESSINGUploaded bySachin Suryavanshi
- 9783319288529-c2.pdfUploaded byrahul
- Image processingUploaded byRevathi
- tabla-de-acronimos.pdfUploaded bylander55
- Create a Marvelously British Scone Text Effect in Adobe PhotoshopUploaded byRevathi naidu
- Hi-Tech Tele Radiology BrochureUploaded byvyadkikar
- Survey on Different Methods for Defect DetectionUploaded byIRJET Journal
- Lecture 9Uploaded byarunnehruifet
- Digital Image Processing Examination-3.pdfUploaded byamalwaysright
- Evaluation of Scalar Value Estimation Techniques for 3D Medical ImagingUploaded byعلي علي
- ECE Matlab DIP Proj. Titles Abstracts)Uploaded byACTS TECHNO SOLUTIONS
- Zhu 2017Uploaded byIness Ben
- Sampling n QuantizationUploaded byDonika Markande
- Iecbes Breast CancerUploaded byKarthik Rajv
- Siggraph2011_SpecialEffectsWithDepth_WithNotesUploaded byMoises Otero Serrano
- Currency Recognition System Using Image ProcessingUploaded bysi_miaomiao
- Image Enhancement for Face RecognitionUploaded byShivangi Srivastava
- Tutorial 1Uploaded byShunKai
- DIP2 Image Enhancement1Uploaded byUmar Talha
- 01 IntroductionUploaded byadityabaid4
- Ch09 Dipum ArtUploaded byMohammed AL-Maaitah
- A New Approach of Improving CFA Image for Digital Camera’sUploaded byPradeep Singla
- lab_1Uploaded bynandkishor joshi
- Advanced visual effects in 2d gamesUploaded bynicolas
- unit 7 test study guide-2Uploaded byapi-313501619
- A Detailed Explanation of How Photoshop Blend Modes WorkUploaded bygiaponese
- Analysis of Image Fusion Techniques for fingerprint Palmprint Multimodal Biometric SystemUploaded byAnonymous 7VPPkWS8O
- Texture Synthesis Based On Image Resolution Enhancement Using Wavelet TransformsUploaded byijcsis