You are on page 1of 10

Computer graphic

This course has been prepared for provide an introduction to the theory and
practice of computer graphics. It explains the basics of graphics and how they
are implemented in computers to generate various visuals.
‫ يشرح أساسيات الرسومات وكيف‬.‫تم إعداد هذه المادة لتقديم مقدمة لنظرية وممارسة رسومات الحاسوب‬
‫يتم تنفيذها في أجهزة الكمبيوتر إلنشاء عروض وصور مختلفة‬.

Computer graphic references:


1. M.Berger,” Computer Graphic with Pascal “, B/C Publishing Company, 1984.

2. J.D.Foley & A.Dametal,” Introduction to Computer Graphic “, Addison –


wesly, 1993.

3. D.Hearn & M.p.Baker,” Computer Graphics “, 2nd Ed., Prentice – Hall,


1994.

4. David J. Eck, ” Introduction to Computer Graphics“: A Practical Learning


Approach (Chapman & Hall/CRC Computer Graphics, Geometric Modeling,
and Animation.) Version 1.1, 2016.
1- Introduction to computer Graphics

Computer graphics :is an art of drawing pictures on computer


screens with the help of programming. It involves computations,
creation, and manipulation of data. In other words, we can say that
computer graphics is a rendering tool for the generation and
manipulation of images.
‫ أنها تنطوي على حسابات‬.‫هو فن رسم الصور على شاشات الكمبيوتر بمساعدة البرمجة‬
‫ يمكننا القول أن رسومات الكمبيوتر هي أداة‬، ‫ وبعبارة أخرى‬.‫وإنشاء ومعالجة البيانات‬
.‫عرض لتوليد الصور ومعالجتها‬
1-1 Picture Elements:
1. Pixel: is the smallest addressable screen element. It is the
smallest
piece of the display screen which we can control.
2. Line : has patron or type.
Specification: color, lighting, type, width.
Types of line:
----------------------
………………..

3. Curve: depends on start point and end point and angle.

1-2 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 following illustration. The operation of CRT is very
simple:

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

1
‫‪2. The electron beam passes through focusing and deflection systems‬‬
‫‪that direct it towards specified positions on the phosphor-coated‬‬
‫‪screen. 3. When the beam hits the screen, the phosphor emits a small‬‬
‫‪spot of light at each position contacted by the electron beam.‬‬

‫‪4. It redraws the picture by directing the electron beam back over the‬‬
‫‪same screen points quickly.‬‬

‫‪Figure: Cathode Ray Tube‬‬


‫جهاز اإلخراج األساسي في النظام الرسومي هو شاشة الفيديو‪ .‬العنصر الرئيسي لشاشة الفيديو هو‬
‫أنبوب أشعة الكاثود )‪ ، (CRT‬الموضح في الرسم التوضيحي التالي‪ .‬تشغيل ‪ CRT‬بسيط للغاية‪.‬‬
‫يطلق المسدس اإللكتروني شعاعًا من اإللكترونات (أشعة الكاثود)‪.‬‬ ‫‪-1‬‬
‫يمر شعاع اإللكترون من خالل أنظمة التركيز واالنحراف التي توجهه نحو المواضع المحددة‬ ‫‪-2‬‬
‫على الشاشة المغلفة بالفوسفور‪.‬‬
‫عندما يصل الشعاع إلى الشاشة ‪ ،‬ينبعث الفوسفور بقعة صغيرة من الضوء في كل موضع يصل‬ ‫‪-3‬‬
‫اليه الشعاع اإللكتروني‪.‬‬
‫يعيد رسم الصورة عن طريق توجيه شعاع اإللكترون مرة أخرى فوق نفس نقاط الشاشة‬ ‫‪-4‬‬
‫بسرعة‪.‬‬

‫‪2‬‬
There are two ways (Raster scan and Random scan) by which we can
display an object on the screen.
‫هناك طريقتان (المسح النقطي والمسح العشوائي) يمكننا من خاللهما عرض كائن على الشاشة‬.

a) Raster Scan:
This video display screen used by most microcomputer is divided into
small rectangles or dots. These dots are referred to as picture elements
or pixels. We can consider CRT ( Cathode Ray Tube ) screen to
consist of number of vertical and horizontal lines, where each
horizontal line is made up of pixels figure ( 1 ). These horizontal lines
are called Raster – scan lines, and the video display referred to a raster
– scan display. it is similar in the most-general sense to how one's gaze
travels when one reads lines of text. Raster Scan provides a refresh
rate of 60 to 80 frames per second.
‫تنقسم شاشة عرض الفيديو التي يستخدمها معظم الحواسيب الصغيرة إلى مستطيالت أو نقاط‬
‫ يمكننا اعتبار أن‬.‫ يشار إلى هذه النقاط باسم عناصر الصورة أو وحدات البكسل‬.‫صغيرة‬
‫ حيث‬، ‫ (أنبوب أشعة الكاثود) تتكون من عدد من الخطوط الرأسية واألفقية‬CRT ‫شاشة‬
‫ ويشير‬، ‫تسمى هذه الخطوط األفقية بخطوط المسح النقطي‬. ‫يتكون كل خط أفقي من بكسل‬
‫ وهو مشابه بالمعنى العام لكيفية انتقال نظرة‬.‫عرض الفيديو إلى عرض المسح النقطي‬
‫ إطارًا في‬06 ‫ إلى‬06 ‫ يوفر المسح النقطي معدل تحديث‬.‫الشخص عندما يقرأ أسطر النص‬
.‫الثانية‬

3
b) Random Scan(Vector Scan) :
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.
‫ يتم توجيه الشعاع اإللكتروني فقط إلى جزء الشاشة حيث سيتم رسم‬، ‫في هذه التقنية‬
.‫الصورة بدلً من المسح من اليسار إلى اليمين ومن أعلى إلى أسفل كما في المسح النقطي‬
‫ يتم تخزين تعريف الصورة كمجموعة من أوامر رسم‬، ‫يطلق عليه أيضًا عرض المتجهات‬
‫ لعرض صورة محددة‬.‫الخطوط في منطقة من الذاكرة يشار إليها باسم ملف عرض التحديث‬
.‫ ويرسم كل سطر مكون على حدة‬، ‫ يتنقل النظام عبر مجموعة األوامر في ملف العرض‬،
‫ تم‬.‫ يعود النظام إلى أمر السطر األول في القائمة‬، ‫بعد معالجة جميع أوامر رسم الخطوط‬
06 ‫ إلى‬06 ‫تصميم شاشات عرض المسح العشوائي لرسم جميع الخطوط المكونة للصورة‬
.‫مرة كل ثانية‬

Figure: Random Scan

4
2. Application of Computer Graphics
Computer Graphics has numerous applications, some of which are listed
below:

 Computer graphics user interfaces (GUIs) – A graphic, mouse-


oriented paradigm which allows the user to interact with a computer.

. Business presentation graphics - "A picture is worth a thousand words"

 Drawing maps.

 Weather Maps – Real-time mapping, symbolic representations.

 Satellite Imaging

 Photo Enhancement - Sharpening blurred photos.

 Medical imaging - MRIs, CAT scans, etc. - Non-invasive internal


examination.
 Engineering drawings - mechanical, electrical, civil, etc.
 Typography - The use of character images in publishing .
 Architecture - Construction plans, exterior sketches - replacing the
blueprints and hand drawings of the past.

 Art - Computers provide a new medium for artists.

 Training - Flight simulators, computer aided instruction, etc.

 Entertainment - Movies and games.

 Simulation and modeling .

5
‫تطبيق رسومات الكمبيوتر‬

‫تحتوي رسومات الكمبيوتر على العديد من التطبيقات ‪ ،‬بعضها مدرج أدناه‪:‬‬

‫واجهات مستخدم رسومات الكمبيوتر – )‪ (GUIs‬مثل الصور الرسومية (النوافذ والقوائم‬ ‫‪‬‬
‫والنصوص) و تأشيرات الماوس يسمح للمستخدم بالتفاعل مع الكمبيوتر‪.‬‬
‫رسومات عرض األعمال ‪" -‬الصورة تساوي ألف كلمة"‪.‬‬ ‫‪‬‬
‫رسم الخرائط ‪.‬‬ ‫‪‬‬
‫خرائط الطقس ‪ -‬رسم الخرائط في الوقت الحقيقي ‪ ،‬والتمثيالت الرمزية‪.‬‬ ‫‪‬‬
‫التصوير باألقمار الصناعية ‪.‬‬ ‫‪‬‬
‫تحسين الصور ‪ -‬زيادة وضوح الصور المشوشة‪.‬‬ ‫‪‬‬
‫التصوير الطبي ‪ -‬التصوير بالرنين المغناطيسي ‪ ،‬والتصوير المقطعي ‪ ،‬وما إلى ذلك ‪ -‬الفحص‬ ‫‪‬‬
‫الداخلي غير الجراحي‪.‬‬
‫الرسومات الهندسية ‪ -‬الميكانيكية والكهربائية والمدنية ‪ ،‬وما إلى ذلك‪.‬‬ ‫‪‬‬
‫الطباعة ‪ -‬استخدام صور الشخصيات في النشر ‪.‬‬ ‫‪‬‬
‫العمارة ‪ -‬خطط البناء ‪ ،‬الرسومات الخارجية‪.‬‬ ‫‪‬‬
‫الفن ‪ -‬توفر أجهزة الكمبيوتر وسيلة جديدة للفنانين‪.‬‬ ‫‪‬‬
‫التدريب ‪ -‬محاكيات الطيران ‪ ،‬تعليمات بمساعدة الكمبيوتر ‪ ،‬إلخ‪.‬‬ ‫‪‬‬
‫ترفيه ‪ -‬أفالم وألعاب‪.‬‬ ‫‪‬‬
‫المحاكاة والنمذجة‪.‬‬ ‫‪‬‬

‫)‪3.Graphical User interfaces (GUI‬‬


‫‪A GUI (graphical user interface) is a system of interactive visual‬‬
‫‪components for computer software. A GUI displays objects that‬‬
‫‪convey information, and represent actions that can be taken by the‬‬
‫‪user. The objects change color, size, or visibility when the user‬‬
‫‪interacts with them.‬‬
‫‪GUI objects include icons, cursors, and buttons. These graphical‬‬
‫‪elements are sometimes enhanced with sounds, or visual effects like‬‬
‫‪transparency and drop shadows.‬‬
‫‪A GUI is considered to be more user-friendly than a text-based‬‬
‫‪command-line interface, such as MS-DOS, or the shell of Unix-like‬‬
‫‪operating systems.‬‬

‫‪6‬‬
The GUI was first developed at Xerox PARC by Alan Kay, Douglas
Engelbart, and a group of other researchers in 1981. Later, Apple
introduced the Lisa computer with a GUI on January 19, 1983.

3.1 Features of GUIs include:

 They are much easier to use for beginners.


 They enable you to easily exchange information between
software using cut and paste or 'drag and drop'.
 They use a lot of memory and processing power. It can be
slower to use than a command-line interface if you are an
expert user.
 They can be irritating to experienced users when simple
tasks require a number of operations.
When discussing user interfaces, it is important to note that
Windows XP, Windows Vista, Apple OSX and Ubuntu all have
graphical user interfaces.

3.2. Good user interfaces


A good user interface should:
 be attractive and pleasing to the eye
 allow the user to try out different options easily
 be easy to use
 use suitable colours for key areas

7
‫‪‬‬ ‫‪use words that are easy to understand aimed at the type‬‬
‫‪of user‬‬
‫‪‬‬ ‫‪have help documentation‬‬
‫‪It should also consider the needs of the users. For example, young‬‬
‫‪children are likely to prefer pictures to words and people with‬‬
‫‪disabilities may benefit from particular input or output devices.‬‬

‫‪.3‬واجهة المستخدم الرسومية )‪(GUI‬‬

‫هي نظام للمكونات المرئية التفاعلية لبرامج الكمبيوتر‪ .‬تعرض واجهة المستخدم الرسومية كائنات تنقل‬
‫المعلومات وتمثل اإلجراءات التي يمكن للمستخدم اتخاذها‪ .‬تغير الكائنات اللون أو الحجم أو الرؤية عندما‬
‫يتفاعل المستخدم معها‪.‬‬
‫تتضمن كائنات واجهة المستخدم الرسومية الرموز والمؤشرات واألزرار‪ .‬يتم تحسين هذه العناصر‬
‫الرسومية أحيانًا باألصوات أو التأثيرات المرئية مثل الشفافية والظالل المسقطة‪.‬‬
‫تعتبر واجهة المستخدم الرسومية أكثر سهولة في الستخدام من واجهة سطر األوامر النصية ‪ ،‬مثل‪MS-‬‬
‫‪ ،DOS‬أو هيكل أنظمة تشغيل تشبه‪. Unix.‬تم تطوير واجهة المستخدم الرسومية ألول مرة في ‪Xerox‬‬
‫‪PARC‬من قبل ‪ Alan Kay‬و ‪ Douglas Engelbart‬ومجموعة من الباحثين اآلخرين في عام ‪.1801‬‬
‫وفي وقت لحق ‪ ،‬قدمت ‪ Apple‬كمبيوتر ‪ Lisa‬مع واجهة المستخدم الرسومية في ‪ 18‬يناير ‪.1800‬‬
‫‪ 3.1‬تتضمن ميزات واجهات المستخدم الرسومية ما يلي‪:‬‬
‫‪ ‬أسهل بكثير في الستخدام للمبتدئين‪.‬‬
‫‪ ‬تمكنك من تبادل المعلومات بسهولة بين البرامج باستخدام القص واللصق أو "السحب واإلفالت"‪.‬‬
‫‪ ‬يستخدم الكثير من الذاكرة وقوة المعالجة‪ .‬يمكن أن يكون استخدامه أبطأ من واجهة كتابة األوامر‬
‫إذا كان المستخد ًم خبيرًا‪.‬‬
‫‪ ‬يمكن أن تكون مزعجة للمستخدمين ذوي الخبرة عندما تتطلب المهام البسيطة عددًا من العمليات‪.‬‬
‫‪ ‬عند مناقشة واجهات المستخدم ‪ ،‬من المهم مالحظة أن ‪ Windows XP‬و ‪Windows Vista‬‬
‫و ‪ Apple OSX‬و ‪ Ubuntu‬جميعها تحتوي على واجهات مستخدم رسومية‪.‬‬

‫‪8‬‬
‫‪ 3.2‬واجهات مستخدم الجيدة‬
‫يجب على واجهة المستخدم الجيدة أن‪:‬‬
‫‪ ‬تكون جذابة ومرضية للعين‬
‫‪ ‬تسمح للمستخدم بتجربة خيارات مختلفة بسهولة‬
‫‪ ‬يكون سهل الستخدام‬
‫‪ ‬استخدام األلوان المناسبة للمناطق الرئيسية‬
‫‪ ‬استخدم كلمات يسهل فهمها وتهدف إلى نوع المستخدم‬
‫‪ ‬تمتلك وثائق مساعدة‬
‫يجب أن تأخذ في العتبار أيضًا احتياجات المستخدمين‪ .‬على سبيل المثال ‪ ،‬من المرجح أن يفضل األطفال‬
‫الصغار الصور على الكلمات وقد يستفيد األشخاص ذوو اإلعاقة من أجهزة إدخال أو إخراج معينة‪.‬‬

‫‪9‬‬

You might also like