0% found this document useful (0 votes)
29 views10 pages

Graph-Lecture 1 Introduction

This document provides an introduction to computer graphics. It discusses key concepts such as pixels, vector images, raster images, passive and interactive graphics. It also discusses applications of computer graphics such as CAD, virtual reality, and video games. The document then covers topics like dot pitch, refresh rate, and resolution as they relate to computer display and output. It describes the cathode ray tube and how raster scan and random scan displays work to output graphics on a screen.

Uploaded by

asmaa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
29 views10 pages

Graph-Lecture 1 Introduction

This document provides an introduction to computer graphics. It discusses key concepts such as pixels, vector images, raster images, passive and interactive graphics. It also discusses applications of computer graphics such as CAD, virtual reality, and video games. The document then covers topics like dot pitch, refresh rate, and resolution as they relate to computer display and output. It describes the cathode ray tube and how raster scan and random scan displays work to output graphics on a screen.

Uploaded by

asmaa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 10

COMPUTER GRAPHICS

THIRD CLASS

University of Diyala/ College of education for pure


science / Computer science department

Dr. Adil I. KHALIL


14/10/2017
1 COMPUTER GRAPHICS

References:

1. PACHGHARE, V. K. Comprehensive Computer Graphics (including C++). Laxmi


Publications, 2005.

2. Hughes, John F., and James D. Foley. Computer graphics: principles and practice.
Pearson Education, 2014.

3. HEARE, Donald et BAKER, M. Pauline. Computer Graphics (C Version). 1998.

1. INTRODUCTION TO COMPUTER GRAPHICS

 The first graphical display was invented in 1950 by Massachusetts Institute of


Technology (MIT).

 Computer graphics is now a well-known technology. It is one of the most important


application of technology

 The term computer graphics involves the use of computer to create, store, manipulate
and present the information on the computer screen in different ways.
‫ اضافة الى ذلك يتضمن محور رسوم‬.‫يمكن تعريف رسوم الحاسوب على انه المجال الذي يتضمن استخدام الحاسوب لبناء الصورة‬
.‫الحاسوب خزن واجراء عمليات تعديل على بيانات الصورة ومن ثم تمثيلها على شاشة الحاسوب باشكال مختلفة‬

 Computer graphics allows communication through pictures, charts and diagrams to the
people

Q: Why do we need computer graphics? Give an example from the real life.

Applications: ‫اهم تطبيقات رسوم الحاسوب في مجاالت العلوم المختلفة‬

 Computational biology
 Computational physics
 Computer-aided design (CAD)
 Virtual reality environment  flight training simulation
 Digital art  logo design, smart pen
 Education  computer-generated model
 Image processing
 Information visualization
 Video Games
 Web design
 Architecture
‫‪2‬‬ ‫‪COMPUTER GRAPHICS‬‬

‫‪Computer aided design (CAD):‬‬

‫يعتبر نظامي التصميم المسند بالحاسب والتصنيع المسند بالحاسب ‪ CAD/CAM‬من األنظمة التي تنمو فيها رسوم الحاسب بشكل واسع‬
‫‪,‬فمثال الدوائر االلكترونية في الدوائر المتكاملة ‪ IC‬يمكن ان تخزن كرسم على الحاسب بملف في ذاكرة الحاسب الثانوية ‪.‬‬

‫باستخدام ال التصميم المسند بالحاسوب ‪ CAD‬يمكن توفير الكثير من الجهد والوقت ‪,‬حيث يوفر هذا البرنامج دوائر الكترونية جاهزة‬
‫يمكن تنزيلها على لوحة العمل في الحاسوب من خالل سحبها بواسطة الفارة وعمل الدائرة االلكترونية ومن ثم اجراء التعديالت عليها‬
‫واالختبارات قبل التصنيع وهذا ما يعرف ب ‪.computer aided design‬‬

‫اما ال ‪ CAM‬والمعروف ب ‪ computer aided manufacturing‬فيستخدم إلسعاف المصنع ‪ ,‬فالتصميم يرسم على الحاسب ثم‬
‫يتم تصويره وتصغيره (اما بالتصوير او بالحاسوب ) ويستخدم كقناع لحفر الدوائر االلكترونية‪.‬‬

‫‪Concept of Computer Graphics :‬‬ ‫بعض المفاهيم االساسية في رسوم الحاسوب‬

‫‪ Pixel: the pixel is the smallest addressable screen element‬‬


‫النقطة ‪ pixel‬هي اصغر مساحة فيزيائية يتم استخدامها لعرض الصور على الشاشة بعد تمثيل بيانات الصورة في الذاكرة‪ .‬يمكن تمثيل‬
‫النقطة بعدد محدد من البت ‪ bits‬قد يتراوح بين بت واحد او اكثر‪.‬‬

‫‪‬‬ ‫‪Vector images: is the use of polygons to represent images in computer graphics‬‬

‫هو عملية تمثيل الصورة على الشاشة من خالل استخدام المعادالت الرياضية بدل استخدام التمثيل النقطي كاحداثيات في الذاكرة‬

‫‪‬‬ ‫‪Raster images: an image is a dot matrix data structure, representing a generally‬‬
‫‪rectangular grid of pixels, or points of color, viewable via a monitor, paper, or other‬‬
‫‪display medium‬‬

‫هو عملية تمثيل الصورة على الشاشة من خالل تمثيلها في الذاكرة على شكل مصفوفة ثنائية البعد من القيم الرقمية واللونية لكل تمثل‬
‫احاثيات ولون كل نقطة على شاشة الحاسوب‬

‫‪‬‬ ‫‪Passive computer graphics: the graphic does not do anything special when the user‬‬
‫‪tries to interact with it.‬‬
‫رسوم ثابتة او الغير تفاعلية ال تحتوي على اي خصائص للتفاعل مع المستخدم مثال على ذلك االعالنات الثابتة‪.‬‬
‫‪‬‬ ‫‪Interactive Computer Graphics: the observer is given some control over the image by‬‬
‫‪providing him with an input device, for example the video game controller of the ping‬‬
‫‪pong game.‬‬
‫الرسوم التفاعلية تعطي المستخدم السيطرة للتفاعل مع الرسوم واجراء بعض التعديالت من خالل تزويد المستخدم بجهاز تحكم لتحديث‬
‫الرسوم مثال على ذلك العاب الكومبيوتر التفاعلية‬
‫‪‬‬ ‫‪Text mode: is a display mode divided into rows and columns of boxes showing only‬‬
‫‪alphanumeric characters. The text screen is divided into 80 columns and 25 rows‬‬
3 COMPUTER GRAPHICS

‫ حيث يتم تقسيم الشاشة الى عدد من االعمدة والصفوف من المربعات الصغيرة‬text mode ‫هو حالة الكتابة على الشاشة تسمى‬
‫ في بيئة لغة سي بلس بلس يتم‬.‫) تتيح للمستخدم كتابة الحروف والرموز واليمكن استخدام هذا النمط لتمثيل الرسوم على الشاشة‬pixels(
) text mode ( ‫ صف عند اختيار حالة الكتابة‬25 ‫ عمود و‬80 ‫تقسيم الشاشة الى‬

 Graphics mode: is a computer display mode that generates image using pixels.
‫ حيث يتم االنتقال الى هذه الحالة عند الحاجة الى تمثيل‬graphics mode ‫هو حالة الرسم على الحاسوب وتسمى‬
‫ الذي يتم تمثيله في‬pixels ‫ورسم الصور على شاشة الحاسوب حيث يتم تقسيم شاشة الحاسوب الى عدد اكبر من ال‬
.text mode ‫حالة الكتابة‬
 Dot pitch: It is the amount of space between the center of adjacent pixels, the closer the
dots, the crisper the image. For crisp images, dot pitch should be less than 0.31
millimeter.
 Refresh Rate: It is the number of times per second that the pixels are recharged so that
their glow remains bright. In general, displays are refreshed 45 to 100 times per second.
 Resolution is the number of visibly distinct dots that can be displayed in a given area of
the screen. Resolution is expressed in terms of the formula (horizontal pixels×vertical
pixels). Each pixel can be assigned a color or particular shade of gray. A screen with
640×480 pixels multiplied together equals 307200 pixels. This screen will be less clear
and sharp than a screen with 800×600 (equals 480000) 0r 1024×768 (equals 786432)
pixels.
4 COMPUTER GRAPHICS

Typically, the resolution indicates how many pixels (dots) are displayed within an inch (1 inch =
25.4mm).

The higher the resolution is, the better is the appearance of fine details.
5 COMPUTER GRAPHICS

Image with low resolution (50dpi) Image with higher resolution (150dpi)

Cathode Ray Tube

The primary output device in a graphical system is the video monitor. The main element of a
video monitor is the Cathode Ray Tube (CRT), shown in the figure below.

The operation of CRT is very simple

 The electron gun emits a beam of electrons (cathode rays).


 The electron beam passes through focusing and deflection systems that direct it towards
specified positions on the phosphor-coated screen.
 When the beam hits the screen, the phosphor emits a small spot of light at each position
contacted by the electron beam.
 It redraws the picture by directing the electron beam back over the same screen points
quickly.
6 COMPUTER GRAPHICS

There are two ways (Random scan and Raster scan) by which we can display an object on the
screen.

Raster-Scan Display

In a raster scan system, the electron beam is swept across the screen, one row at a time from
top to bottom. As the electron beam moves across each row, the beam intensity is turned on
and off to create a pattern of illuminated spots.

Picture definition is stored in memory area called the Refresh Buffer or Frame Buffer. This
memory area holds the set of intensity values for all the screen points. Stored intensity values
are then retrieved from the refresh buffer and “painted” on the screen one row (scan line) at a
time as shown in the following illustration.

Each screen point is referred to as a pixel (picture element). At the end of each scan line, the
electron beam returns to the left side of the screen to begin displaying the next scan line.

It is not possible except in special cases to directly draw a straight line from one addressable
point, or pixel in the matrix to another addressable point, or pixel. The line can only be
approximated by a series of dots (pixels) close to the path of the line.

Only in the special cases of completely horizontal, vertical or 45 degree lines will a straight line
result. All other lines will appear as a series of stair steps. This is called aliasing.
7 COMPUTER GRAPHICS

Random Scan (Vector Scan) display

In this technique, the electron beam is directed only to the part of the screen where the picture
is to be drawn rather than scanning from left to right and top to bottom as in raster scan. It is
also called vector display, stroke-writing display, or calligraphic display.

Picture definition is stored as a set of line-drawing commands in an area of memory referred to


as the refresh display file. To display a specified picture, the system cycles through the set of
commands in the display file, drawing each component line in turn. After all the line-drawing
commands are processed, the system cycles back to the first line command in the list.

Random-scan displays are designed to draw all the component lines of a picture 30 to 60 times
each second.

Raster-scan display Random-scan display

How does the interactive graphics display work?

:‫ألجل بناء وعرض الصورة على شاشة الحاسوب يجب توفر ثالث عناصر اساسيه وهي‬

1- A digital memory, or frame buffer.


matrix of intensity values).( ‫وفيها يتم خزن الصورة الظاهرة على شكل مصفوفة ثنائية البعد من القيم الرقمية‬
2- A monitor.
.‫وفيها تجري عملية عرض الصورة وهي تشبه التلفاز العادي مع عدم احتوائها على دوائر االستقبال وضبط الموجه‬
3- A display controller.
.)monitor( ‫) الى شاشة العرض‬digital memory( ‫) يقوم بتحرير محتويات الذاكرة الرقمية‬interface( ‫يمثل واجهة بسيطة‬
8 COMPUTER GRAPHICS

display
digital memory controller
monitor

Frame buffer

A frame buffer (or sometime frame store) is a portion of RAM containing a bitmap that drives
a video display. It is a memory buffer containing a complete frame of data. Modern video cards
contain frame buffer circuitry in their cores. This circuitry converts an in-memory bitmap into a
video signal that can be displayed on a computer monitor.

The information in the buffer typically consists of color values for every pixel to be shown on the
display. Color values are commonly stored in 1-bit binary (monochrome), 4-bit palettized, 8-bit
palettized, 16-bit high color and 24-bit true color formats. The total amount of memory required
for the frame buffer depends on the resolution of the output signal, and on the color depth or
palette size. A size 512*512 display screen requires (262144) pixels memory location.

In the simplest case where we wish to store only black and white images, we can represent
black pixels by 0's in the frame buffer and white pixels by 1's.

This mean:-
When the bit = 0 that mean black
When the bit= 1 that mean white

Display Controller

 A display controller, which is a simple interface that passes the contents of the frame
buffer to the monitor.

 The display controller simply reads each successive byte of data from the frame buffer
and convert each 0 and 1 to the corresponding video signal. This signal is then fed to the
monitor. If we wish to change the displayed picture all we need to do is to change of
modify the frame buffer contents to represent the new pattern of pixels.

‫ المتعاقبة من ال الذاكرة وتحويل قيمها الى ما يناطرها من اشارة‬bytes ‫ بقراءة ال‬display controller ‫يقوم ال‬ 
.‫الفيديو(التناظرية) وهذه االشارات يتم تغذيتها الى شاشة العرض إلنتاج نموذج الصورة من االبيض واالسود‬
9 COMPUTER GRAPHICS

.‫ لتمثل الشكل الجديد‬frame buffer ‫عند الحاجه الى تغير الصورة الظاهرة يجب تغير محتويات‬ 

Scan conversion algorithms

The process of representing continuous graphics objects as a collection of discrete pixels is


called scan conversion or rasterization. For e.g. a line is defined by its two end points and the
line equation, where as a circle is defined by its radius, center position and circle equation .

In order to draw a picture on a raster display we must determine the corresponding points in the
frame buffer that make up the picture. To perform this we must write scan conversion point-
plotting algorithm. Both frame buffer and display screen are given a two-dimensional
coordinates system with origin at the lower left corner. Each pixel is described in no negative
integer (x, y) coordinates pair the x value start at the origin (0) and increase from left to right(
there is no standard for the location of two origin).

You might also like