---
name: "ggi_mode"
section: "3"
platform: "linux"
package: "libggi2-dev"
version: "1:2.2.2-5"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/ggi_mode"
---

# ggi\_mode(3)

LibGGI mode description

## NAME

**ggi\_mode**, **ggi\_coord**, **ggi\_graphtype** - LibGGI mode description

## SYNOPSIS

```
#include <ggi/ggi.h>
typedef struct { int16_t x, y; } ggi_coord;
typedef uint32_t ggi_graphtype;
typedef struct {
      int32_t          frames;
      ggi_coord       visible;
      ggi_coord       virt;
      ggi_coord       size;
      ggi_graphtype   graphtype;
      ggi_coord       dpp;
} ggi_mode;
```

## DESCRIPTION

The mode structure describes a visual configuration given by its size and other graphic properties.

## STRUCTURE MEMBERS

- **frames**

  The number of frames. Some displays have multi-buffer capabilities (double-buffering, triple-buffering,...). See libggi frame-related functions (ggi{s,g}et{Read,Write,Display}Frame) for information on working with multiple frames.

- **visible**

  The size of the visible area in pixels. This is what the user will see.

- **virt**

  The virtual size of the visual in pixels. It can be larger (but not smaller) than the visible area, in which case only a part of it is displayed.  It is useful for scrolling or backing up portions of screen efficiently.  See **ggi\[Set\|Get\]Origin** functions for more.

- **size**

  The size of the visible area in mm.

- **graphtype**

  It holds information on the type of display.  libggi defines macros to construct graphtypes values or access individual field.

  - **depth** ( access via **GT\_DEPTH(gt)**, **GT\_SETDEPTH(gt,x)** )

    The number of significant bits holding color information.

  - **size** ( access via **GT\_SIZE(gt)**, **GT\_SETSIZE(gt,x)** )

    The actual size (in bits) of a pixel.  For instance, on a 32 bits X server the pixel size is 32 but the depth is only 24 (8bits RGB channels, 8 unused).

  - **scheme** ( access via **GT\_SCHEME(gt)**, **GT\_SETSCHEME(gt,x)** )

    The following schemes are available :

    - •

      **GT\_TEXT** : text mode only

    - •

      **GT\_TRUECOLOR** : true color mode

    - •

      **GT\_GREYSCALE** : pixels represent level of gray

    - •

      **GT\_PALETTE** : pixels are entries in a CLUT (Color Look-Up Table)

    - •

      **GT\_STATIC\_PALETTE**

    - •

      **GT\_SUBSAMPLE\_YUV**

    - •

      **GT\_SUBSAMPLE\_U\_YCRBR**

    - •

      **GT\_SUBSAMPLE\_S\_YCRBR**

    - •

      **GT\_NIL**

  - **subscheme** ( access via **GT\_SUBSCHEME(gt)**, **GT\_SETSUBSCHEME(gt,x)** )

    One of:

    - •

      **GT\_SUB\_REVERSE\_ENDIAN**

    - •

      **GT\_SUB\_HIGHBIT\_RIGHT**

    - •

      **GT\_SUB\_PACKED\_GETPUT**

  Graphtypes can be constructed directly or via the **GT\_CONSTRUCT(depth,scheme,size)** macro.  The following common graphtypes are defined :

  - •

    **GT\_TEXT16**

  - •

    **GT\_TEXT32**

  - •

    **GT\_1BIT**

  - •

    **GT\_2BIT**

  - •

    **GT\_4BIT**

  - •

    **GT\_8BIT**

  - •

    **GT\_15BIT**

  - •

    **GT\_16BIT**

  - •

    **GT\_24BIT**

  - •

    **GT\_32BIT**

  - •

    **GT\_AUTO**

  - •

    **GT\_INVALID**

- **dpp**

  It stands for dot-per-pixel.

When filling a mode structure for setting a visual, any field can be assigned **GGI\_AUTO** (**GT\_AUTO** for graphtype) if a specific value isn't required.

## SEE ALSO

`ggiCheckMode(3)`, `ggiSetMode(3)`
