SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
satdump::handlers::ImageHandler Class Reference

The main standard ImageHandler. More...

#include <image_handler.h>

Inheritance diagram for satdump::handlers::ImageHandler:
satdump::handlers::Handler satdump::handlers::ProcessingHandler

Public Member Functions

 ImageHandler ()
 Constructor.
 ImageHandler (image::Image img)
 Constructor, init with an image.
 ImageHandler (image::Image img, std::string name)
 Constructor, init with image and name.
void setImage (image::Image &img)
 set current image (raw). Does NOT reset settings
image::ImagegetImage (bool current=true)
 Get current image. Either processed or raw.
void setName (std::string name)
 Set the image name.
std::string getSaneName ()
 Return a sane image name for saving.
void saveResult (std::string directory)
void drawSaveMenu ()
 Draws the same image Menu Item.
void drawMenu ()
 Render explorer menu left sidebar.
void drawContents (ImVec2 win_size)
 Render explorer contents (center/left)
void drawMenuBar ()
 Render explorer menu bar (in the left sidebar)
void setConfig (nlohmann::json p)
 Optional, allows setting a configuration/state from JSON.
nlohmann::json getConfig ()
 Optional, allows getting a configuration/state as JSON.
void resetConfig ()
 Optional, allows resetting the handler's configuration.
std::string getName ()
 Get this handler's readable name.
std::string getID ()
Public Member Functions inherited from satdump::handlers::Handler
virtual bool drawTreeMenu (std::shared_ptr< Handler > &h)
 Render explorer menu bar (in the left sidebar)
std::string getTreeID ()
 Get this handler's ImGui ID for rendering in the tree.
bool hasSubhandlers ()
 Check if this handler contains any sub-handlers.
virtual void addSubHandler (std::shared_ptr< Handler > handler, bool ontop=false)
 Add a new subhandler.
virtual void delSubHandler (std::shared_ptr< Handler > handler, bool now=false)
 Delete a subhandler.
virtual std::vector< std::shared_ptr< Handler > > getAllSubHandlers ()
 Get all current subhandlers.
void setCanBeSelected (bool v)
 Set if a handler can be select in the tree.
void setCanBeDragged (bool v)
 Set if a handler can be dragged around in the tree.
void setCanBeDraggedTo (bool v)
 Set if a handler can be dragged to in the tree.
void setSubHandlersCanBeDragged (bool v)
 Set if a handler's subhandlers can be dragged to in the tree.
void setCanSubBeReorgTo (bool v)
 Set if a handler's subhandlers can be reordered.
Public Member Functions inherited from satdump::handlers::ProcessingHandler
void process ()
 Performing processing. This is not multi-threaded, intended to call it externally.
void set_is_processing (bool v)
 Set the processing status externally, to force waiting before starting a new thread.
void asyncProcess ()
 Perform processing asynchronously, in a thread.

Public Attributes

std::function< void(int x, int y)> additionalMouseCallback = [](int, int) {}
bool wasMenuTriggered = false
Public Attributes inherited from satdump::handlers::Handler
std::string handler_tree_icon = "N"

Additional Inherited Members

Static Public Member Functions inherited from satdump::handlers::ProcessingHandler
static std::string getID ()
static std::shared_ptr< HandlergetInstance ()
Protected Attributes inherited from satdump::handlers::Handler
std::vector< std::shared_ptr< Handler > > subhandlers
std::mutex subhandlers_mtx
Protected Attributes inherited from satdump::handlers::ProcessingHandler
bool is_processing = false
std::mutex is_processing_mtx
std::thread async_thread

Detailed Description

The main standard ImageHandler.

This is more or less just meant to display images. It may either be used directly to present an image to the user in the explorer, while also showing edition options (TODOREWORK, have a mode where (part of?) editing is disabled?), or integrated in another handler as you wish.

It may also be used to perform various image processing tasks. TODOREWORK document all functions!

Constructor & Destructor Documentation

◆ ImageHandler() [1/2]

satdump::handlers::ImageHandler::ImageHandler ( image::Image img)

Constructor, init with an image.

Parameters
imgimage to be initialized with

◆ ImageHandler() [2/2]

satdump::handlers::ImageHandler::ImageHandler ( image::Image img,
std::string name )

Constructor, init with image and name.

Parameters
imgimage to be initialized with
nameof the handler to display

Member Function Documentation

◆ drawContents()

void satdump::handlers::ImageHandler::drawContents ( ImVec2 win_size)
virtual

Render explorer contents (center/left)

Implements satdump::handlers::Handler.

◆ drawMenu()

void satdump::handlers::ImageHandler::drawMenu ( )
virtual

Render explorer menu left sidebar.

Implements satdump::handlers::Handler.

◆ drawMenuBar()

void satdump::handlers::ImageHandler::drawMenuBar ( )
virtual

Render explorer menu bar (in the left sidebar)

Reimplemented from satdump::handlers::Handler.

◆ getConfig()

nlohmann::json satdump::handlers::ImageHandler::getConfig ( )
virtual

Optional, allows getting a configuration/state as JSON.

Returns
JSON object

Reimplemented from satdump::handlers::Handler.

◆ getID()

std::string satdump::handlers::ImageHandler::getID ( )
inlinevirtual

◆ getImage()

image::Image & satdump::handlers::ImageHandler::getImage ( bool current = true)
inline

Get current image. Either processed or raw.

Parameters
currentIf true, returns the processed image. Raw if false.

◆ getName()

std::string satdump::handlers::ImageHandler::getName ( )
inlinevirtual

Get this handler's readable name.

Returns
name as a string

Reimplemented from satdump::handlers::Handler.

◆ getSaneName()

std::string satdump::handlers::ImageHandler::getSaneName ( )

Return a sane image name for saving.

Returns
cleaned-up name. TODOREWORK generalize?

◆ resetConfig()

void satdump::handlers::ImageHandler::resetConfig ( )
inlinevirtual

Optional, allows resetting the handler's configuration.

Reimplemented from satdump::handlers::Handler.

◆ setConfig()

void satdump::handlers::ImageHandler::setConfig ( nlohmann::json p)
virtual

Optional, allows setting a configuration/state from JSON.

Parameters
pJSON object

Reimplemented from satdump::handlers::Handler.

◆ setImage()

void satdump::handlers::ImageHandler::setImage ( image::Image & img)

set current image (raw). Does NOT reset settings

Parameters
imgimage to set

◆ setName()

void satdump::handlers::ImageHandler::setName ( std::string name)
inline

Set the image name.

Parameters
namenew name to set

The documentation for this class was generated from the following files:
  • src-core/handlers/image/image_handler.h
  • src-core/handlers/image/image_handler.cpp