"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gmic-qt/src/InputOutputState.cpp" between
gmic_2.8.1.tar.gz and gmic_2.8.2.tar.gz

About: G’MIC (GREY’s Magic for Image Computing) is a framework for image processing. It provides several different user interfaces to convert/manipulate/filter/ visualize generic image datasets (usable standalone or as plug-in for GIMP and Krita).

InputOutputState.cpp  (gmic_2.8.1):InputOutputState.cpp  (gmic_2.8.2)
skipping to change at line 29 skipping to change at line 29
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with gmic_qt. If not, see <http://www.gnu.org/licenses/>. * along with gmic_qt. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
#include "InputOutputState.h" #include "InputOutputState.h"
#include <QJsonObject> #include <QJsonObject>
namespace
{
void filterObsoleteInputModes(GmicQt::InputMode & mode)
{
switch (mode) {
case GmicQt::AllDesc_UNUSED:
case GmicQt::AllVisiblesDesc_UNUSED:
case GmicQt::AllInvisiblesDesc_UNUSED:
mode = GmicQt::UnspecifiedInputMode;
break;
default:
break;
}
}
} // namespace
namespace GmicQt namespace GmicQt
{ {
const InputOutputState InputOutputState::Default(GmicQt::DefaultInputMode, GmicQ t::DefaultOutputMode, GmicQt::DefaultPreviewMode); const InputOutputState InputOutputState::Default(GmicQt::DefaultInputMode, GmicQ t::DefaultOutputMode, GmicQt::DefaultPreviewMode);
const InputOutputState InputOutputState::Unspecified(GmicQt::UnspecifiedInputMod e, GmicQt::UnspecifiedOutputMode, GmicQt::UnspecifiedPreviewMode); const InputOutputState InputOutputState::Unspecified(GmicQt::UnspecifiedInputMod e, GmicQt::UnspecifiedOutputMode, GmicQt::UnspecifiedPreviewMode);
InputOutputState::InputOutputState() : inputMode(UnspecifiedInputMode), outputMo de(UnspecifiedOutputMode), previewMode(GmicQt::UnspecifiedPreviewMode) {} InputOutputState::InputOutputState() : inputMode(UnspecifiedInputMode), outputMo de(UnspecifiedOutputMode), previewMode(GmicQt::UnspecifiedPreviewMode) {}
InputOutputState::InputOutputState(InputMode inputMode, OutputMode outputMode, P reviewMode previewMode) : inputMode(inputMode), outputMode(outputMode), previewM ode(previewMode) {} InputOutputState::InputOutputState(InputMode inputMode, OutputMode outputMode, P reviewMode previewMode) : inputMode(inputMode), outputMode(outputMode), previewM ode(previewMode) {}
skipping to change at line 57 skipping to change at line 73
} }
bool InputOutputState::isDefault() const bool InputOutputState::isDefault() const
{ {
return (inputMode == GmicQt::DefaultInputMode) && (outputMode == GmicQt::Defau ltOutputMode) && (previewMode == GmicQt::DefaultPreviewMode); return (inputMode == GmicQt::DefaultInputMode) && (outputMode == GmicQt::Defau ltOutputMode) && (previewMode == GmicQt::DefaultPreviewMode);
} }
void InputOutputState::toJSONObject(QJsonObject & object) const void InputOutputState::toJSONObject(QJsonObject & object) const
{ {
object = QJsonObject(); object = QJsonObject();
if (inputMode != DefaultInputMode) { if (inputMode != UnspecifiedInputMode) {
object.insert("InputLayers", inputMode); object.insert("InputLayers", inputMode);
} }
if (outputMode != DefaultOutputMode) { if (outputMode != DefaultOutputMode) {
object.insert("OutputMode", outputMode); object.insert("OutputMode", outputMode);
} }
if (previewMode != DefaultPreviewMode) { if (previewMode != DefaultPreviewMode) {
object.insert("PreviewMode", previewMode); object.insert("PreviewMode", previewMode);
} }
} }
InputOutputState InputOutputState::fromJSONObject(const QJsonObject & object) InputOutputState InputOutputState::fromJSONObject(const QJsonObject & object)
{ {
GmicQt::InputOutputState state; GmicQt::InputOutputState state;
state.inputMode = static_cast<InputMode>(object.value("InputLayers").toInt(Uns pecifiedInputMode)); state.inputMode = static_cast<InputMode>(object.value("InputLayers").toInt(Uns pecifiedInputMode));
filterObsoleteInputModes(state.inputMode);
state.outputMode = static_cast<OutputMode>(object.value("OutputMode").toInt(Un specifiedOutputMode)); state.outputMode = static_cast<OutputMode>(object.value("OutputMode").toInt(Un specifiedOutputMode));
state.previewMode = static_cast<PreviewMode>(object.value("PreviewMode").toInt (UnspecifiedPreviewMode)); state.previewMode = static_cast<PreviewMode>(object.value("PreviewMode").toInt (UnspecifiedPreviewMode));
return state; return state;
} }
} // namespace GmicQt } // namespace GmicQt
 End of changes. 3 change blocks. 
1 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)