SVG support in CEGUI
The purpose of this document is to determine how the SVG loading/handling and storage of related datastructures should be done.
Specific questions that need to be decided upon are (in the brackets the current state of decision will be noted, if existing): Module-integration:
- SVGImage and related files will be a part of CEGUI Core-library (yes)
- Vector graphics rendering related files will be part of CEGUI Core-library (yes)
- The SVG File loading and parsing will be part of CEGUI Core-library (undecided)
Structure:
- SVGImage will be a subclass of CEGUI::Image (yes)
- SVGImage contains the cached information required for rendering (yes)
- A class named VGShapeData or VectorShapeData or something like that, will contain the abstract information on the shapes that are supposed to be cached and drawn (undecided)
- SVGImage will contain a reference to an shape-data class, whereas the class that contains (undecided)
Notes: Probably SVGImage should rather be called VGImage or VectorImage or VectorGraphicsImage. This is because I think it could be easily done that the class would not require actual SVG data but instead only require shape information for drawing. The SVG data can be converted into such shape information. That way users can create their own shape information and use it in a VGImage.
Possible use-cases for SVG Images
As justification for the above suggestions following use-cases can be considered:
- A user wants to load an SVG-file and then use the resulting SVGImage like a regular raster graphics image (BasicImage)