109 int _anchor_point,
int _relative_pos,
110 int _anchor_vertical,
int _anchor_horizontal,
111 int _row_count,
int _column_count,
112 int _row_lock,
int _column_lock,
113 int _pen_style,
int _window_style)
125 QMutexLocker locker(&
m_lock);
139 if ((!_pen_style && !
GetExists()) || _pen_style)
142 if ((!_window_style && !
GetExists()) || _window_style)
145 Resize(_row_count, _column_count);
160 if (new_rows == 0 || new_columns == 0)
164 QString(
"Invalid arguments to Resize: %1 rows x %2 columns")
165 .arg(new_rows).arg(new_columns));
193 QString(
"Shrinked nr %1 nc %2 rc %3 cc %4 tr %5 tc %6").arg(new_rows)
206 auto *new_text =
new CC708Character[
static_cast<size_t>(new_rows) * new_columns];
215 for (; j < new_columns; ++j)
218 for (; i < new_rows; ++i)
219 for (
uint j = 0; j < new_columns; ++j)
220 new_text[(i * new_columns) + j].m_attr =
m_pen.
m_attr;
242 for (
uint j = 0; j < new_columns; ++j)
256 QMutexLocker locker(&
m_lock);
271 QMutexLocker locker(&
m_lock);
312 QMutexLocker locker(&
m_lock);
314 std::vector<CC708String*> list;
321 bool createdNonblankStrings =
false;
322 std::array<QChar,k708MaxColumns> chars {};
325 bool inLeadingSpaces =
true;
326 bool inTrailingSpaces =
true;
327 bool createdString =
false;
342 if (inLeadingSpaces && isDisplayable)
345 inLeadingSpaces =
false;
349 inTrailingSpaces =
false;
353 cur->
m_str = QString(&chars[strStart], i - strStart);
355 createdString =
true;
356 createdNonblankStrings =
true;
357 inTrailingSpaces =
true;
366 if (!inTrailingSpaces || !createdString)
368 bool allSpaces = (inLeadingSpaces || inTrailingSpaces);
371 createdNonblankStrings =
true;
372 cur->
m_str = QString(&chars[strStart], length);
382 if (!createdNonblankStrings)
389 while (!strings.empty())
391 delete strings.back();
398 static const std::array<const uint,8> style2justify
404 if ((style < 1) || (style > 7))
431 QString dbg_char = ch;
432 if (ch.toLatin1() < 32)
433 dbg_char = QString(
"0x%1").arg( (
int)ch.toLatin1(), 0,16);
437 LOG(VB_VBI, LOG_DEBUG,
438 QString(
"AddChar(%1) at (c %2, r %3) INVALID win(%4,%5)")
449 if (ch.toLatin1() == 0x0D)
456 QMutexLocker locker(&
m_lock);
461 if (ch.toLatin1() == 0x0E)
476 if (ch.toLatin1() == 0x08)
489 if (ch.toLatin1() == 0x0c)
505 LOG(VB_VBI, LOG_DEBUG, QString(
"AddChar(%1) at (c %2, r %3) -> (%4,%5)")
511 QMutexLocker locker(&
m_lock);
557 LOG(VB_VBI, LOG_DEBUG, QString(
"IncrPen dir%1: (c %2, r %3) -> (%4,%5)")
559 .arg(new_column).arg(new_row));
575 Scroll(new_row, new_column);
600 LOG(VB_VBI, LOG_DEBUG, QString(
"DecrPen dir%1: (c %2, r %3) -> (%4,%5)")
602 .arg(new_column).arg(new_row));
618 Scroll(new_row, new_column);
635 QString(
"SetPenLocation nr %1 nc %2 rc %3 cc %4 tr %5 tc %6").arg(row)
663 static const std::array<const uint8_t,8> kStyle2Font
664 { 0, 0, 1, 2, 3, 4, 3, 4 };
666 if ((style < 1) || (style > 7))
686 : m_attr(win.m_pen.m_attr)
713 static constexpr std::array<const uint8_t,4> kX {0, 96, 255, 255};
714 return {kX[(eia708color>>4)&3], kX[(eia708color>>2)&3], kX[eia708color&3]};
const uint k708AttrEdgeRightDropShadow
const uint k708AttrFontMonospacedSerif
const uint k708AttrFontProportionalSerif
const uint k708JustifyRight
const uint k708AttrEdgeLeftDropShadow
const uint k708EffectWipe
const uint k708AttrSizeStandard
const uint k708AttrColorBlack
const uint k708AttrOpacitySolid
const uint k708BorderShadowRight
const uint k708AttrOffsetSuperscript
const uint k708AttrOpacityTranslucent
const uint k708AttrEdgeNone
const uint k708BorderShadowLeft
const uint k708AttrEdgeUniform
const uint k708DirLeftToRight
const uint k708DirBottomToTop
const uint k708BorderRaised
const uint k708AttrOffsetSubscript
const uint k708AttrSizeSmall
const uint k708JustifyLeft
const uint k708DirTopToBottom
const uint k708DirRightToLeft
const uint k708AttrOpacityFlash
const uint k708AttrFontCursive
const uint k708AttrFontCasual
const uint k708JustifyFull
const uint k708AttrEdgeDepressed
const uint k708AttrOffsetNormal
const uint k708BorderNone
const uint k708AttrOpacityTransparent
const uint k708AttrFontMonospacedSansSerif
const uint k708JustifyCenter
const uint k708AttrFontSmallCaps
const uint k708AttrFontProportionalSansSerif
const uint k708EffectSnap
const uint k708BorderUniform
const uint k708AttrFontDefault
const uint k708AttrColorWhite
const uint k708AttrSizeLarge
const uint k708AttrEdgeRaised
const uint k708BorderDepressed
const uint k708EffectFade
bool operator==(const CC708CharacterAttribute &other) const
static QColor ConvertToQColor(uint eia708color)
CC708CharacterAttribute m_attr
void SetPenStyle(uint style)
CC708CharacterAttribute m_attr
CC708CharacterAttribute m_attr
CC708Character & GetCCChar(void) const
void LimitPenLocation(void)
void Resize(uint new_rows, uint new_columns)
void SetVisible(bool value)
bool GetExists(void) const
void DecrPenLocation(void)
void IncrPenLocation(void)
bool IsPenValid(void) const
void DefineWindow(int priority, bool visible, int anchor_point, int relative_pos, int anchor_vertical, int anchor_horizontal, int row_count, int column_count, int row_lock, int column_lock, int pen_style, int window_style)
std::vector< CC708String * > GetStrings(void) const
void SetWindowStyle(uint style)
static void DisposeStrings(std::vector< CC708String * > &strings)
void SetPenLocation(uint row, uint column)
void Scroll(int row, int col)
void SetExists(bool value)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)