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 SetToYUV (void)
 
void ConvertToYUV (void)
 
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 (const QSize &newSize, bool preserveAspect=false)
 
void Reflect (ReflectAxis axis, int shear, int scale, int length, int spacing=0)
 
void ToGreyscale ()
 
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, const QSize &size, const QColor &begin, const QColor &end, uint alpha, FillDirection direction=FillTopToBottom)
 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

virtual ~MythImage ()
 
- 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, bool drawBoundary=true, FillDirection direction=FillTopToBottom)
 

Protected Attributes

bool m_Changed {false}
 
MythPainterm_Parent {nullptr}
 
bool m_isGradient {false}
 
QColor m_gradBegin {"#000000"}
 
QColor m_gradEnd {"#FFFFFF"}
 
int m_gradAlpha {255}
 
FillDirection m_gradDirection {FillTopToBottom}
 
bool m_isOriented {false}
 
bool m_isReflected {false}
 
bool m_isYUV {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 31 of file mythimage.h.

Constructor & Destructor Documentation

◆ MythImage()

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

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

Definition at line 28 of file mythimage.cpp.

◆ ~MythImage()

MythImage::~MythImage ( )
protectedvirtual

Definition at line 41 of file mythimage.cpp.

Member Function Documentation

◆ ApplyExifOrientation()

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

Definition at line 100 of file mythimage.cpp.

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

◆ GetParent()

MythPainter* MythImage::GetParent ( void  )
inline

Definition at line 39 of file mythimage.h.

Referenced by MythPainter::CheckFormatImage().

◆ SetParent()

void MythImage::SetParent ( MythPainter parent)
inline

Definition at line 40 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 48 of file mythimage.h.

◆ IsReflected()

bool MythImage::IsReflected ( ) const
inline

Definition at line 49 of file mythimage.h.

Referenced by MythUIImage::SetImage(), and MythUIImage::SetImages().

◆ IsOriented()

bool MythImage::IsOriented ( ) const
inline

Definition at line 50 of file mythimage.h.

Referenced by MythUIImage::SetImage(), and MythUIImage::SetImages().

◆ SetToYUV()

void MythImage::SetToYUV ( void  )
inline

◆ ConvertToYUV()

void MythImage::ConvertToYUV ( void  )

Definition at line 433 of file mythimage.cpp.

Referenced by VideoOutput::DisplayOSD(), and MythYUVAPainter::DrawImage().

◆ Assign() [1/2]

void MythImage::Assign ( const QImage &  img)

◆ Assign() [2/2]

void MythImage::Assign ( const QPixmap &  pix)

Definition at line 95 of file mythimage.cpp.

◆ Load() [1/2]

bool MythImage::Load ( MythImageReader reader)

Definition at line 271 of file mythimage.cpp.

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

◆ Load() [2/2]

bool MythImage::Load ( const QString &  filename)

Definition at line 289 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 137 of file mythimage.cpp.

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

◆ Resize()

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

◆ Reflect()

void MythImage::Reflect ( ReflectAxis  axis,
int  shear,
int  scale,
int  length,
int  spacing = 0 
)

◆ ToGreyscale()

void MythImage::ToGreyscale ( )

◆ Gradient()

MythImage * MythImage::Gradient ( MythPainter painter,
const QSize &  size,
const QColor &  begin,
const QColor &  end,
uint  alpha,
FillDirection  direction = FillTopToBottom 
)
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 410 of file mythimage.cpp.

◆ SetID()

void MythImage::SetID ( unsigned int  id)
inline

Definition at line 82 of file mythimage.h.

◆ GetID()

unsigned int MythImage::GetID ( void  ) const
inline

Definition at line 83 of file mythimage.h.

◆ SetFileName()

void MythImage::SetFileName ( QString  fname)
inline

◆ GetFileName()

QString MythImage::GetFileName ( void  ) const
inline

Definition at line 86 of file mythimage.h.

Referenced by MythUIImage::SetImage().

◆ setIsReflected()

void MythImage::setIsReflected ( bool  reflected)
inline

Definition at line 88 of file mythimage.h.

Referenced by ImageLoader::LoadImage().

◆ setIsOriented()

void MythImage::setIsOriented ( bool  oriented)
inline

Definition at line 89 of file mythimage.h.

Referenced by ImageLoader::LoadImage().

◆ SetIsInCache()

void MythImage::SetIsInCache ( bool  bCached)

Definition at line 73 of file mythimage.cpp.

Referenced by Assign(), MythUIHelper::CacheImage(), and MythUIHelper::LoadCacheImage().

◆ GetCacheSize()

uint MythImage::GetCacheSize ( void  ) const
inline

Definition at line 93 of file mythimage.h.

◆ MakeGradient()

void MythImage::MakeGradient ( QImage &  image,
const QColor &  begin,
const QColor &  end,
int  alpha,
bool  drawBoundary = true,
FillDirection  direction = FillTopToBottom 
)
staticprotected

Definition at line 367 of file mythimage.cpp.

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

Member Data Documentation

◆ m_Changed

bool MythImage::m_Changed {false}
protected

Definition at line 109 of file mythimage.h.

◆ m_Parent

MythPainter* MythImage::m_Parent {nullptr}
protected

Definition at line 110 of file mythimage.h.

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

◆ m_isGradient

bool MythImage::m_isGradient {false}
protected

Definition at line 112 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_gradBegin

QColor MythImage::m_gradBegin {"#000000"}
protected

Definition at line 113 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_gradEnd

QColor MythImage::m_gradEnd {"#FFFFFF"}
protected

Definition at line 114 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_gradAlpha

int MythImage::m_gradAlpha {255}
protected

Definition at line 115 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_gradDirection

FillDirection MythImage::m_gradDirection {FillTopToBottom}
protected

Definition at line 116 of file mythimage.h.

Referenced by Gradient(), and Resize().

◆ m_isOriented

bool MythImage::m_isOriented {false}
protected

Definition at line 118 of file mythimage.h.

Referenced by Orientation().

◆ m_isReflected

bool MythImage::m_isReflected {false}
protected

Definition at line 119 of file mythimage.h.

Referenced by Reflect().

◆ m_isYUV

bool MythImage::m_isYUV {false}
protected

Definition at line 120 of file mythimage.h.

Referenced by ConvertToYUV().

◆ 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: