Different changes

Minor changes in the properties side bar
Improvements in the modules interface and filter frame module
This commit is contained in:
jfmcarreira committed 2014-04-17 02:05:27 +01:00
1 parent 88ecf8850f
commit cdc5e39b58
9 files changed
+29 -29

No files matched your search

+5 -5
View File
@@ -362,12 +362,12 @@ void HistogramWidget::updateData( Pel ***imageData, UInt imageWidth, UInt imageH
m_selectionHistogram = 0L;
}
void HistogramWidget::updateData( const PlaYUVerFrame &playuver_frame, const PlaYUVerFrame &playuver_selection )
void HistogramWidget::updateData( const PlaYUVerFrame *playuver_frame, const PlaYUVerFrame *playuver_selection )
{
d->sixteenBits = false;
//d->imageColorSpace = image.getPelFormat();
d->imageColorSpace = PlaYUVerFrame::isRGBorYUVorGray( playuver_frame.getPelFormat() );
d->imageChannels = playuver_frame.getNumberChannels();
d->imageColorSpace = PlaYUVerFrame::isRGBorYUVorGray( playuver_frame->getPelFormat() );
d->imageChannels = playuver_frame->getNumberChannels();
// We are deleting the histogram data,
// so we must not use it to draw any more.
@@ -389,7 +389,7 @@ void HistogramWidget::updateData( const PlaYUVerFrame &playuver_frame, const Pla
// Calc new histogram data
m_imageHistogram = new PlaYUVerFrameStatistics( playuver_frame, this );
if( playuver_selection.isValid() )
if( playuver_selection->isValid() )
m_selectionHistogram = new PlaYUVerFrameStatistics( playuver_selection, this );
else
m_selectionHistogram = NULL;
@@ -407,7 +407,7 @@ void HistogramWidget::updateSelectionData( Pel ***selData, UInt selWidth, UInt s
m_selectionHistogram = new PlaYUVerFrameStatistics( selData, selWidth, selHeight, bitsPerChannel, pixel_format, chroma_size, this );
}
void HistogramWidget::updateSelectionData( const PlaYUVerFrame &selection )
void HistogramWidget::updateSelectionData( const PlaYUVerFrame *selection )
{
// Remove old histogram data from memory.
+2 -2
View File
@@ -124,14 +124,14 @@ public :
Pel ***selData = 0, UInt selWidth = 0, UInt selHeight = 0);
/** Update full image histogram data from SImage.*/
void updateData( const PlaYUVerFrame &playuver_frame, const PlaYUVerFrame &playuver_selection );
void updateData( const PlaYUVerFrame *playuver_frame, const PlaYUVerFrame *playuver_selection );
/** Update image selection histogram data methods.*/
void updateSelectionData( Pel ***selData, uint selWidth, uint selHeight,
Int bitsPerChannel, Int pixel_format, UInt chroma_size );
/** Update image selection histogram data from SImage.*/
void updateSelectionData( const PlaYUVerFrame &imageSelection );
void updateSelectionData( const PlaYUVerFrame *imageSelection );
/** @see @p HistogramOption */
void setOptions( HistogramOptions options = AllOptions );
+2 -1
View File
@@ -66,10 +66,11 @@ enum __PlaYUVerModuleRequirements
typedef struct __PlaYUVerModuleDefinition
{
int m_pchModuleType;
int m_iModuleType;
const char* m_pchModuleCategory;
const char* m_pchModuleName;
const char* m_pchModuleTooltip;
bool m_bRequiresNewWindow;
}PlaYUVerModuleDefinition;
+2 -2
View File
@@ -393,7 +393,7 @@ void FramePropertiesSideBar::slotUpdateHistogram()
// If a selection area is done in Image Editor and if the current
// image is the same in Image Viewer, then compute too the histogram
// for this selection.
histogramWidget->updateData( *m_pcFrame, PlaYUVerFrame() );
histogramWidget->updateData( m_pcFrame, new PlaYUVerFrame );
fullImageButton->hide();
selectionImageButton->hide();
updateInformations();
@@ -510,7 +510,7 @@ Void FramePropertiesSideBar::setSelection( const QRect &selectionArea )
// imageSelection.height(),
// imageSelection.bitsPerChannel(),
// imageSelection.colorSpace() );
histogramWidget->updateSelectionData( *m_pcFrameSelection );
histogramWidget->updateSelectionData( m_pcFrameSelection );
fullImageButton->show();
selectionImageButton->show();
selectionImageButton->click();
+8 -1
View File
@@ -227,7 +227,14 @@ void plaYUVerApp::selectModule( QAction *curr_action )
PlaYUVerModuleIf* pcCurrMod = m_pcModulesHandle->getSelectedModuleIf();
if( pcCurrMod )
{
m_pcCurrentSubWindow->enableModule( pcCurrMod );
if( pcCurrMod->m_cModuleDef.m_bRequiresNewWindow )
{
}
else
{
m_pcCurrentSubWindow->enableModule( pcCurrMod );
}
}
}
return;
+1
View File
@@ -122,6 +122,7 @@ public:
Pel*** getPelBufferYUV() const
{
//m_bHasRGBPel = false;
return m_pppcInputPel;
}
+3 -3
View File
@@ -95,11 +95,11 @@ public:
// Constructors and Destructor
////////////////////////////////////////////////////////////////////////////////
PlaYUVerFrameStatistics::PlaYUVerFrameStatistics( const PlaYUVerFrame& playuver_frame, QObject *parent, Options options ) :
PlaYUVerFrameStatistics::PlaYUVerFrameStatistics( const PlaYUVerFrame *playuver_frame, QObject *parent, Options options ) :
QThread()
{
setup( playuver_frame.getPelBufferYUV(), playuver_frame.getWidth(), playuver_frame.getHeight(), playuver_frame.getBitsChannel(),
playuver_frame.getPelFormat(), playuver_frame.getChromaLength(), parent, options );
setup( playuver_frame->getPelBufferYUV(), playuver_frame->getWidth(), playuver_frame->getHeight(), playuver_frame->getBitsChannel(),
playuver_frame->getPelFormat(), playuver_frame->getChromaLength(), parent, options );
}
PlaYUVerFrameStatistics::PlaYUVerFrameStatistics( Pel ***data, UInt width, UInt height, Int bitsPerChannel, Int pixel_format, UInt chroma_size, QObject *parent,
+1 -1
View File
@@ -88,7 +88,7 @@ public:
PlaYUVerFrameStatistics( Pel ***data, UInt width, UInt height, Int bitsPerChannel, Int pixel_format, UInt chroma_size,
QObject *parent = 0, Options options = CalcLumaWhenRGB );
PlaYUVerFrameStatistics( const PlaYUVerFrame& playuver_frame, QObject *parent = 0, Options options = CalcLumaWhenRGB );
PlaYUVerFrameStatistics( const PlaYUVerFrame *playuver_frame, QObject *parent = 0, Options options = CalcLumaWhenRGB );
~PlaYUVerFrameStatistics();
+5 -14
View File
@@ -35,6 +35,7 @@ PlaYUVerModuleDefinition FilterFrameDef = {
"Filters",
"Y_Filter",
"Filter Y matrix of YUV frame",
false,
};
FilterFrame::FilterFrame()
@@ -45,24 +46,14 @@ FilterFrame::FilterFrame()
Void FilterFrame::create( PlaYUVerFrame* InputFrame )
{
m_pcFilteredFrame = NULL;
m_pcFilteredFrame = new PlaYUVerFrame( InputFrame->getWidth(), InputFrame->getHeight(), InputFrame->getPelFormat() );
m_pcFilteredFrame = new PlaYUVerFrame( InputFrame->getWidth(), InputFrame->getHeight(), PlaYUVerFrame::GRAY );
}
PlaYUVerFrame* FilterFrame::process( PlaYUVerFrame* InputFrame )
{
Pel*** pppPelYUV = m_pcFilteredFrame->getPelBufferYUV();
m_pcFilteredFrame->CopyFrom( InputFrame );
for( UInt y = 0; y < m_pcFilteredFrame->getHeight() / 2; y++ )
{
for( UInt x = 0; x < m_pcFilteredFrame->getWidth() / 2; x++ )
{
pppPelYUV[1][y][x] = 128;
pppPelYUV[2][y][x] = 128;
}
}
//m_pcFilteredFrame->YUV420toRGB();
Pel*** pppOutputPelYUV = m_pcFilteredFrame->getPelBufferYUV();
Pel*** pppInputPelYUV = InputFrame->getPelBufferYUV();
memcpy( pppOutputPelYUV[LUMA][0], pppInputPelYUV[LUMA][0], m_pcFilteredFrame->getWidth() * m_pcFilteredFrame->getHeight() * sizeof(Pel) );
return m_pcFilteredFrame;
}