Tidy deps and pin asdcplib.
[libsub.git] / doc / mainpage.txt
1 /*!
2
3 @mainpage libsub
4
5 libsub is a library to read and write subtitles in a variety of
6 formats.  It can be used to read subtitles for processing, to write
7 them or to convert between formats.
8
9 The current version has reasonable support for the following subtitle
10 formats:
11
12 - Digital Cinema Package (DCP) XML
13 - SubRip (.srt)
14 - SubStation Alpha and Advanced SubStation Alpha (SSA/ASS)
15 - EBU-STL text and binary
16
17 The general `philosophy' of libsub is that it should not guess any
18 subtitle details that are not explicitly stated in the file unless it
19 is absolutely neessary.  For example, if a file does not specify a
20 font size it will be returned as unknown for the caller to fill in.
21
22 Reading subtitles
23 --
24
25 The basic process is:
26
27     shared_ptr<sub::Reader> reader = reader_factory (filename);
28     list<sub::Subtitle> subs = collect<list<sub::Subtitle> > (reader->subtitles ());
29
30 We first have:
31
32     shared_ptr<sub::Reader> reader = reader_factory (filename);
33
34 This looks at the extension of `filename' and, if necessary, its header, and guesses
35 what format it is in.  Based on the format it creates an appropriate Reader object.
36 This reader object can then return its subtitles using
37
38     reader->subtitles ();
39
40 This method returns a set of RawSubtitle objects which are then formed into Subtitle,
41 Line and Block objects by collect().
42
43 */