Skip to content

Commit

Permalink
Develop (#99)
Browse files Browse the repository at this point in the history
* replacing edit panel (and many other UI elements) with menu bar. closes #64 
* made toolbars scrollable if they don't fit horizontally in the window
* keyboard shortcut processing and documentation has been automated and centralized within the new menu bar code.
* added several keyboard shortcuts
* updated readme images
  • Loading branch information
wkjarosz authored Jan 4, 2023
1 parent b938950 commit 0f82210
Show file tree
Hide file tree
Showing 49 changed files with 3,737 additions and 3,848 deletions.
18 changes: 8 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -370,17 +370,11 @@ add_executable(
src/dialog.cpp
src/dialog.h
src/dithermatrix256.h
src/dropdown.cpp
src/dropdown.h
src/editimagepanel.cpp
src/editimagepanel.h
src/envmap.cpp
src/envmap.h
src/filmictonecurve.cpp
src/filmictonecurve.h
src/fwd.h
src/xpuimage.cpp
src/xpuimage.h
src/hdrcolorpicker.cpp
src/hdrcolorpicker.h
src/hdrimage.cpp
Expand All @@ -389,28 +383,30 @@ add_executable(
src/hdrimageio.cpp
src/hdrimageraw.cpp
src/hdrimageraw.h
src/hdrimageview.cpp
src/hdrimageview.h
src/hdrview.cpp
src/hdrviewscreen.cpp
src/hdrviewscreen.h
src/helpwindow.cpp
src/helpwindow.h
src/hscrollpanel.cpp
src/hscrollpanel.h
src/hslgradient.cpp
src/hslgradient.h
src/imagebutton.cpp
src/imagebutton.h
src/imagelistpanel.cpp
src/imagelistpanel.h
src/json.h
src/hdrimageview.cpp
src/hdrimageview.h
src/menu.cpp
src/menu.h
src/multigraph.cpp
src/multigraph.h
src/parallelfor.cpp
src/parallelfor.h
src/pfm.h
src/pfm.cpp
src/popupmenu.cpp
src/popupmenu.h
src/ppm.h
src/ppm.cpp
src/progress.cpp
Expand All @@ -423,6 +419,8 @@ add_executable(
src/tool.h
src/well.cpp
src/well.h
src/xpuimage.cpp
src/xpuimage.h
${EXTRA_SOURCE})

set_target_properties(HDRView PROPERTIES OUTPUT_NAME "HDRView")
Expand Down
Binary file modified resources/screenshot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/brush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ void Brush::make_brush()
{
Vector2f uv((x - m_size) * cos_theta + (y - m_size) * sin_theta,
b * ((y - m_size) * cos_theta - (x - m_size) * sin_theta));
// new_brush(x, y) = 1.0f - pow(smoothStep(start, end, norm(uv)), 0.8f);
new_brush(x, y) = sqr(cosf(M_PI_2 * std::clamp(lerpFactor(start, end, norm(uv)), 0.f, 1.f)));
// new_brush(x, y) = 1.0f - pow(smoothstep(start, end, norm(uv)), 0.8f);
new_brush(x, y) = sqr(cosf(M_PI_2 * std::clamp(lerp_factor(start, end, norm(uv)), 0.f, 1.f)));
if (new_brush(x, y) > 0.00001f)
{
min_x = std::min(min_x, x);
Expand Down
20 changes: 10 additions & 10 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ std::vector<T> linspaced(size_t num, T a, T b)
* @brief Inverse linear interpolation.
*
* Given three values \a a, \a b, \a m, determines the parameter value
* \a t, such that m = lerp(a,b,lerpFactor(a,b,m))
* \a t, such that m = lerp(a,b,lerp_factor(a,b,m))
*
* @param a The start point
* @param b The end point
* @param m A third point (typically between \a a and \a b)
* @return The interpolation factor \a t such that m = lerp(a,b,lerpFactor(a,b,m))
* @return The interpolation factor \a t such that m = lerp(a,b,lerp_factor(a,b,m))
*/
template <typename T>
inline T lerpFactor(T a, T b, T m)
inline T lerp_factor(T a, T b, T m)
{
return (m - a) / (b - a);
}
Expand All @@ -98,9 +98,9 @@ inline T lerpFactor(T a, T b, T m)
* @return A value between 0.0 and 1.0.
*/
template <typename T>
inline T smoothStep(T a, T b, T x)
inline T smoothstep(T a, T b, T x)
{
T t = std::clamp(lerpFactor(a, b, x), T(0), T(1));
T t = std::clamp(lerp_factor(a, b, x), T(0), T(1));
return t * t * (T(3) - T(2) * t);
}

Expand All @@ -116,9 +116,9 @@ inline T smoothStep(T a, T b, T x)
* @return A value between 0.0 and 1.0.
*/
template <typename T>
inline T smootherStep(T a, T b, T x)
inline T smootherstep(T a, T b, T x)
{
T t = std::clamp(lerpFactor(a, b, x), T(0), T(1));
T t = std::clamp(lerp_factor(a, b, x), T(0), T(1));
return t * t * t * (t * (t * T(6) - T(15)) + T(10));
}

Expand Down Expand Up @@ -318,9 +318,9 @@ enum EDirection
#define HDRVIEW_BACKEND "Metal"
#endif

int hdrview_version_major();
int hdrview_version_minor();
int hdrview_version_patch();
int hdrview_version_major();
int hdrview_version_minor();
int hdrview_version_patch();
std::string hdrview_version();
std::string hdrview_git_hash();
std::string hdrview_git_describe();
Expand Down
255 changes: 0 additions & 255 deletions src/dropdown.cpp

This file was deleted.

Loading

0 comments on commit 0f82210

Please sign in to comment.