Fix histogram reset after recalculation
This commit is contained in:
@@ -639,6 +639,7 @@ Void PlaYUVerApp::createActions()
|
||||
m_arrayActions[RELOAD_ACT] = new QAction( tr( "&Reload" ), this );
|
||||
m_arrayActions[RELOAD_ACT]->setIcon( style()->standardIcon( QStyle::SP_BrowserReload ) );
|
||||
m_arrayActions[RELOAD_ACT]->setShortcut( Qt::CTRL + Qt::Key_R );
|
||||
m_arrayActions[RELOAD_ACT]->setShortcut( Qt::Key_F5 );
|
||||
m_arrayActions[RELOAD_ACT]->setStatusTip( tr( "Reload current sequence" ) );
|
||||
connect( m_arrayActions[RELOAD_ACT], SIGNAL( triggered() ), this, SLOT( reload() ) );
|
||||
|
||||
|
||||
+12
-37
@@ -50,31 +50,21 @@ typedef long long Int64;
|
||||
typedef unsigned long long UInt64;
|
||||
#endif
|
||||
|
||||
static inline void* mem_malloc( size_t nitems )
|
||||
{
|
||||
void *d;
|
||||
if( ( d = malloc( nitems ) ) == NULL )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
static inline void mem_free( void *ptr )
|
||||
{
|
||||
if( ptr != NULL )
|
||||
{
|
||||
free( ptr );
|
||||
ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#define DATA_ALIGN 1 ///< use 32-bit aligned malloc/free
|
||||
#if DATA_ALIGN && _WIN32 && ( _MSC_VER > 1300 )
|
||||
#define xMalloc( len ) _aligned_malloc( len, 32 )
|
||||
#define xFree( ptr ) _aligned_free ( ptr )
|
||||
#define xMemSet( type, len, ptr )
|
||||
#else
|
||||
#define xMemSet( type, len, ptr ) memset ( ptr, 0, (len)*sizeof(type) )
|
||||
#define xMalloc( len ) malloc ( len )
|
||||
#define xFreeMem( ptr ) free ( ptr )
|
||||
#endif
|
||||
|
||||
static inline Void* xMallocMem( SizeT nitems )
|
||||
{
|
||||
Void *d;
|
||||
if( ( d = malloc( nitems ) ) == NULL )
|
||||
if( ( d = xMalloc( nitems ) ) == NULL )
|
||||
{
|
||||
printf( "malloc failed.\n" );
|
||||
return NULL;
|
||||
@@ -90,20 +80,6 @@ static inline Void* xCallocMem( SizeT nitems, SizeT size )
|
||||
return d;
|
||||
}
|
||||
|
||||
static inline Void xFreePointer( Void *pointer )
|
||||
{
|
||||
if( pointer != NULL )
|
||||
{
|
||||
free( pointer );
|
||||
pointer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static inline Void xFreeMem( Void *mem )
|
||||
{
|
||||
xFreePointer( mem );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Int getMem1D( T **array1D, Int dim0 )
|
||||
{
|
||||
@@ -182,7 +158,7 @@ Void freeMem1D( T *array1D )
|
||||
{
|
||||
if( array1D )
|
||||
{
|
||||
mem_free( array1D );
|
||||
xFreeMem( array1D );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +234,6 @@ Void freeMem3ImageComponents( T*** array3D )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // NAMESPACE
|
||||
|
||||
#endif // __LIBMEMORY_H__
|
||||
|
||||
@@ -91,16 +91,6 @@ typedef UChar Byte;
|
||||
// Macro functions
|
||||
// ====================================================================================================================
|
||||
|
||||
#define DATA_ALIGN 1 ///< use 32-bit aligned malloc/free
|
||||
#if DATA_ALIGN && _WIN32 && ( _MSC_VER > 1300 )
|
||||
#define xMalloc( type, len ) _aligned_malloc( sizeof(type)*(len), 32 )
|
||||
#define xFree( ptr ) _aligned_free ( ptr )
|
||||
#define xMemSet( type, len, ptr )
|
||||
#else
|
||||
#define xMemSet( type, len, ptr ) memset ( ptr, 0, (len)*sizeof(type) )
|
||||
#define xMalloc( type, len ) malloc ( sizeof(type)*(len) )
|
||||
#define xFree( ptr ) free ( ptr )
|
||||
#endif
|
||||
|
||||
// ====================================================================================================================
|
||||
// PlaYUVer definitions
|
||||
|
||||
@@ -504,6 +504,8 @@ Void PlaYUVerFrame::calcHistogram()
|
||||
}
|
||||
m_bRunningFlag = true;
|
||||
|
||||
xMemSet( UInt, m_uiHistoSegments * m_uiHistoChannels, m_puiHistogram );
|
||||
|
||||
UInt i, j;
|
||||
UInt numberChannels = m_pcPelFormat->numberChannels;
|
||||
Int colorSpace = m_pcPelFormat->colorSpace;
|
||||
|
||||
Reference in New Issue
Block a user