Related Contents:

  1. OpenGL– An introduction to the graphics API
  2. OpenGL– Related terms explained
  3. OpenGL– Environment configuration
  4. OpenGL- Case 1- Draw a triangle
  5. OpenGL– Case 2 — Draw a square
  6. OpenGL– Image rip
  7. OpenGL–3D mathematics related (Vectors and Matrices)
  8. OpenGL– Matrix transformations and matrix stacks

Introduction to graphics and images

concept

Graphics (Graphic) :

Graph (also called vector graph) refers to a two-dimensional space can be divided into a number of spatial shapes by contour, is a vector graph composed of external contour lines. It is the straight line, circle, rectangle and other geometric figures drawn by the computer.

The graph file will only record the algorithm that generates the graph and some points on the graph. When the computer restores, the adjacent points are connected with a specific number of small straight lines to form a curve. If the curve forms a closed graph, the color algorithm can also be used to fill the color. It has all the characteristics of vector graph, mainly used to express line drawing, engineering drawings, calligraphy and so on.

The vector diagram

A drawing based on geometric properties, either a point or a line. It is characterized by small space occupation, and will not lead to image distortion after magnification. (PS: For vector images, you can go to the Internet to check again)

Image (Image) :

An image (also known as a bitmap) is made up of a number of pixels arranged in a large amount of data. It is a representation of an objective object and contains information about the object being described.

The image can be divided into analog image and digital image according to the different recording methods. Analog image refers to the change of some physical quantity (such as light, electricity, etc.) to record the image brightness information (such as analog TV image). Digital image is to use the data stored in the computer to record the brightness information of each point on the image.

Storage format

Graphic storage

Graphics only save relevant algorithms and control points, so the storage space of graphics files is generally small, but in the screen display, due to the scanning conversion process, the display speed is slower than that of images, but the output quality is better. The common storage formats are as follows:

1. PNG format

PNG is a bitmap format that uses lossless compression algorithms. Its purpose is to replace GIF and TIFF formats by view, while adding some features that GIF formats do not have

2. The CDR format

A graphic file storage format dedicated to CorelDraw software

3. The AI format

A graphic file storage format for Illustrator software

4. DXF format

Is the graphics file format of AutoCAD software, the format stores graphics in ASCII mode, can be called and edited by CorelDraw, 3Dmax and other software

5. EPS format

This format is a universal format that can be used for encoding vector graphics, pixel images and text, that is, to record graphics, images and text in a file at the same time

Image storage

Graphic file storage format and processing software at present is the most popular Adobe Photoshop software, commonly used storage formats have the following:

1. The BMP format

Is a standard image file format in Windows, it describes bitmaps in a device-independent way, and all kinds of commonly used graphics and image software can edit and process the image files in this format

2. TIFF format

Commonly used bitmap image format, TIFF bitmap can have any size of size and resolution, for printing, print output images recommended to store in this format

3. The JPEG format

An efficient compression format that can greatly compress images, save network resources to the greatest extent and improve transmission speed. Therefore, images used for network transmission are generally stored in this format

4. GIF format

The format can be used in all kinds of image processing software, is a compressed file format, so it generally takes up less space, suitable for network transmission, generally used for storing animation effect pictures

5. PSD

A standard image file format used in Photoshop that preserves layer information, channel mask information, etc., for subsequent modification and special effects.

6. In PDF format

Also known as portable (or portable) file format, it has cross-platform features and includes effective control information for professional plate making and printing production. It can be used as a common file format in the prepress field

Introduction to the Graphics API

Now that you know about graphics and images, let’s take a look at the Application Programming Interfaces (apis) available today:

OpenGL

OpenGL (Open Graphics Library) is a cross-programming language, cross-platform professional Graphics programming interface. It is used for THREE-DIMENSIONAL images (two-dimensional can also), is a powerful, easy to call the underlying graphics library. (What you will learn next)

Supported platforms include Windows, UNIX-like, Linux, and MacOS.

OpenGL ES

OpenGL ES (OpenGL for Embedded Systems) is a subset of OpenGL 3D Graphics API. Designed for embedded devices such as mobile phones, PDAs (Presonal Digital Assistant PDAs) and game consoles, OpenGL removes many unnecessary and low performance APIS.

DirectX

DirectX (Direct eXtesion, DX for short) is a multimedia programming interface created by Microsoft. It is not a simple graphical API, but a widely used API developed by Microsoft. It consists of many apis, classified by nature, can be divided into four parts, display part, sound part, input part and network part.

Metal

At WWDC 2014, Apple introduced Metal, a new platform technology for game developers that can provide 3D graphics with 10 times more rendering performance and support for familiar game engines and companies.

Metal is a new technology for developers of highly immersive console games, allowing them to fully exploit the capabilities of the A7 and A8 chips. The technology is optimized so that the processor and graphics processor can work together for optimal performance. It is designed for multithreading and provides excellent tools to integrate everything into Xcode.

The role of the graphics API

1. Rendering of buttons, pictures, views, etc

2. Character/scene rendering in game development

3. Data rendering after audio and video decoding

4. Special effects processing of rotation, scaling and movement in animation operation

5. Off-screen rendering (added later)

conclusion

This content mainly introduces some concepts related to graphics and images, as well as several current mainstream graphics API, the content may not be comprehensive, interested students can go to search for understanding. That’s all. Thank you

Harmonious learning, not impatient ~