Wednesday, June 1, 2016

GDI.Graphics.Device.Interface.

State
Cited Official  -Wikipedia
https://en.wikipedia.org/wiki/Graphics_Device_Interface


Graphics Device Interface

The Graphics Device Interface (GDI) is a Microsoft Windows application programming interface and core operating system component responsible for representing graphical objects and transmitting them to output devices such as monitors and printers. 
GDI is responsible for tasks such as drawing lines and curves, rendering fonts and handling palettes. It is not directly responsible for drawing windows, menus, etc.; that task is reserved for the user subsystem, which resides in user32.dll and is built atop GDI. Other systems have components that are similar to GDI, for example Mac OS X's Quartz andX Window System's Xlib/XCB. 
GDI's most significant advantages over more direct methods of accessing the hardware are perhaps its scaling capabilities and its abstract representation of target devices. Using GDI, it is very easy to draw on multiple devices, such as a screen and a printer, and expect proper reproduction in each case. This capability is at the center of most What You See Is What You Get applications for Microsoft Windows. 
Simple games that do not require fast graphics rendering may use GDI. However, GDI is relatively hard to use for advanced animation, and lacks a notion for synchronizing with individual video frames in the video card, lacks hardware rasterization for 3D, etc. Modern games usually use DirectX or OpenGL instead, which let programmers exploit the features of modern hardware.


What is a Graphics Device?

  • A graphics device is something where you can make a plot appear
    A window on your computer (screen device)
    A PDF file (file device)
    A PNG or JPEG file (file device)
    A scalable vector graphics (SVG) file (file device)
  • When you make a plot in R, it has to be "sent" to a specific graphics device
  • The most common place for a plot to be "sent" is the screen device
    On a Mac the screen device is launched with the quartz()
    On Windows the screen device is launched with windows()
    On Unix/Linux the screen device is launched with x11()

What is a Graphic Device?

  • When making a plot, you need to consider how the plot will be used to determine what device the plot should be sent to.
    The list of devices is found in ?Devices; there are also devices created by users on CRAN
  • For quick visualizations and exploratory analysis, usually you want to use the screen device
    Functions like plot in base, xyplot in lattice, or qplot in ggplot2 will default to sending a plot to the screen device
    On a given platform (Mac, Windows, Unix/Linux) there is only one screen device
  • For plots that may be printed out or be incorporated into a document (e.g. papers/reports, slide presentations), usually afile device is more appropriate
    There are many different file devices to choose from
  • NOTE: Not all graphics devices are available on all platforms (i.e. you cannot launch the windows() on a Mac)
---------------------------------------------------------------

Graphics Device Interface + (GDI+)

Definition - What does Graphics Device Interface + (GDI+)mean?

Graphics Device Interface + (GDI+) is a graphical subsystem of Windows that consists of an application programming interface (API) to display graphics and formatted text on both video display and printer. 

GDI+ acts as an intermediate layer between applications and device drivers for rendering two-dimensional graphics, images and text.

Techopedia explains Graphics Device Interface + (GDI+)

GDI was the tool by which the what you see is what you get (WYSIWYG) capability was provided in Windows applications. GDI+ is an enhanced C++-based version of GDI. GDI+ helps the developer to write device-independent applications by hiding the details of graphic hardware. It also provides graphic services in a more optimized manner than earlier versions. Due to its object-oriented structure and statelessness, GDI+ provides an easy and flexible interface developers can use to interact with an application's graphical user interface (GUI). Although GDI+ is slightly slower than GDI, its rendering quality is better.

The GDI+ services can be categorized into 2D vector graphics, imaging and typography. Vector graphics include drawing primitives like rectangles, lines and curves. These primitives are drawn using objects of a specific class, which has all the information required. Imaging involves displaying complex images that cannot be displayed using vector graphics and performing image operations such as stretching and skewing. Simple text can be printed in multiple fonts, sizes and colors using typography services of GDI+.

GDI+ has an internal structure that consists of about 40 extensible managed classes, 50 enumerations and six structures. GDI+ uses the concept of graphics context, which is similar to the device context used by GDI. Graphics context is represented by classes and graphics containing details of drawing in a window, but not the information about font, color, etc. By passing the required formatting information to a graphics object's methods for drawing, there is no need to maintain the state, which helps to optimize rendering performance.

The features included in GDI+ are:
  • Gradient brushes used for filling shapes, paths and regions using linear and path gradient pushes
  • Cardinal splines for creating larger curves formed out of individual curves
  • Independent path objects for drawing a path multiple times
  • A matrix object tool for transforming (rotating, translating, etc.) graphics
  • Regions stored in world coordinates format, which allows them to undergo any transformation stored in a transformation matrix
  • Alpha blending to specify the transparency of the fill color
  • Multiple image formats (BMP, IMG, TIFF, etc.) supported by providing classes to load, save and manipulate them
  • Sub-pixel anti-aliasing to render text with a smoother appearance on a liquid crystal display (LCD) screen



------------------------------------------




No comments:

Post a Comment