diff --git a/mythtv/libs/libmythui/mythuiimage.cpp b/mythtv/libs/libmythui/mythuiimage.cpp
index 02ce02e..6101bd7 100644
a
|
b
|
void ImageProperties::Copy(const ImageProperties &other) |
93 | 93 | preserveAspect = other.preserveAspect; |
94 | 94 | isGreyscale = other.isGreyscale; |
95 | 95 | isReflected = other.isReflected; |
96 | | isMasked = other.isMasked; |
97 | 96 | isOriented = other.isOriented; |
98 | 97 | |
99 | 98 | reflectAxis = other.reflectAxis; |
… |
… |
void ImageProperties::Copy(const ImageProperties &other) |
106 | 105 | isThemeImage = other.isThemeImage; |
107 | 106 | |
108 | 107 | SetMaskImage(other.maskImage); |
| 108 | isMasked = other.isMasked; |
| 109 | maskImageFilename = other.maskImageFilename; |
109 | 110 | } |
110 | 111 | |
111 | 112 | void ImageProperties::SetMaskImage(MythImage *image) |
… |
… |
class ImageLoader |
357 | 358 | |
358 | 359 | if (imProps.isMasked) |
359 | 360 | { |
| 361 | MythImage *newMaskImage = painter->GetFormatImage(); |
| 362 | if (newMaskImage->Load(imProps.GetMaskImageFilename())) |
| 363 | { |
| 364 | float wmult; // Width multipler |
| 365 | float hmult; // Height multipler |
| 366 | GetMythUI()->GetScreenSettings(wmult, hmult); |
| 367 | if (wmult != 1.0f || hmult != 1.0f) |
| 368 | { |
| 369 | int width = newMaskImage->size().width() * wmult; |
| 370 | int height = newMaskImage->size().height() * hmult; |
| 371 | newMaskImage->Resize(QSize(width, height)); |
| 372 | } |
| 373 | |
| 374 | imProps.SetMaskImage(newMaskImage); |
| 375 | } |
| 376 | else |
| 377 | imProps.SetMaskImage(NULL); |
| 378 | newMaskImage->DecrRef(); |
| 379 | |
360 | 380 | QRect imageArea = image->rect(); |
361 | 381 | QRect maskArea = imProps.GetMaskImageRect(); |
362 | 382 | |
363 | 383 | // Crop the mask to the image |
364 | 384 | int x = 0; |
365 | | int y = 0; |
| 385 | int y = 0; |
366 | 386 | |
367 | 387 | if (maskArea.width() > imageArea.width()) |
368 | 388 | x = (maskArea.width() - imageArea.width()) / 2; |
… |
… |
bool MythUIImage::ParseElement( |
1439 | 1459 | } |
1440 | 1460 | else if (element.tagName() == "mask") |
1441 | 1461 | { |
1442 | | QString maskfile = getFirstText(element); |
1443 | | |
1444 | | MythImage *newMaskImage = GetPainter()->GetFormatImage(); |
1445 | | if (newMaskImage->Load(maskfile)) |
1446 | | { |
1447 | | float wmult; // Width multipler |
1448 | | float hmult; // Height multipler |
1449 | | GetMythUI()->GetScreenSettings(wmult, hmult); |
1450 | | if (wmult != 1.0f || hmult != 1.0f) |
1451 | | { |
1452 | | int width = newMaskImage->size().width() * wmult; |
1453 | | int height = newMaskImage->size().height() * hmult; |
1454 | | newMaskImage->Resize(QSize(width, height)); |
1455 | | } |
1456 | | |
1457 | | m_imageProperties.SetMaskImage(newMaskImage); |
1458 | | } |
1459 | | else |
1460 | | m_imageProperties.SetMaskImage(NULL); |
1461 | | newMaskImage->DecrRef(); |
| 1462 | m_imageProperties.SetMaskImageFilename(getFirstText(element)); |
| 1463 | m_imageProperties.isMasked = true; |
1462 | 1464 | } |
1463 | 1465 | else if (element.tagName() == "grayscale" || |
1464 | 1466 | element.tagName() == "greyscale") |
diff --git a/mythtv/libs/libmythui/mythuiimage.h b/mythtv/libs/libmythui/mythuiimage.h
index 7847c4a..f7c160d 100644
a
|
b
|
class ImageProperties |
30 | 30 | ImageProperties &operator=(const ImageProperties &other); |
31 | 31 | |
32 | 32 | void SetMaskImage(MythImage *image); |
| 33 | void SetMaskImageFilename(const QString filename) |
| 34 | { |
| 35 | maskImageFilename=filename; |
| 36 | } |
| 37 | QString GetMaskImageFilename() |
| 38 | { |
| 39 | return maskImageFilename; |
| 40 | } |
33 | 41 | QRect GetMaskImageRect(void) |
34 | 42 | { |
35 | 43 | QRect rect; |
… |
… |
class ImageProperties |
73 | 81 | void Copy(const ImageProperties &other); |
74 | 82 | |
75 | 83 | MythImage *maskImage; |
| 84 | QString maskImageFilename; |
76 | 85 | }; |
77 | 86 | |
78 | 87 | typedef QPair<MythImage *, int> AnimationFrame; |