MythTV
master
|
#include <libmythui/mythimage.h>
Public Member Functions | |
MythImage (MythPainter *parent, const char *name="MythImage") | |
Creates a reference counted image, call DecrRef() to delete. More... | |
MythPainter * | GetParent (void) |
void | SetParent (MythPainter *parent) |
int | IncrRef (void) override |
Increments reference count. More... | |
int | DecrRef (void) override |
Decrements reference count and deletes on 0. More... | |
virtual void | SetChanged (bool change=true) |
bool | IsChanged () const |
bool | IsGradient () const |
bool | IsReflected () const |
bool | IsOriented () const |
void | Assign (const QImage &img) |
void | Assign (const QPixmap &pix) |
bool | Load (MythImageReader *reader) |
bool | Load (const QString &filename) |
void | Orientation (int orientation) |
Changes the orientation angle of the image according to the exif rotation values. More... | |
void | Resize (QSize newSize, bool preserveAspect=false) |
void | Reflect (ReflectAxis axis, int shear, int scale, int length, int spacing=0) |
void | ToGreyscale () |
int64_t | GetSize (void) |
void | SetID (unsigned int id) |
unsigned int | GetID (void) const |
void | SetFileName (QString fname) |
QString | GetFileName (void) const |
void | setIsReflected (bool reflected) |
void | setIsOriented (bool oriented) |
void | SetIsInCache (bool bCached) |
uint | GetCacheSize (void) const |
Public Member Functions inherited from ReferenceCounter | |
ReferenceCounter (const QString &debugName, bool logDebug=true) | |
Creates reference counter with an initial value of 1. More... | |
Static Public Member Functions | |
static QImage | ApplyExifOrientation (QImage &image, int orientation) |
static MythImage * | Gradient (MythPainter *painter, QSize size, const QColor &begin, const QColor &end, uint alpha, FillDirection direction=FillDirection::TopToBottom) |
Create a gradient image. More... | |
Static Public Member Functions inherited from ReferenceCounter | |
static void | PrintDebug (void) |
Print out any leaks if that level of debugging is enabled. More... | |
Protected Member Functions | |
~MythImage () override | |
Protected Member Functions inherited from ReferenceCounter | |
virtual | ~ReferenceCounter (void) |
Called on destruction, will warn if object deleted with references in place. More... | |
Static Protected Member Functions | |
static void | MakeGradient (QImage &image, const QColor &begin, const QColor &end, int alpha, BoundaryWanted drawBoundary=BoundaryWanted::Yes, FillDirection direction=FillDirection::TopToBottom) |
Protected Attributes | |
bool | m_changed {false} |
MythPainter * | m_parent {nullptr} |
bool | m_isGradient {false} |
QColor | m_gradBegin {0x00, 0x00, 0x00} |
QColor | m_gradEnd {0xFF, 0xFF, 0xFF} |
int | m_gradAlpha {255} |
FillDirection | m_gradDirection {FillDirection::TopToBottom} |
bool | m_isOriented {false} |
bool | m_isReflected {false} |
unsigned int | m_imageId {0} |
QString | m_fileName |
bool | m_cached {false} |
Protected Attributes inherited from ReferenceCounter | |
bool | m_logDebug |
This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More... | |
QAtomicInt | m_referenceCount {1} |
Static Protected Attributes | |
static MythUIHelper * | s_ui = nullptr |
Definition at line 36 of file mythimage.h.
|
explicit |
Creates a reference counted image, call DecrRef() to delete.
Definition at line 25 of file mythimage.cpp.
|
overrideprotected |
Definition at line 38 of file mythimage.cpp.
|
static |
Definition at line 97 of file mythimage.cpp.
Referenced by ThumbThread< ImageDbSg >::CreateThumbnail(), and Orientation().
|
inline |
Definition at line 44 of file mythimage.h.
Referenced by MythPainter::CheckFormatImage().
|
inline |
Definition at line 45 of file mythimage.h.
Referenced by MythPainter::CheckFormatImage().
|
overridevirtual |
Increments reference count.
Reimplemented from ReferenceCounter.
Definition at line 44 of file mythimage.cpp.
Referenced by MythUIThemeCache::CacheImage(), MythUIImage::DrawSelf(), MythBrowser::GetDefaultFavIcon(), MythUIButtonListItem::GetImage(), MythPainter::GetImageFromRect(), MythPainter::GetImageFromString(), MythPainter::GetImageFromTextLayout(), ImageLoader::LoadImage(), MythUIButtonListItem::SetImage(), MythUIImage::SetImage(), SetIsInCache(), and ImageProperties::SetMaskImage().
|
overridevirtual |
Decrements reference count and deletes on 0.
Reimplemented from ReferenceCounter.
Definition at line 52 of file mythimage.cpp.
Referenced by SubtitleScreen::AddScaledImage(), MythUIImage::customEvent(), MythBDOverlayScreen::DisplayBDOverlay(), SubtitleScreen::DisplayScaledAVSubtitles(), MythPainter::DrawEllipse(), MythPainter::DrawRect(), MythPainter::DrawRoundRect(), MythUIImage::DrawSelf(), MythPainter::DrawText(), MythPainter::DrawTextLayout(), ZMEvents::eventVisible(), MythPainter::ExpireImages(), ThumbFinder::getFrameImage(), MythUIButtonListItem::HasImage(), MythNotificationScreen::Init(), MythUIImage::Load(), MythUIThemeCache::LoadCacheImage(), ImageLoader::LoadImage(), TeletextScreen::OptimiseDisplayedArea(), SubtitleScreen::RenderAssTrack(), MythUIVideo::Reset(), MythUIButtonListItem::SetImage(), SetIsInCache(), ImageProperties::SetMaskImage(), WebPage::slotIconChanged(), Player::updateFrame(), MHIContext::UpdateOSD(), ImageProperties::~ImageProperties(), MythBrowser::~MythBrowser(), MythUIButtonListItem::~MythUIButtonListItem(), MythUIVideo::~MythUIVideo(), and MythUIWebBrowser::~MythUIWebBrowser().
Reimplemented in MythQtImage.
Definition at line 50 of file mythimage.h.
Referenced by Assign(), ZMEvents::eventVisible(), MythD3D9Painter::GetImageFromCache(), MythPainterVulkan::GetTextureFromCache(), MythOpenGLPainter::GetTextureFromCache(), ImageLoader::LoadImage(), Resize(), MythQtImage::SetChanged(), and MythUIWebBrowser::UpdateBuffer().
|
inline |
Definition at line 51 of file mythimage.h.
Referenced by MythD3D9Painter::GetImageFromCache(), MythPainterVulkan::GetTextureFromCache(), and MythOpenGLPainter::GetTextureFromCache().
|
inline |
Definition at line 53 of file mythimage.h.
|
inline |
Definition at line 54 of file mythimage.h.
Referenced by MythUIImage::SetImage().
|
inline |
Definition at line 55 of file mythimage.h.
Referenced by MythUIImage::SetImage().
void MythImage::Assign | ( | const QImage & | img | ) |
Definition at line 77 of file mythimage.cpp.
Referenced by SubtitleScreen::AddScaledImage(), Assign(), MythBrowser::Create(), MythBDOverlayScreen::DisplayBDOverlay(), SubtitleScreen::DisplayScaledAVSubtitles(), MythPainter::DrawRectPriv(), MythPainter::DrawTextPriv(), ZMEvents::eventVisible(), ThumbFinder::getFrameImage(), MythPainter::GetImageFromTextLayout(), Gradient(), MythUIWebBrowser::Init(), MythNotificationScreen::Init(), Load(), TeletextScreen::OptimiseDisplayedArea(), Orientation(), Reflect(), SubtitleScreen::RenderAssTrack(), Resize(), WebPage::slotIconChanged(), MythUIVideo::UpdateFrame(), Player::updateFrame(), MHIContext::UpdateOSD(), and ThumbFinder::updatePositionBar().
void MythImage::Assign | ( | const QPixmap & | pix | ) |
Definition at line 92 of file mythimage.cpp.
bool MythImage::Load | ( | MythImageReader * | reader | ) |
Definition at line 276 of file mythimage.cpp.
Referenced by MythUIThemeCache::LoadCacheImage(), and ImageLoader::LoadImage().
bool MythImage::Load | ( | const QString & | filename | ) |
Definition at line 294 of file mythimage.cpp.
void MythImage::Orientation | ( | int | orientation | ) |
Changes the orientation angle of the image according to the exif rotation values.
The image will be rotated accordingly.
orientation |
Definition at line 134 of file mythimage.cpp.
Referenced by ImageLoader::LoadImage(), and MythUIImage::SetImage().
Definition at line 143 of file mythimage.cpp.
Referenced by ImageLoader::LoadImage(), and MythUIImage::SetImage().
void MythImage::Reflect | ( | ReflectAxis | axis, |
int | shear, | ||
int | scale, | ||
int | length, | ||
int | spacing = 0 |
||
) |
Definition at line 165 of file mythimage.cpp.
Referenced by ImageLoader::LoadImage(), and MythUIImage::SetImage().
void MythImage::ToGreyscale | ( | ) |
Definition at line 260 of file mythimage.cpp.
Referenced by ImageLoader::LoadImage(), and MythUIImage::SetImage().
|
inline |
Definition at line 69 of file mythimage.h.
Referenced by MythPainter::ExpireImages(), MythPainter::GetImageFromRect(), MythPainter::GetImageFromString(), and MythPainter::GetImageFromTextLayout().
|
static |
Create a gradient image.
painter | The painter on which the gradient should be draw. |
size | The size of the image. |
begin | The beginning colour. |
end | The ending colour. |
alpha | The opacity of the gradient. |
direction | Whether the gradient should be left-to-right or top-to-bottom. |
Definition at line 416 of file mythimage.cpp.
|
inline |
Definition at line 87 of file mythimage.h.
|
inline |
Definition at line 88 of file mythimage.h.
|
inline |
Definition at line 90 of file mythimage.h.
Referenced by MythPainter::GetFormatImage(), MythPainter::GetImageFromRect(), MythPainter::GetImageFromString(), MythPainter::GetImageFromTextLayout(), and Load().
|
inline |
Definition at line 91 of file mythimage.h.
Referenced by MythUIImage::SetImage().
|
inline |
Definition at line 93 of file mythimage.h.
Referenced by ImageLoader::LoadImage().
|
inline |
Definition at line 94 of file mythimage.h.
Referenced by ImageLoader::LoadImage().
void MythImage::SetIsInCache | ( | bool | bCached | ) |
Definition at line 70 of file mythimage.cpp.
Referenced by Assign(), MythUIThemeCache::CacheImage(), and MythUIThemeCache::LoadCacheImage().
|
inline |
Definition at line 98 of file mythimage.h.
|
staticprotected |
Definition at line 372 of file mythimage.cpp.
Referenced by Gradient(), Reflect(), and Resize().
Definition at line 110 of file mythimage.h.
|
protected |
Definition at line 111 of file mythimage.h.
Referenced by MythImage(), and ~MythImage().
Definition at line 113 of file mythimage.h.
Referenced by Gradient(), and Resize().
|
protected |
Definition at line 114 of file mythimage.h.
Referenced by Gradient(), and Resize().
|
protected |
Definition at line 115 of file mythimage.h.
Referenced by Gradient(), and Resize().
|
protected |
Definition at line 116 of file mythimage.h.
Referenced by Gradient(), and Resize().
|
protected |
Definition at line 117 of file mythimage.h.
Referenced by Gradient(), and Resize().
Definition at line 119 of file mythimage.h.
Referenced by Orientation().
Definition at line 120 of file mythimage.h.
Referenced by Reflect().
|
protected |
Definition at line 122 of file mythimage.h.
|
protected |
Definition at line 124 of file mythimage.h.
Referenced by MythImage().
Definition at line 126 of file mythimage.h.
Referenced by Assign(), DecrRef(), IncrRef(), and SetIsInCache().
|
staticprotected |
Definition at line 128 of file mythimage.h.
Referenced by DecrRef(), IncrRef(), and MythImage().