Skip to content

soufianekhiat/DearWidgets

Repository files navigation

DearWidgets

DearWidgets aim to produce useful Widgets particulary useful on Graphics (Image Processing, 3D, ...). DearWidgets aim to provide helper to simplify creation of custom widgets.

DearWidgets is 3 collections of helpers:

  • DrawLists
  • Interactions
  • Widgets
  • Math Helpers
  • Helpers to have type independent "Scalar"

Dear Widgets is a collection of help to simplify the develoment of application.

DearWidgets add some helpers which allow us to create Custom Widget independently of the try. A Scalar is stored as an ImU64, which is a memcpy of any type supported by ImGui {Im{U|S}{8, 16, 32, 64} | bool | float | double}.

  • bool IsNegativeScalar
  • void EqualScalar
  • float ScalarToFloat
  • ImU64 FloatToScalar
  • ImU64 AddScalar
  • ImU64 SubScalar
  • ImU64 MulScalar
  • ImU64 DivScalar
  • ImU64 Normalize01
  • ...

DearWidgets is using ImPlatform.

Incentivise development:

Become a Patron

https://www.patreon.com/SoufianeKHIAT

PR & Discussion are open.

Features

DrawList

  • Triangle Pointer {Right, Up, Left, Down}

Used internally for LineSlider

  • Hue Band
  • Luminance Band
  • Saturation Band

Used Internally to implement HueSelector.

  • Color Ring

TODO: Ring HueSelector TODO: Add support for 2D (angle, radius) lambda

  • Custom Color Ring

  • Chromatic Plot{Bilinear, Nearest}
    • Chromatic Point
    • Chromatic Line

  • Convex Mask

Support for ConvexMask, will fail or flip triangle if the shape is not convex. In practice some non-convex shape could work if all vertices are visible from the corner of the BoundingBox Used.

  • DrawColorDensityPlot (aka ShaderToy)

Use carefully that can have impact on your performances for HighRes canvas or/and expensive lambda.

Widgets

  • Hue Selector

Draft

Draft means draft.

Draw

  • ChromaticityPlot

Widgets

  • DragLengthScalar

  • Slider 2D Float A version for Slider2DScaler is available for (Im{S|U}{8,16,32,64}, Float and Double)

  • Slider 2D Int

  • Range Select 2D

  • Slider 3D

  • Grid

  • 2D Move

  • Line Slider (TBD)

Performance Considerations

Notice some DrawList are purely calling DrawList from Dear ImGui. So based on your parameters a non-negligeable impact on performance can be notice. Do not put an unreasonable resolution.

Constrains

C++ features used internally:

  • std::string
  • (Optionnal) Lambda

Legacy

Removed:

  • AnalyticalPlotEx
  • AnalyticalPlot
  • CenterNextItem
  • DragFloatLog
  • RangeSelect2D didn't find a proper control
  • Slider3D no real use case

Removed C++ feature dependencies:

  • template
  • constexpr
  • if constexpr
  • Lambda from template
  • auto
  • std::vector<float>, std::vector<bool> for isoline