limit fstBC to 30bp in Python3 ver.
[GalaxyCodeBases.git] / tools / Bilibili / danmaku2ass_native / AssClass.hpp
blob69237022fa1258673f908d7e59db18a9ee408faf
1 //
2 // AssClass.h
3 // danmaku2ass_native
4 //
5 // Created by TYPCN on 2015/4/8.
6 //
7 //
9 #ifndef __danmaku2ass_native__AssClass__
10 #define __danmaku2ass_native__AssClass__
12 #include <stdio.h>
13 #include <fstream>
14 #include <vector>
15 #include <map>
17 class Ass{
18 private:
19 std::ofstream out;
20 std::map <float, std::pair<int, std::string>> comment_map;
21 int round_int( double r );
22 char style_name[10];
24 inline std::string TS2t(double timestamp);
25 inline void stripStr(std::string in);
26 inline size_t Utf8StringSize(const std::string& str);
28 int duration_marquee;
29 int duration_still;
31 int VideoWidth;
32 int VideoHeight;
34 int FontSize;
36 public:
37 void init(const char *filename);
38 void SetDuration(int dm,int ds);
39 void WriteHead(int width,int height,const char *font,float fontsize,float alpha);
40 void AppendComment(float appear_time,int comment_mode,int font_color,const char *content);
41 void WriteToDisk(std::vector<int> disallowModes);
44 #endif /* defined(__danmaku2ass_native__AssClass__) */