Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Graphics primitives and display devices

Overview of graphics primitives (points, lines, polygons, curves) and display devices (raster-scan, random-scan, LCD/OLED), with definitions, key formulas (frame-buffer size, pixel clock, PPI), worked numerical examples, common exam mistakes and quick self-test.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Computer graphics primitives and display devices are the foundation for all rendering and visualization. An engineer uses them when designing graphics pipelines, calculating memory and bandwidth for displays, and when implementing scan-conversion or interacting with hardware (frame buffers, GPUs, or embedded displays).

Key ideas

  • Definition: Resolution — the number of addressable pixels horizontally and vertically on a display, written as width × height (for example, 1920 × 1080). Exactness: resolution is a count (dimensionless).
  • Definition: Color depth (also: bit depth) — the number of bits used to represent color per pixel, typically given as bits per pixel (bpp). Example: 24 bpp means 8 bits per color channel for RGB.
  • Definition: Scan conversion (also: rasterization) — the process of converting geometric primitives (points, lines, polygons, curves) into pixels. Assumption: input primitives are defined in continuous coordinates; output must map to discrete pixel grid. Typical exam algorithms: DDA and Bresenham line drawing (handle different slope regions), Midpoint circle/ellipse algorithms using symmetry, polygon scanline fill, and clipping (Cohen–Sutherland, Liang–Barsky). Be able to derive Bresenham’s recurrence and the midpoint decision parameter.
  • Definition: Refresh rate — the number of complete frames drawn per second, in hertz (Hz). Unit: Hz = s−1. The human visual system perceives motion from a sequence of frames; persistence of vision and flicker depend on refresh rate.
  • Definition: Pixel clock — the rate (in Hz) at which pixels are sent to the display during active video plus blanking; it equals total pixels per frame times frames per second. Use when computing bandwidth.
  • Definition: Subpixel — a physical device-level element (for example, the R, G, B strips inside a pixel on many LCDs). Subpixel addressing yields higher apparent resolution when exploited correctly.

Display device types and key facts (simple, exam-style definitions):

  • Raster-scan (CRT / typical LCD driving model) — the display is refreshed line-by-line. The video signal contains active video and blanking intervals (front porch, sync, back porch). Assumption: timing is periodic; required to compute pixel clock and sync pulses.
  • Random-scan (vector) display — primitives are drawn by directly steering the electron beam (historical, used in oscilloscopes). Not pixel-addressed; rather it draws vectors. Assumption: limited to line primitives, heavy on hardware.
  • LCD / LED / OLED — modern flat-panel devices. They also use frame buffers and are typically driven in raster order by display controllers. Differences (brief): LCDs use backlight + liquid crystals, OLEDs emit light per pixel (better contrast), LED often means LED backlight or micro-LED panels.

Important exact relations and derivations universities ask for:

  1. Frame-buffer size derivation: If the display resolution is W × H pixels and color depth is D bits/pixel, the memory M (in bytes) required is M = (W × H × D) / 8 Assumptions: no padding, no additional buffers. If multiple buffers (double/triple buffering) multiply accordingly. Diagram to draw when proving: draw a rectangular grid W columns by H rows; show one pixel and annotate D bits per pixel. Then multiply counts.

  2. Pixel clock derivation: Let Hact = active horizontal pixels (visible), Hblank = horizontal blanking pixels (front porch + sync + back porch), so Htotal = Hact + Hblank. Similarly Vact and Vblank give Vtotal. Then total pixels per frame = Htotal × Vtotal. For frame rate f (Hz), pixel clock C (Hz) is: C = Htotal × Vtotal × f Draw: timing diagram — for a single horizontal line draw a horizontal bar segmented into active video, front porch, HSYNC, back porch; label durations in pixel clocks. Stack these lines to show vertical timing.

  3. Pixel density (PPI) derivation: If a display has horizontal pixels Px and vertical pixels Py and diagonal size D_inches (in inches), pixel density PPI is: PPI = sqrt(Px^2 + Py^2) / D_inches Assumptions: diagonal given in inches, pixels are square (common). To find physical pixel pitch p (mm): p = (D_inches / sqrt(Px^2+Py^2)) × 25.4 mm/inch.

  4. Color to luminance (linear RGB): the linear luminance Y (perceptual brightness) is a weighted sum of linear RGB components. Exact standard coefficients for sRGB linear-to-luminance are: Y = 0.2126 R + 0.7152 G + 0.0722 B Assumption: R, G, B are linear (gamma removed). This is used when computing grayscale from color in exams; note sRGB uses gamma, so apply gamma inverse first.

Short note on aliasing (definition): Aliasing — artifacts that occur when a continuous signal is sampled at insufficient rate causing high-frequency details to map incorrectly. Assumption: sampling theorem applies; remedies are anti-aliasing (see other topic).

Formulas

M = (W × H × D) / 8 — M is frame-buffer memory in bytes, W width in pixels, H height in pixels, D bits per pixel, applies to one image buffer.

C = H_total × V_total × f — C is pixel clock in pixels per second (Hz), H_total total horizontal pixels (visible+blanking), V_total total vertical lines, f frame rate in Hz.

PPI = sqrt(Px^2 + Py^2) / D_inch — Px, Py are pixel counts horizontal and vertical, D_inch is diagonal size in inches, result in pixels per inch.

Bandwidth_scanout_read = M × f — memory bandwidth in bytes per second to read one full frame per refresh (scanout). Bandwidth_write ≈ M × f — if the entire frame is updated each frame; total read+write traffic ≈ 2M × f. Multiple buffers affect capacity, not scanout bandwidth.

Y = 0.2126 R + 0.7152 G + 0.0722 B — linear luminance from linear RGB; R,G,B in same units (0..1), Y dimensionless fraction of max luminance.

Note: 1 byte = 8 bits. When converting to MiB use 1 MiB = 1024 × 1024 bytes.

Worked examples

Example 1 — Frame-buffer size (numerical) Given: a 1920 × 1080 display, 24 bpp color (8 bits per channel RGB). Compute the frame-buffer memory for one frame in bytes and in MiB. Steps:

  1. Use formula M = (W × H × D) / 8.
  2. W × H = 1920 × 1080 = 2,073,600 pixels.
  3. D = 24 bits/pixel, so M = (2,073,600 × 24) / 8 = 2,073,600 × 3 = 6,220,800 bytes.
  4. In mebibytes: 6,220,800 / (1024 × 1024) = 6,220,800 / 1,048,576 ≈ 5.9326171875 MiB (≈ 5.9326 MiB). Final answer: 6,220,800 bytes (≈ 5.9326 MiB).

Example 2 — Pixel clock for 1080p@60Hz (standard timing) Given: For 1920×1080@60Hz typical totals are H_total = 2200 pixels per line, V_total = 1125 lines per frame, frame rate f = 60 Hz. Compute pixel clock C. Steps:

  1. Total pixels per frame = H_total × V_total = 2200 × 1125 = 2,475,000 pixels/frame.
  2. Pixel clock C = 2,475,000 × 60 = 148,500,000 pixels/sec = 148.5 MHz. Final answer: C = 148.5 MHz (this is the standard 1080p60 pixel clock).

Example 3 — Pixel density (PPI) Given: a 24-inch diagonal monitor with resolution 1920×1080. Compute PPI. Steps:

  1. Compute pixel diagonal in pixels = sqrt(1920^2 + 1080^2) = sqrt(4,852,800) ≈ 2202.907 pixels.
  2. PPI = 2202.907 / 24 = 91.7878 pixels per inch. Final answer: ≈ 91.79 PPI.

(Each number double-checked: 1920×1080 = 2,073,600; 1920^2 + 1080^2 = 4,852,800; sqrt ≈ 2202.907.)

Common mistakes

  • Confusing active pixels (resolution) with total pixels (including blanking) when computing pixel clock.
  • Using PPI formula with diagonal in mm without converting units (inches vs mm).
  • Applying the luminance weights to gamma-compressed RGB values without linearizing (must undo gamma first for correct luminance).
  • Assuming pixels are square; if pixels are non-square the PPI formula needs physical width/height.

For your exam

Question types you will see: definitions (short), comparisons (raster vs vector), derivations (frame-buffer size, pixel clock), numerical problems (memory, PPI, pixel clocks), timing diagrams (draw and label Hsync/Vsync regions), and short notes (advantages/disadvantages of display types). What a full-marks answer includes:

  • Clear definition of terms with units (pixel, resolution, frame buffer, pixel clock).
  • Correct formula with derivation steps and stated assumptions (for example: whether blanking intervals are included).
  • For numerical questions: show every step, carry units, convert bits→bytes, and state final answer with proper units and appropriate precision.
  • For diagram questions: draw the rectangle/grid or timing bar, label active video, front porch, HSYNC, back porch, and indicate time or pixel counts on each segment.

Quick check

  1. What is the formula for frame-buffer memory M (bytes) for a single RGB image with width W, height H and D bits per pixel?
  2. What is the pixel clock (in Hz) for a frame with H_total = 1650, V_total = 750 and frame rate 75 Hz?
  3. What are the linear luminance weights for R, G and B used to compute Y (sRGB linear)? Answers: 1) M = (W × H × D) / 8. 2) C = 1650 × 750 × 75 = 92,812,500 Hz (≈ 92.8125 MHz). 3) R = 0.2126, G = 0.7152, B = 0.0722.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?