--- a/trunk/EnlargerDialog.h +++ b/trunk/EnlargerDialog.h @@ -37,7 +37,7 @@ enum DialogMode { noEnlarge, previewEnlarge, fullEnlarge }; // when changing image format, what should stay constant: newWidth, newHeight or zoomFact ? -enum ZoomUpdateMode { useWidth, useHeight, useZoom }; +enum ZoomUpdateMode { useWidth, useHeight, useWidthAndHeight, useZoom }; namespace Ui @@ -65,6 +65,8 @@ // for managing the various zoom-setting-possibilities float zoomFact; + float aspectX,aspectY; // zoomX = zoomFact*aspectX, zoomY = zoomFact*aspectY, aspectX*aspectY=1.0 + bool freeAspectRatio; // aspect ratio mode: true allows aspect ratio changes int zoomInt; int newWidth,newHeight; int srcWidth,srcHeight; @@ -93,7 +95,10 @@ bool TryOpenSource( QString fileName ); void ZoomUseWidth ( void ); void ZoomUseHeight( void ); + void ZoomUseWidthAndHeight( void ); void ZoomUseZoom ( void ); + float ZoomX( void ) { return aspectX * zoomFact; } + float ZoomY( void ) { return aspectY * zoomFact; } public slots: void SetNewWidth ( int v ); @@ -111,7 +116,6 @@ void slot_load2( void ); void slot_comboChanged( const QString & txt ); void slot_checkBoxChanged( int state ); - void slot_calc( void ); void slot_queueCalc( void ); void slot_showPreview( const QImage & result ); void slot_showPreviewProgress( int val ); @@ -140,6 +144,10 @@ void slot_QueueRemoveSelected( void ); void slot_QueueClear( void ); void slot_QueueRemoveEnded( void ); + void slot_ZoomRadioButton( void ); + void slot_WidthRadioButton( void ); + void slot_HeightRadioButton( void ); + void slot_SmallMode( bool b); private: void MenuBarSetup( void ); @@ -150,6 +158,7 @@ void UpdateZoom( void ); // change zoom at format change, according to zoomUpdateMode void SetZoom( float zoomF ); + void ChangeAspectRatio( int dstWidth, int dstHeight ); void ResetDialog( void ); void SetSource(const QImage & src ); void CenterSelectBox( void );