Module Output.Cairo_render

Export OSM data to an image using Cairo.

type color_rgb = float * float * float

Components (red, green, blue) of a color, each between 0. and 1..

type color_rgba = color_rgb * float

A color and a transparency (between 0. and 1.).

type file_info =
  1. | Surface of Cairo.Surface.t * supplement_file_info
  2. | Image of Cairo.Image.format
  3. | PDF of string
  4. | PNG of string * Cairo.Image.format
  5. | PS of string
  6. | SVG of string
  7. | XLib
  8. | Win32
  9. | Quartz

The kind of file to which Cairo shall output

and supplement_file_info =
  1. | No_Info
  2. | PNG_name of string
type cairo_error =
  1. | Unsupported_file of file_info
module type T = sig ... end
type 'role style_general = {
  1. style_node : Cairo.context -> Cosmetyc.Common.Tags.t -> float;
    (*

    Return the radius of the drawn point

    *)
  2. style_way : Cairo.context -> Cosmetyc.Common.Tags.t -> color_rgba option;
    (*

    Return a color if it is an area, None otherwise.

    *)
  3. style_relation : Cairo.context -> Cosmetyc.Common.Tags.t -> 'role -> 'role style_general;
    (*

    Given the tags of the relation and the current role, state how to draw the current object.

    *)
}

The style for General. It should be enough to implement most styles. Each function are meant to be functions with side effects: they shall call Cairo.set_* functions, and return some information dependent of the kind of object being treated.

Generic output, taking a function setting the styles for Cairo.

module Default (Repr : Cosmetyc.Signatures.Representation) : T with module Repr = Repr with type style = unit

This module is an instantiation of General with some basic choices for styles. This is mainly for testing purposes.