Computer graphics/2013-2014/Laboratory 1

AGENDA SUMMARY
Please consult Computer graphics -- 2013-2014 -- info.uvt.ro/Laboratory agenda.

EVALUATION SUMMARY
Please consult Computer graphics -- 2013-2014 -- info.uvt.ro.

TOOLS, FRAMEWORKS, LIBRARIES
Please consult Computer graphics -- 2013-2014 -- info.uvt.ro/Laboratory tools.

Computer graphics
Computer graphics definitions :


 * Is a sub-field of computer science which studies methods for digitally synthesizing and manipulating visual content. Although the term often refers to the study of three-dimensional computer graphics, it also encompasses two-dimensional graphics and image processing Computer graphics
 * Is the pictorial representation and manipulation of data by a computer
 * Is the set of technologies used to create art with computers. Art or designs created using such technologies

It studies :


 * the manipulation of visual and geometric information using computational techniques.
 * algorithms to reproduce physically photo-realistic images

The following can be seen as sub-parts of it:


 * Geometry -- studies methods to represent and process surfaces
 * Animation -- studies methods to represent and manipulate motion
 * Rendering -- represents images staring from models by using computer programs
 * Imaging -- studies image acquisition and editing.

Links:
 * Constructive solid geometry
 * Subdivision surface
 * Polygon mesh
 * Animation
 * Rendering (computer graphics)
 * Digital imaging
 * Image processing

2D / 3D graphics

 * 2D graphics : implies computer-based generation of digital images (or image sequences -- animation), from (mostly 2-dimensional) models (like geometric shapes, text, other digital images), and manipulation techniques (rotation, translation, scaling, transparency, blending etc.).


 * 3D graphics : (just like 2D graphics) implies computer-based generation of digital images (or image sequences), from 3-dimensional geometric shapes.

Both 2D and 3D graphics are an umbrella for methods / algorithms from all subfields (like geometry, rendering and imaging).

It generally implies the following steps:
 * Modeling;
 * Defining/determining the scene layout;
 * Rendering the scene (includes objects);

As a comparison of the two, the output is the same -- a 2-dimensional image (or sequence) --, but the inputs are different -- 2D shapes / 3D shapes.

Links:
 * 2D computer graphics
 * 3D computer graphics
 * 3D modeling
 * 3D rendering

Digital images

 * A Digital image : is the representation of an image as a 2 dimensional matrix of values -- pixels -- which encode the color of the corresponding image point.

Links:
 * Raster graphics
 * Pixel

Image Resolution
The image resolution represents the quantity of information stored in a digital image. This usually refers to the number of pixels that compose the image;

Links:
 * Image resolution
 * Pixels per inch -- PPI -- very seldom used, but usually for to display devices;
 * Dots per inch -- DPI -- very frequently used, but mainly for plotting / printing devices;

Color depth

 * Bits per pixel : the number of bits allocated / used to encode the color for each pixel.

Tipical cases:
 * 1-bit color = 2^1 = 2 colors: black and white image;
 * 2-bit = 2^2 = 4 colors:
 * Grayscale;
 * Color Graphics Adapter -- CGA;
 * 4-bit = 2^4 = 16 colors:
 * Enhanced Graphics Adapter -- EGA;
 * VGA;
 * 8-bit color = 2^8 = 256 colors:
 * VGA;
 * Super Video Graphics Array -- SVGA;
 * 15-bit = 2^15 = 32768 colors:
 * 5 bits for each RGB channel;
 * Highcolor;
 * 16-bits = 2^16 = 65536 colors:
 * just like in the 15-bit case, but for the green channel we have 6 bits;
 * Truecolor;
 * 24-bits = 2^24 = 16777216 colors:
 * 8 bits for each RGB channel;

Links:
 * Color depth

Color spaces

 * Color space : a mathematical method to represent (encode) a color, usually like a tuple of numbers (integers or reals).

Links:
 * Color space
 * RGB color model -- Red Green Blue
 * SRGB color space
 * CMYK color model -- Cyan Magenta Yellow Black
 * HSV color space -- Hue Saturation Value
 * HSL color space -- Hue Saturation Luminance
 * CIE 1931 color space

File formats
Images are usually stored on disk using various formats such as BMP, PNG, TGA, JPEG, etc. Each of the formats has its own (compressed/uncompressed) way of representing the pixel data found in the image but in most of the cases it reduces itself to coding pixel data (number, color depth, color space) and other file/image related information.

Links:
 * Image file formats
 * Portable Network Graphics -- PNG
 * BMP file format -- BMP
 * Truevision TGA
 * JPEG
 * Image_file_formats

Graphics Processing Unit (GPU)
A dedicated rendering device either integrated within the motherboard or attached to a video card. Its purpose is to handle graphics specific operations. It incorporates several graphics primitive operations (2D/3D) which makes rendering much faster than when rendering directly on screen by using the CPU.

Links:
 * Graphics processing unit

OpenGL
OpenGL stands for Open Graphics Library;
 * it was developed by Silicon Graphics in 1992;
 * its present version is 3.0 and was released in August 11th 2008
 * is a specification for cross-platform API (Application Programmable Interface);
 * it describes a set of functions, their inputs and outputs, and the resulting behaviors;
 * it is used for 2D or 3D graphics;

Among its purposes we can note:
 * hide hardware interfacing details;
 * provide an unified programmable interface;
 * it provides a procedural paradigm scene description, meaning that the programmer has to describe all the steps that are required to render a scene -- thus being a low-level library;
 * hardware manufactures design hardware to meet the feature requirements, meanwhile software implementors develop libraries that meet the standard functionality;
 * it focuses only on rendering, and not on windowing, keyboard / mouse input, or network related issues;
 * as a result a number of utility libraries have been built on top of it:
 * GLU (OpenGL Utility Library ) : provides higher-level drawing routines than OpenGL
 * GLUT (OpenGL Utility Toolkit) : utilities which primarily perform system-level I/O with the host computer (window definition, window control, monitoring of keyboard and mouse input, limited support for creating pop-up menus, etc.)
 * GLUI (OpenGL User Interface Library) : based on GLUT it provides controls such as buttons, check-boxes, radio buttons, and spinners to OpenGL applications. It is platform independent
 * SDL (Simple DirectMedia Layer) : presents a simple interface to various platforms' graphics, sound, and input devices. It is platform independent
 * etc.

Links:
 * OpenGL
 * OpenGL Utility Library
 * OpenGL Utility Toolkit
 * Simple DirectMedia Layer
 * Application programming interface

DirectX
DirectX:
 * was created by Microsoft and first released in 1995
 * its present version is 11 and was released on February 4th 2009 (added multi-threading support, GPGPU support and tessellation support)
 * it runs only on Microsoft platforms (Windows and Xbox)
 * is a collection of different APIs, each focusing on a specific task
 * is used mainly in game development, but also for CAD (Computer Aided Design)
 * is not a standard specification, but a closed-source software
 * is composed of:
 * RT -- runtime -- needed to run an application using DirectX (usually it is bundled with application installation kits, but also ships with the operating system)
 * SDK -- software development kit -- needed to develop an application using DirectX
 * like OpenGL the developer describes the scene for each step -- immediate mode
 * initially it included an implementation of the scene graph paradigm -- retained mode;
 * its sub-APIs are:
 * DirectDraw -- used for 2D graphics;
 * Direct3D -- used for 3D graphics;
 * XInput (former DirectInput in versions < 10)-- used for keyboard and mouse input;
 * DirectPlay -- used for network / multi-play related tasks (in version 10 the dplay.dll was removed and replace by dplayx.dll);
 * XACT (former DirectSound in versions < 10) and DirectMusic -- used to play or record sounds;
 * DirectShow -- removed as of 2005 but backwards compatibility still present

Links:
 * DirectX
 * DirectDraw
 * Direct3D
 * DirectInput
 * DirectPlay
 * DirectSound
 * DirectMusic
 * DirectShow
 * Software framework
 * Software development kit
 * Runtime

Java 2D / Java 3D
Java 2D / Java 3D:
 * Java 2D is an API for drawing 2D shapes
 * Java 3D is an API for drawing 3D objects
 * Java 3D runs on top of either OpenGL or DirectX
 * is more than a wrapper by using a real OOP concepts
 * Java 3D uses scene graph paradigm, but has also immediate mode

Links:
 * Java 2D
 * Java 3D
 * Scene graph

JOGL -- Java OpenGL

 * its latest version is 1.1.1 and was released in May 22nd 2008
 * is a wrapper for OpenGL, mirroring all the GL functions, thus retaining the same API feeling
 * as OpenGL it does not include window related calls and there is no utility library for these tasks. Thus it relies an Java specific libraries (AWT, SWING) to create GUI based applications
 * delegates calls to OpenGL using JNI (Java Native Call)
 * since version 1.1.0 it provides full access to GL 2.0 features
 * conversion between OpenGL code written in C, and OpenGL code written in Java is extremely easy, due to the direct mapping (naming) of GL functions
 * since Java SE 6, Java 2D and Java OpenGL have become inter-operable -- allowing developers to mix code

Links:
 * JOGL
 * Java OpenGL
 * Java Native Interface

XNA

 * was created by Microsoft and first released in 2004
 * its latest version is 3.0 released in October 30th 2008
 * it is based on .Net Framework;
 * is comprised of a set of tools with a managed runtime environment which facilitate computer game
 * it tries to remove the boilerplate code;
 * it tries to allow developers to focus on game content and experience;
 * it is usable from any .NET language (like C#);

Links:
 * Microsoft XNA
 * Boilerplate (text)

X3D (former VRML)

 * first appeared in 1994 as VRML (Virtual Reality Modeling Language). VRML97 dating back from 1997 is the last version of it. It is a standard file format for representing 3-dimensional interactive vector graphics designed for use on the Internet (WWW)
 * it was re-engineered as X3D whose abstract specifications were approved in 2004. XML and ClassicVRML encodings were approved in 2005
 * the current version of X3D is 3.2
 * it has an XML based syntax

Links:
 * VRML
 * X3D