SetMediaCropCommand.h header

#include <ew/core/SetMediaCropCommand.h>

Namespace ew::core

SetMediaCropCommand class

class ew::core::SetMediaCropCommand

Command that sets (or clears) a media object's non-destructive crop region (see MediaCrop): the visible rectangle of the image, stored as metadata without touching the asset file. Undo restores the previous crop and redo re-applies the new one.

Members

ew::core::SetMediaCropCommand::SetMediaCropCommand(Media &media, std::optional< MediaCrop > crop)

Creates a command that sets media's crop to crop (std::nullopt clears it, showing the whole image) when applied.

ew::core::SetMediaCropCommand::~SetMediaCropCommand() override

Destroys the command.

void ew::core::SetMediaCropCommand::apply() override

Records the current crop and sets the new one.

void ew::core::SetMediaCropCommand::undo() override

Restores the previous crop.

QString ew::core::SetMediaCropCommand::description() const override

Returns a short description for the undo/redo UI.