Graph-Lecture 1 Introduction
Graph-Lecture 1 Introduction
THIRD CLASS
References:
2. Hughes, John F., and James D. Foley. Computer graphics: principles and practice.
Pearson Education, 2014.
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.
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
يعتبر نظامي التصميم المسند بالحاسب والتصنيع المسند بالحاسب CAD/CAMمن األنظمة التي تنمو فيها رسوم الحاسب بشكل واسع
,فمثال الدوائر االلكترونية في الدوائر المتكاملة ICيمكن ان تخزن كرسم على الحاسب بملف في ذاكرة الحاسب الثانوية .
باستخدام ال التصميم المسند بالحاسوب CADيمكن توفير الكثير من الجهد والوقت ,حيث يوفر هذا البرنامج دوائر الكترونية جاهزة
يمكن تنزيلها على لوحة العمل في الحاسوب من خالل سحبها بواسطة الفارة وعمل الدائرة االلكترونية ومن ثم اجراء التعديالت عليها
واالختبارات قبل التصنيع وهذا ما يعرف ب .computer aided design
اما ال CAMوالمعروف ب computer aided manufacturingفيستخدم إلسعاف المصنع ,فالتصميم يرسم على الحاسب ثم
يتم تصويره وتصغيره (اما بالتصوير او بالحاسوب ) ويستخدم كقناع لحفر الدوائر االلكترونية.
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)
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.
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
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.
Random-scan displays are designed to draw all the component lines of a picture 30 to 60 times
each second.
:ألجل بناء وعرض الصورة على شاشة الحاسوب يجب توفر ثالث عناصر اساسيه وهي
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 عند الحاجه الى تغير الصورة الظاهرة يجب تغير محتويات
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).