Implemented a method to receive and store a snapshot of the current image via JSON.

This commit is contained in:
xIronic
2025-02-20 21:04:54 +01:00
parent dd81a23dfc
commit b9a72c8b49
6 changed files with 73 additions and 4 deletions

View File

@@ -285,6 +285,11 @@ private:
///
void handleSystemCommand(const QJsonObject &message, const JsonApiCommand& cmd);
/// @brief Handle an incoming JSON message for actions related to the current image
/// @param message the incoming message
///
void handleGetCurrentImageCommand(const QJsonObject &message, const JsonApiCommand& cmd);
void applyColorAdjustments(const QJsonObject &adjustment, ColorAdjustment *colorAdjustment);
void applyColorAdjustment(const QString &colorName, const QJsonObject &adjustment, RgbChannelAdjustment &rgbAdjustment);
void applyGammaTransform(const QString &transformName, const QJsonObject &adjustment, RgbTransform &rgbTransform, char channel);
@@ -403,5 +408,4 @@ private:
// The JsonCallbacks instance which handles data subscription/notifications
QSharedPointer<JsonCallbacks> _jsonCB;
};

View File

@@ -34,7 +34,8 @@ public:
System,
Temperature,
Transform,
VideoMode
VideoMode,
GetCurrentImage
};
static QString toString(Type type) {
@@ -65,6 +66,7 @@ public:
case Transform: return "transform";
case VideoMode: return "videomode";
case Service: return "service";
case GetCurrentImage: return "getcurrentimage";
default: return "unknown";
}
}
@@ -322,7 +324,8 @@ public:
{ {"system", "toggleIdle"}, { Command::System, SubCommand::ToggleIdle, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} },
{ {"temperature", ""}, { Command::Temperature, SubCommand::Empty, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} },
{ {"transform", ""}, { Command::Transform, SubCommand::Empty, Authorization::Yes, InstanceCmd::Yes, NoListenerCmd::Yes} },
{ {"videomode", ""}, { Command::VideoMode, SubCommand::Empty, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} }
{ {"videomode", ""}, { Command::VideoMode, SubCommand::Empty, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} },
{ {"getcurrentimage", ""}, { Command::GetCurrentImage, SubCommand::Empty, Authorization::Yes, InstanceCmd::No, NoListenerCmd::Yes} }
};
return commandLookup;
}