Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions JPEGView/Config/KeyMap.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file defines the key mapping for JPEGView
// Make sure not to corrupt it - else no keys are working anymore!
// Make sure not to corrupt it or else no keys will work anymore!
// It is possible to map multiple keys to the same command but not multiple commands to the same key

// This section contains the definitions of the available JPEGView commands - do not modify!
Expand Down Expand Up @@ -110,6 +110,8 @@
#define IDM_PAN_LEFT 15203 // pan left
#define IDM_SHARPEN_INC 15300 // increase sharpness
#define IDM_SHARPEN_DEC 15301 // decrease sharpness
#define IDM_SATURATION_INC 15400 // increase saturation
#define IDM_SATURATION_DEC 15401 // decrease saturation
#define IDM_CONTEXT_MENU 16000 // display context menu

// This section contains the key map. A small number of keys is predefined and cannot be changed:
Expand Down Expand Up @@ -142,13 +144,15 @@ Ctrl+Shift+Plus IDM_CONTRAST_CORRECTION_INC
Ctrl+Alt+Plus IDM_COLOR_CORRECTION_INC
Ctrl+Plus IDM_CONTRAST_INC
Shift+Plus IDM_GAMMA_INC
Alt+Plus IDM_SHARPEN_INC
Alt+Plus IDM_SATURATION_INC
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is a reassignment of the keys from sharpen to saturation right?

I would prefer making saturation (new feature) assign the new key rather than changing the older one

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right.

Yea, I thought about just using a new shortcut, but thought it would be better to instead keep the shortcuts more consistent? Each one of the 3 modifier keys controls one of the 3 editing sliders on the left of the editing panel. I thought the sharpen slider was really of a different category (since it doesn't actually edit the photo, but instead is just a filter when viewing the image) and therefore should have a distinct type of shortcut. I thought that would be a more intuitive user experience? But I don't have strong feelings about this – I'll let you decide which way to go on this.

Ctrl+Alt+Shift+Plus IDM_SHARPEN_INC
Minus IDM_ZOOM_DEC
Ctrl+Shift+Minus IDM_CONTRAST_CORRECTION_DEC
Ctrl+Alt+Minus IDM_COLOR_CORRECTION_DEC
Ctrl+Minus IDM_CONTRAST_DEC
Shift+Minus IDM_GAMMA_DEC
Alt+Minus IDM_SHARPEN_DEC
Alt+Minus IDM_SATURATION_DEC
Ctrl+Alt+Shift+Minus IDM_SHARPEN_DEC
F2 IDM_SHOW_FILEINFO
Ctrl+F2 IDM_SHOW_FILENAME
F3 IDM_TOGGLE_RESAMPLING_QUALITY
Expand Down
20 changes: 12 additions & 8 deletions JPEGView/Config/KeyMap_ru.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
#define IDM_PAN_LEFT 15203 // ����������� �������� �����
#define IDM_SHARPEN_INC 15300 // ������� ��������
#define IDM_SHARPEN_DEC 15301 // �������� ��������
#define IDM_SATURATION_INC 15400 // ������� ������������
#define IDM_SATURATION_DEC 15401 // �������� ������������
#define IDM_CONTEXT_MENU 16000 // �������� ����������� ����

// ������ ���� �������� ���������� ������.
Expand Down Expand Up @@ -152,14 +154,16 @@ Plus IDM_ZOOM_INC
Ctrl+Shift+Plus IDM_CONTRAST_CORRECTION_INC
Ctrl+Alt+Plus IDM_COLOR_CORRECTION_INC
Ctrl+Plus IDM_CONTRAST_INC
Shift+Plus IDM_GAMMA_INC
Alt+Plus IDM_SHARPEN_INC
Minus IDM_ZOOM_DEC
Ctrl+Shift+Minus IDM_CONTRAST_CORRECTION_DEC
Ctrl+Alt+Minus IDM_COLOR_CORRECTION_DEC
Ctrl+Minus IDM_CONTRAST_DEC
Shift+Minus IDM_GAMMA_DEC
Alt+Minus IDM_SHARPEN_DEC
Shift+Plus IDM_GAMMA_INC
Alt+Plus IDM_SATURATION_INC
Ctrl+Alt+Plus IDM_SHARPEN_INC
Minus IDM_ZOOM_DEC
Ctrl+Shift+Minus IDM_CONTRAST_CORRECTION_DEC
Ctrl+Alt+Minus IDM_COLOR_CORRECTION_DEC
Ctrl+Minus IDM_CONTRAST_DEC
Shift+Minus IDM_GAMMA_DEC
Alt+Minus IDM_SATURATION_DEC
Ctrl+Alt+Minus IDM_SHARPEN_DEC
F2 IDM_SHOW_FILEINFO
Ctrl+F2 IDM_SHOW_FILENAME
F3 IDM_TOGGLE_RESAMPLING_QUALITY
Expand Down
13 changes: 12 additions & 1 deletion JPEGView/MainDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ static const int MIN_WND_WIDTH = 320;
static const int MIN_WND_HEIGHT = 240;

static const double GAMMA_FACTOR = 1.02; // multiplicator for gamma value
static const double CONTRAST_INC = 0.03; // increment for contrast value
static const double CONTRAST_INC = 0.02; // increment for contrast value
static const double SATURATION_INC = 0.02; // increment for saturation value
static const double SHARPEN_INC = 0.05; // increment for sharpen value
static const double LDC_INC = 0.1; // increment for LDC (lighten shadows and darken highlights)
static const int NUM_THREADS = 1; // number of readahead threads to use
Expand Down Expand Up @@ -1928,6 +1929,10 @@ void CMainDlg::ExecuteCommand(int nCommand) {
case IDM_GAMMA_DEC:
AdjustGamma((nCommand == IDM_GAMMA_INC)? 1.0/GAMMA_FACTOR : GAMMA_FACTOR);
break;
case IDM_SATURATION_INC:
case IDM_SATURATION_DEC:
AdjustSaturation((nCommand == IDM_SATURATION_INC)? SATURATION_INC : -SATURATION_INC);
break;
case IDM_LDC_SHADOWS_INC:
case IDM_LDC_SHADOWS_DEC:
case IDM_LDC_HIGHLIGHTS_INC:
Expand Down Expand Up @@ -2413,6 +2418,12 @@ void CMainDlg::AdjustGamma(double dFactor) {
this->Invalidate(FALSE);
}

void CMainDlg::AdjustSaturation(double dInc) {
m_pImageProcParams->Saturation += dInc;
m_pImageProcParams->Saturation = min(2.0, max(0.0, m_pImageProcParams->Saturation));
this->Invalidate(FALSE);
}

void CMainDlg::AdjustContrast(double dInc) {
m_pImageProcParams->Contrast += dInc;
m_pImageProcParams->Contrast = min(0.5, max(-0.5, m_pImageProcParams->Contrast));
Expand Down
1 change: 1 addition & 0 deletions JPEGView/MainDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ class CMainDlg : public CDialogImpl<CMainDlg>
void AdjustLDC(int nMode, double dInc);
void AdjustGamma(double dFactor);
void AdjustContrast(double dInc);
void AdjustSaturation(double dInc);
void AdjustSharpen(double dInc);
void PerformZoom(double dValue, bool bExponent, bool bZoomToMouse, bool bAdjustWindowToImage);
void ZoomToSelection();
Expand Down
2 changes: 2 additions & 0 deletions JPEGView/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@
#define IDM_PAN_LEFT 15203
#define IDM_SHARPEN_INC 15300
#define IDM_SHARPEN_DEC 15301
#define IDM_SATURATION_INC 15400
#define IDM_SATURATION_DEC 15401
#define IDM_CONTEXT_MENU 16000

#define IDM_CROP_SEL 20000
Expand Down