This chapter discusses media formats supported by EGT.

Supported Media Formats

EGT has direct and indirect support for many standard image, video, and audio formats. In most cases, this is done through using third party libraries like libpng, libjpeg, gstreamer, and so on.

Image Formats

The following image formats are directly supported by EGT:

  • PNG
  • JPEG
  • BMP
  • SVG

Working with SVG (Scalable Vector Graphics) Files

Scalable Vector Graphics (SVG) is an XML-based vector image format for two-dimensional graphics with support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium (W3C) since 1999. SVG images and their behaviors are defined in XML text files.

EGT can load SVG files using the third party library librsvg. On top of that, this library provides the ability to load elements by id from SVG files. What this means is a graphic designer can create an SVG file and give each component of the UI a unique element ID. Then, an EGT programmer can individually load these components and assign them to widgets and create logic around these components from a single SVG file. Also, a graphic designer can put elements in the SVG that are a hint where EGT should be used to draw something, like text.

While EGT supports loading SVG files and working with them dynamically, it is also worth noting that there are tools that can convert an SVG file into actual cairo code. This may be useful for several reasons, including reducing dependencies of EGT.

Working with an SVG file in EGT is mostly accomplished with the single SvgImage class. This class allows fine grained access into SVG specific properties, while still allowing easy conversion to a normal raster Image instance.

experimental::Gauge, experimental::GaugeLayer, and experimental::NeedleLayer are several classes useful in EGT for taking advantage of SVG files directly by using complete SVG files or individual objects in those SVG files to construct layered widgets.

Video Formats

The following video stream formats are directly supported by EGT:

Format Processor Support
Uncompressed YUV All
H.264 SAMA5D4

Metadata File Formats

EGT supports several different types of metadata file formats through third-party libraries.

Format Support Library
JSON JsonCpp