MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
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.
MythPainterGetParent (void)
void SetParent (MythPainter *parent)
virtual int IncrRef (void)
 Increments reference count.
virtual int DecrRef (void)
 Decrements reference count and deletes on 0.
virtual void SetChanged (bool change=true)
bool IsChanged () const
bool IsGradient () const
bool IsReflected () 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, bool scale=true)
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 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.

Static Public Member Functions

static MythImageGradient (MythPainter *painter, const QSize &size, const QColor &beg, const QColor &end, uint alpha, FillDirection direction=FillTopToBottom)
 Create a gradient image.
- Static Public Member Functions inherited from ReferenceCounter
static void PrintDebug (void)
 Print out any leaks if that level of debugging is enabled.

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.

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
MythPainterm_Parent
bool m_isGradient
QColor m_gradBegin
QColor m_gradEnd
int m_gradAlpha
FillDirection m_gradDirection
bool m_isReflected
bool m_isYUV
unsigned int m_imageId
QString m_FileName
bool m_cached
- Protected Attributes inherited from ReferenceCounter
const QString m_debugName
bool m_logDebug
 This is used to suppress creating LoggingItem classes for LoggingItem reference count changes.
QAtomicInt m_referenceCount

Static Protected Attributes

static MythUIHelpers_ui = NULL

Detailed Description

Definition at line 31 of file mythimage.h.

Constructor & Destructor Documentation

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

Definition at line 56 of file mythimage.cpp.

Member Function Documentation

MythPainter* MythImage::GetParent ( void  )
inline

Definition at line 37 of file mythimage.h.

Referenced by MythPainter::CheckFormatImage().

void MythImage::SetParent ( MythPainter parent)
inline

Definition at line 38 of file mythimage.h.

Referenced by MythPainter::CheckFormatImage().

int MythImage::IncrRef ( void  )
virtual
int MythImage::DecrRef ( void  )
virtual
virtual void MythImage::SetChanged ( bool  change = true)
inlinevirtual
bool MythImage::IsChanged ( ) const
inline
bool MythImage::IsGradient ( ) const
inline

Definition at line 46 of file mythimage.h.

bool MythImage::IsReflected ( ) const
inline

Definition at line 47 of file mythimage.h.

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

void MythImage::SetToYUV ( void  )
inline
void MythImage::ConvertToYUV ( void  )

Definition at line 379 of file mythimage.cpp.

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

void MythImage::Assign ( const QImage &  img)
void MythImage::Assign ( const QPixmap &  pix)

Definition at line 110 of file mythimage.cpp.

bool MythImage::Load ( MythImageReader reader)
bool MythImage::Load ( const QString &  filename,
bool  scale = true 
)

Definition at line 260 of file mythimage.cpp.

void MythImage::Resize ( const QSize &  newSize,
bool  preserveAspect = false 
)
void MythImage::Reflect ( ReflectAxis  axis,
int  shear,
int  scale,
int  length,
int  spacing = 0 
)
void MythImage::ToGreyscale ( )
MythImage * MythImage::Gradient ( MythPainter painter,
const QSize &  size,
const QColor &  beg,
const QColor &  end,
uint  alpha,
FillDirection  direction = FillTopToBottom 
)
static

Create a gradient image.

Parameters
sizeThe size of the image.
beginThe beginning colour.
endThe ending colour.
Returns
A reference counted image, call DecrRef() to delete.

Definition at line 356 of file mythimage.cpp.

void MythImage::SetID ( unsigned int  id)
inline

Definition at line 75 of file mythimage.h.

unsigned int MythImage::GetID ( void  ) const
inline

Definition at line 76 of file mythimage.h.

void MythImage::SetFileName ( QString  fname)
inline
QString MythImage::GetFileName ( void  ) const
inline

Definition at line 79 of file mythimage.h.

Referenced by MythUIImage::SetImage().

void MythImage::setIsReflected ( bool  reflected)
inline

Definition at line 81 of file mythimage.h.

Referenced by ImageLoader::LoadImage().

void MythImage::SetIsInCache ( bool  bCached)

Definition at line 88 of file mythimage.cpp.

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

uint MythImage::GetCacheSize ( void  ) const
inline

Definition at line 85 of file mythimage.h.

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

Definition at line 313 of file mythimage.cpp.

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

Member Data Documentation

bool MythImage::m_Changed
protected

Definition at line 97 of file mythimage.h.

Referenced by MythImage().

MythPainter* MythImage::m_Parent
protected

Definition at line 98 of file mythimage.h.

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

bool MythImage::m_isGradient
protected

Definition at line 100 of file mythimage.h.

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

QColor MythImage::m_gradBegin
protected

Definition at line 101 of file mythimage.h.

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

QColor MythImage::m_gradEnd
protected

Definition at line 102 of file mythimage.h.

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

int MythImage::m_gradAlpha
protected

Definition at line 103 of file mythimage.h.

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

FillDirection MythImage::m_gradDirection
protected

Definition at line 104 of file mythimage.h.

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

bool MythImage::m_isReflected
protected

Definition at line 106 of file mythimage.h.

Referenced by MythImage(), and Reflect().

bool MythImage::m_isYUV
protected

Definition at line 107 of file mythimage.h.

Referenced by ConvertToYUV(), and MythImage().

unsigned int MythImage::m_imageId
protected

Definition at line 109 of file mythimage.h.

Referenced by MythImage().

QString MythImage::m_FileName
protected

Definition at line 111 of file mythimage.h.

Referenced by MythImage().

bool MythImage::m_cached
protected

Definition at line 113 of file mythimage.h.

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

MythUIHelper * MythImage::s_ui = NULL
staticprotected

Definition at line 115 of file mythimage.h.

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


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