MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
MythImage Class Reference

#include <mythimage.h>

Inheritance diagram for MythImage:
Inheritance graph
[legend]
Collaboration diagram for MythImage:
Collaboration graph
[legend]

Public Member Functions

 MythImage (MythPainter *parent, const char *name="MythImage")
 Creates a reference counted image, call DecrRef() to delete. More...
 
MythPainterGetParent (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 MythImageGradient (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}
 
MythPainterm_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 MythUIHelpers_ui = nullptr
 

Detailed Description

Definition at line 36 of file mythimage.h.

Constructor & Destructor Documentation

◆ MythImage()

MythImage::MythImage ( MythPainter parent,
const char *  name = "MythImage" 
)
explicit

Creates a reference counted image, call DecrRef() to delete.

Definition at line 25 of file mythimage.cpp.

◆ ~MythImage()

MythImage::~MythImage ( )
overrideprotected

Definition at line 38 of file mythimage.cpp.

Member Function Documentation

◆ ApplyExifOrientation()

QImage MythImage::ApplyExifOrientation ( QImage &  image,
int  orientation 
)
static

Definition at line 97 of file mythimage.cpp.

Referenced by ThumbThread< ImageDbSg >::CreateThumbnail(), and Orientation().

◆ GetParent()

MythPainter* MythImage::GetParent ( void  )
inline

Definition at line 44 of file mythimage.h.

Referenced by MythPainter::CheckFormatImage().

◆ SetParent()

void MythImage::SetParent ( MythPainter parent)
inline

Definition at line 45 of file mythimage.h.

Referenced by MythPainter::CheckFormatImage().

◆ IncrRef()

int MythImage::IncrRef ( void  )
overridevirtual

◆ DecrRef()

int MythImage::DecrRef ( void  )
overridevirtual

◆ SetChanged()

virtual void MythImage::SetChanged ( bool  change = true)
inlinevirtual

◆ IsChanged()

bool MythImage::IsChanged ( ) const
inline

◆ IsGradient()

bool MythImage::IsGradient ( ) const
inline

Definition at line 53 of file mythimage.h.

◆ IsReflected()

bool MythImage::IsReflected ( ) const
inline

Definition at line 54 of file mythimage.h.

Referenced by MythUIImage::SetImage().

◆ IsOriented()

bool MythImage::IsOriented ( ) const
inline

Definition at line 55 of file mythimage.h.

Referenced by MythUIImage::SetImage().

◆ Assign() [1/2]

void MythImage::Assign ( const QImage &  img)

◆ Assign() [2/2]

void MythImage::Assign ( const QPixmap &  pix)

Definition at line 92 of file mythimage.cpp.

◆ Load() [1/2]

bool MythImage::Load ( MythImageReader reader)

Definition at line 276 of file mythimage.cpp.

Referenced by MythUIThemeCache::LoadCacheImage(), and ImageLoader::LoadImage().

◆ Load() [2/2]

bool MythImage::Load ( const QString &  filename)

Definition at line 294 of file mythimage.cpp.

◆ Orientation()

void MythImage::Orientation ( int  orientation)

Changes the orientation angle of the image according to the exif rotation values.

The image will be rotated accordingly.

MythImage::Orientation

Parameters
orientation

Definition at line 134 of file mythimage.cpp.

Referenced by ImageLoader::LoadImage(), and MythUIImage::SetImage().

◆ Resize()

void MythImage::Resize ( QSize  newSize,
bool  preserveAspect = false 
)

Definition at line 143 of file mythimage.cpp.

Referenced by ImageLoader::LoadImage(), and MythUIImage::SetImage().

◆ Reflect()

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().

◆ ToGreyscale()

void MythImage::ToGreyscale ( )

Definition at line 260 of file mythimage.cpp.

Referenced by ImageLoader::LoadImage(), and MythUIImage::SetImage().

◆ GetSize()

int64_t MythImage::GetSize ( void  )
inline

◆ Gradient()

MythImage * MythImage::Gradient ( MythPainter painter,
QSize  size,
const QColor &  begin,
const QColor &  end,
uint  alpha,
FillDirection  direction = FillDirection::TopToBottom 
)
static

Create a gradient image.

Parameters
painterThe painter on which the gradient should be draw.
sizeThe size of the image.
beginThe beginning colour.
endThe ending colour.
alphaThe opacity of the gradient.
directionWhether the gradient should be left-to-right or top-to-bottom.
Returns
A reference counted image, call DecrRef() to delete.

Definition at line 416 of file mythimage.cpp.

◆ SetID()

void MythImage::SetID ( unsigned int  id)
inline

Definition at line 87 of file mythimage.h.

◆ GetID()

unsigned int MythImage::GetID ( void  ) const
inline

Definition at line 88 of file mythimage.h.

◆ SetFileName()

void MythImage::SetFileName ( QString  fname)
inline

◆ GetFileName()

QString MythImage::GetFileName ( void  ) const
inline

Definition at line 91 of file mythimage.h.

Referenced by MythUIImage::SetImage().

◆ setIsReflected()

void MythImage::setIsReflected ( bool  reflected)
inline

Definition at line 93 of file mythimage.h.

Referenced by ImageLoader::LoadImage().

◆ setIsOriented()

void MythImage::setIsOriented ( bool  oriented)
inline

Definition at line 94 of file mythimage.h.

Referenced by ImageLoader::LoadImage().

◆ SetIsInCache()

void MythImage::SetIsInCache ( bool  bCached)

◆ GetCacheSize()

uint MythImage::GetCacheSize ( void  ) const
inline

Definition at line 98 of file mythimage.h.

◆ MakeGradient()

void MythImage::MakeGradient ( QImage &  image,
const QColor &  begin,
const QColor &  end,
int  alpha,
BoundaryWanted  drawBoundary = BoundaryWanted::Yes,
FillDirection  direction = FillDirection::TopToBottom 
)
staticprotected

Definition at line 372 of file mythimage.cpp.

Referenced by Gradient(), Reflect(), and Resize().

Member Data Documentation

◆ m_changed

bool MythImage::m_changed {false}
protected

Definition at line 110 of file mythimage.h.

◆ m_parent

MythPainter* MythImage::m_parent {nullptr}
protected

Definition at line 111 of file mythimage.h.

Referenced by MythImage(), and ~MythImage().

◆ m_isGradient

bool MythImage::m_isGradient {false}
protected

Definition at line 113 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_gradBegin

QColor MythImage::m_gradBegin {0x00, 0x00, 0x00}
protected

Definition at line 114 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_gradEnd

QColor MythImage::m_gradEnd {0xFF, 0xFF, 0xFF}
protected

Definition at line 115 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_gradAlpha

int MythImage::m_gradAlpha {255}
protected

Definition at line 116 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_gradDirection

FillDirection MythImage::m_gradDirection {FillDirection::TopToBottom}
protected

Definition at line 117 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_isOriented

bool MythImage::m_isOriented {false}
protected

Definition at line 119 of file mythimage.h.

Referenced by Orientation().

◆ m_isReflected

bool MythImage::m_isReflected {false}
protected

Definition at line 120 of file mythimage.h.

Referenced by Reflect().

◆ m_imageId

unsigned int MythImage::m_imageId {0}
protected

Definition at line 122 of file mythimage.h.

◆ m_fileName

QString MythImage::m_fileName
protected

Definition at line 124 of file mythimage.h.

Referenced by MythImage().

◆ m_cached

bool MythImage::m_cached {false}
protected

Definition at line 126 of file mythimage.h.

Referenced by Assign(), DecrRef(), IncrRef(), and SetIsInCache().

◆ s_ui

MythUIHelper * MythImage::s_ui = nullptr
staticprotected

Definition at line 128 of file mythimage.h.

Referenced by DecrRef(), IncrRef(), and MythImage().


The documentation for this class was generated from the following files: