1 /* 2 * Copyright 2010, Stephan Aßmus <superstippi@gmx.de>. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef SUBTITLE_BITMAP_H 6 #define SUBTITLE_BITMAP_H 7 8 9 #include <Rect.h> 10 #include <String.h> 11 12 13 class BBitmap; 14 class BTextView; 15 16 17 class SubtitleBitmap { 18 public: 19 SubtitleBitmap(); 20 virtual ~SubtitleBitmap(); 21 22 bool SetText(const char* text); 23 void SetVideoBounds(BRect bounds); 24 void SetOverlayMode(bool overlayMode); 25 void SetCharsPerLine(float charsPerLine); 26 27 const BBitmap* Bitmap() const; 28 29 private: 30 void _GenerateBitmap(); 31 void _InsertText(BRect& bounds, 32 float& outlineRadius, bool overlayMode); 33 34 private: 35 BBitmap* fBitmap; 36 BTextView* fTextView; 37 BTextView* fShadowTextView; 38 BString fText; 39 40 BRect fVideoBounds; 41 float fCharsPerLine; 42 bool fUseSoftShadow; 43 bool fOverlayMode; 44 }; 45 46 47 #endif // SUBTITLE_BITMAP_H 48