Bugfix in HistogramWidget and PlaYUVerFrameStatistics
Conditions were not proper checking if frame exists Change on some variables name Still incomplete the code and some variable must be renamed to include code style
This commit is contained in:
1 parent
d06f333a6e
commit
e0695f9cdc
5 files changed
+32
-26
No files matched your search
@@ -362,11 +362,12 @@ void HistogramWidget::updateData( uchar *imageData, uint imageWidth, uint imageH
|
||||
m_selectionHistogram = 0L;
|
||||
}
|
||||
|
||||
void HistogramWidget::updateData( const PlaYUVerFrame &image, const PlaYUVerFrame &selection )
|
||||
void HistogramWidget::updateData( const PlaYUVerFrame &playuver_frame, const PlaYUVerFrame &playuver_selection )
|
||||
{
|
||||
d->sixteenBits = false;
|
||||
d->imageColorSpace = image.getPelFormat();
|
||||
d->imageChannels = image.getNumberChannels();
|
||||
//d->imageColorSpace = image.getPelFormat();
|
||||
d->imageColorSpace = PlaYUVerFrame::RGB8;
|
||||
d->imageChannels = playuver_frame.getNumberChannels();
|
||||
|
||||
// We are deleting the histogram data,
|
||||
// so we must not use it to draw any more.
|
||||
@@ -386,12 +387,12 @@ void HistogramWidget::updateData( const PlaYUVerFrame &image, const PlaYUVerFram
|
||||
delete m_selectionHistogram;
|
||||
|
||||
// Calc new histogram data
|
||||
m_imageHistogram = new PlaYUVerFrameStatistics( image, this );
|
||||
m_imageHistogram = new PlaYUVerFrameStatistics( playuver_frame, this );
|
||||
|
||||
if( !selection.isValid() )
|
||||
m_selectionHistogram = new PlaYUVerFrameStatistics( selection, this );
|
||||
if( playuver_selection.isValid() )
|
||||
m_selectionHistogram = new PlaYUVerFrameStatistics( playuver_selection, this );
|
||||
else
|
||||
m_selectionHistogram = 0L;
|
||||
m_selectionHistogram = NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public :
|
||||
uchar *selData = 0, uint selWidth = 0, uint selHeight = 0);
|
||||
|
||||
/** Update full image histogram data from SImage.*/
|
||||
void updateData( const PlaYUVerFrame &image, const PlaYUVerFrame &selection );
|
||||
void updateData( const PlaYUVerFrame &playuver_frame, const PlaYUVerFrame &playuver_selection );
|
||||
|
||||
/** Update image selection histogram data methods.*/
|
||||
void updateSelectionData( uchar *selData, uint selWidth, uint selHeight,
|
||||
|
||||
@@ -120,6 +120,9 @@ Void StreamPropertiesSideBar::setData( InputStream* pcStream )
|
||||
{
|
||||
// Clear information.
|
||||
labelFormatValue->clear();
|
||||
labelCodecValue->clear();
|
||||
labelDurationValueTime->clear();
|
||||
labelDurationValueFrames->clear();
|
||||
labelSizeValue->clear();
|
||||
labelColorSpaceValue->clear();
|
||||
|
||||
@@ -409,8 +412,10 @@ Void FramePropertiesSideBar::setData( PlaYUVerFrame* pcFrame )
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ( PlaYUVerFrame::isRGBorYUVorGray( pcFrame->getPelFormat() ) == PlaYUVerFrame::COLOR_RGB
|
||||
|| PlaYUVerFrame::isRGBorYUVorGray( pcFrame->getPelFormat() ) == PlaYUVerFrame::COLOR_ARGB ) && ( channelCB->count() == 1 ) )
|
||||
Int pel_fmt = pcFrame->getPelFormat();
|
||||
pel_fmt = PlaYUVerFrame::RGB8;
|
||||
if( ( PlaYUVerFrame::isRGBorYUVorGray( pel_fmt ) == PlaYUVerFrame::COLOR_RGB
|
||||
|| PlaYUVerFrame::isRGBorYUVorGray( pel_fmt ) == PlaYUVerFrame::COLOR_ARGB ) && ( channelCB->count() == 1 ) )
|
||||
{
|
||||
channelCB->addItem( tr( "Red" ) );
|
||||
channelCB->setItemIcon( 1, QIcon( ":/images/channel-red.png" ) );
|
||||
@@ -419,7 +424,7 @@ Void FramePropertiesSideBar::setData( PlaYUVerFrame* pcFrame )
|
||||
channelCB->addItem( tr( "Blue" ) );
|
||||
channelCB->setItemIcon( 3, QIcon( ":/images/channel-blue.png" ) );
|
||||
|
||||
if( PlaYUVerFrame::isRGBorYUVorGray( pcFrame->getPelFormat() ) == PlaYUVerFrame::COLOR_ARGB )
|
||||
if( PlaYUVerFrame::isRGBorYUVorGray( pel_fmt ) == PlaYUVerFrame::COLOR_ARGB )
|
||||
{
|
||||
channelCB->addItem( tr( "Alpha" ) );
|
||||
channelCB->setItemIcon( 4, QIcon( ":/images/channel-alpha.png" ) );
|
||||
@@ -442,7 +447,7 @@ Void FramePropertiesSideBar::setData( PlaYUVerFrame* pcFrame )
|
||||
|
||||
m_pcFrame = pcFrame;
|
||||
|
||||
if( !m_pcFrame->isValid() )
|
||||
if( m_pcFrame->isValid() )
|
||||
{
|
||||
// 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
|
||||
|
||||
Reference in new issue
Block a user