From 7d8e4020750683412c9f56edf847fd830402aa0f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 9 Jan 2014 17:25:01 -0800 Subject: ACME-1244 : WIP : Move files around and introduced an llimagefiltersmanager to get the filters --- indra/newview/CMakeLists.txt | 2 + indra/newview/app_settings/filters/Gotham.xml | 30 -------- indra/newview/app_settings/filters/Grayscale.xml | 21 ++++++ indra/newview/app_settings/filters/GreenGray.xml | 24 +++++++ indra/newview/app_settings/filters/HLines.xml | 25 +++++++ indra/newview/app_settings/filters/Hefe.xml | 23 ------ indra/newview/app_settings/filters/Inkwell.xml | 14 ---- indra/newview/app_settings/filters/Lomofi.xml | 23 ------ indra/newview/app_settings/filters/Newspaper.xml | 4 +- indra/newview/app_settings/filters/Poprocket.xml | 25 ------- indra/newview/app_settings/filters/RedV.xml | 32 +++++++++ indra/newview/app_settings/filters/Saturate30.xml | 8 +++ indra/newview/app_settings/filters/SepiaV.xml | 26 +++++++ indra/newview/app_settings/filters/Sutro.xml | 19 ----- indra/newview/app_settings/filters/Toaster.xml | 23 ------ indra/newview/app_settings/filters/VividV.xml | 45 ++++++++++++ .../newview/app_settings/filters/VividYellowV.xml | 39 ++++++++++ indra/newview/app_settings/filters/YellowV.xml | 41 +++++++++++ indra/newview/llimagefiltersmanager.cpp | 84 ++++++++++++++++++++++ indra/newview/llimagefiltersmanager.h | 74 +++++++++++++++++++ indra/newview/viewer_manifest.py | 3 + 21 files changed, 426 insertions(+), 159 deletions(-) delete mode 100755 indra/newview/app_settings/filters/Gotham.xml create mode 100755 indra/newview/app_settings/filters/Grayscale.xml create mode 100755 indra/newview/app_settings/filters/GreenGray.xml create mode 100755 indra/newview/app_settings/filters/HLines.xml delete mode 100755 indra/newview/app_settings/filters/Hefe.xml delete mode 100755 indra/newview/app_settings/filters/Inkwell.xml delete mode 100755 indra/newview/app_settings/filters/Lomofi.xml delete mode 100755 indra/newview/app_settings/filters/Poprocket.xml create mode 100755 indra/newview/app_settings/filters/RedV.xml create mode 100755 indra/newview/app_settings/filters/Saturate30.xml create mode 100755 indra/newview/app_settings/filters/SepiaV.xml delete mode 100755 indra/newview/app_settings/filters/Sutro.xml delete mode 100755 indra/newview/app_settings/filters/Toaster.xml create mode 100755 indra/newview/app_settings/filters/VividV.xml create mode 100755 indra/newview/app_settings/filters/VividYellowV.xml create mode 100755 indra/newview/app_settings/filters/YellowV.xml create mode 100755 indra/newview/llimagefiltersmanager.cpp create mode 100755 indra/newview/llimagefiltersmanager.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 828849a327..e458193142 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -328,6 +328,7 @@ set(viewer_SOURCE_FILES llfloaterimsessiontab.cpp llfloaterimsession.cpp llfloaterimcontainer.cpp + llimagefiltersmanager.cpp llimhandler.cpp llimview.cpp llinspect.cpp @@ -919,6 +920,7 @@ set(viewer_HEADER_FILES llfloaterimsessiontab.h llfloaterimsession.h llfloaterimcontainer.h + llimagefiltersmanager.h llimview.h llinspect.h llinspectavatar.h diff --git a/indra/newview/app_settings/filters/Gotham.xml b/indra/newview/app_settings/filters/Gotham.xml deleted file mode 100755 index eb0725e6bf..0000000000 --- a/indra/newview/app_settings/filters/Gotham.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - linearize - 0.0 - 1.0 - 1.0 - 1.0 - - - gamma - 1.5 - 1.0 - 1.0 - 1.0 - - - colorize - 0.0 - 0.0 - 0.0 - 0.0 - 0.0 - 1.0 - - - grayscale - - - diff --git a/indra/newview/app_settings/filters/Grayscale.xml b/indra/newview/app_settings/filters/Grayscale.xml new file mode 100755 index 0000000000..101ed8233a --- /dev/null +++ b/indra/newview/app_settings/filters/Grayscale.xml @@ -0,0 +1,21 @@ + + + + linearize + 0.01 + 1.0 + 1.0 + 1.0 + + + contrast + 0.8 + 1.0 + 1.0 + 1.0 + + + grayscale + + + diff --git a/indra/newview/app_settings/filters/GreenGray.xml b/indra/newview/app_settings/filters/GreenGray.xml new file mode 100755 index 0000000000..dce5ab3e9e --- /dev/null +++ b/indra/newview/app_settings/filters/GreenGray.xml @@ -0,0 +1,24 @@ + + + + linearize + 0.1 + 1.0 + 1.0 + 1.0 + + + colorize + 1.0 + 1.0 + 1.0 + 0.0 + 0.3 + 0.0 + + + saturate + 0.35 + + + diff --git a/indra/newview/app_settings/filters/HLines.xml b/indra/newview/app_settings/filters/HLines.xml new file mode 100755 index 0000000000..ddff4d1977 --- /dev/null +++ b/indra/newview/app_settings/filters/HLines.xml @@ -0,0 +1,25 @@ + + + + linearize + 0.1 + 1.0 + 1.0 + 1.0 + + + grayscale + + + blend + 0.0 + 0.0 + + + screen + line + 5.0 + 0.0 + + + diff --git a/indra/newview/app_settings/filters/Hefe.xml b/indra/newview/app_settings/filters/Hefe.xml deleted file mode 100755 index 527aaee847..0000000000 --- a/indra/newview/app_settings/filters/Hefe.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - linearize - 0.0 - 1.0 - 1.0 - 1.0 - - - blend - 4.0 - 0.5 - - - contrast - 2.0 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/newview/app_settings/filters/Inkwell.xml b/indra/newview/app_settings/filters/Inkwell.xml deleted file mode 100755 index 77c88b5fbb..0000000000 --- a/indra/newview/app_settings/filters/Inkwell.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - linearize - 0.05 - 1.0 - 1.0 - 1.0 - - - grayscale - - - diff --git a/indra/newview/app_settings/filters/Lomofi.xml b/indra/newview/app_settings/filters/Lomofi.xml deleted file mode 100755 index f5ec911e59..0000000000 --- a/indra/newview/app_settings/filters/Lomofi.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - blend - 4.0 - 0.0 - - - linearize - 0.2 - 1.0 - 1.0 - 1.0 - - - brighten - 20.0 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/newview/app_settings/filters/Newspaper.xml b/indra/newview/app_settings/filters/Newspaper.xml index 7480325542..8247c34500 100755 --- a/indra/newview/app_settings/filters/Newspaper.xml +++ b/indra/newview/app_settings/filters/Newspaper.xml @@ -2,7 +2,7 @@ linearize - 0.2 + 0.1 1.0 1.0 1.0 @@ -18,7 +18,7 @@ screen 2Dsine - 15.0 + 5.0 0.0 diff --git a/indra/newview/app_settings/filters/Poprocket.xml b/indra/newview/app_settings/filters/Poprocket.xml deleted file mode 100755 index 7e64003908..0000000000 --- a/indra/newview/app_settings/filters/Poprocket.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - linearize - 0.0 - 1.0 - 1.0 - 1.0 - - - fade - 4.0 - 0.5 - - - colorize - 1.0 - 0.0 - 0.0 - 0.4 - 0.0 - 0.0 - - - diff --git a/indra/newview/app_settings/filters/RedV.xml b/indra/newview/app_settings/filters/RedV.xml new file mode 100755 index 0000000000..5c47ca0f84 --- /dev/null +++ b/indra/newview/app_settings/filters/RedV.xml @@ -0,0 +1,32 @@ + + + + linearize + 0.1 + 1.0 + 1.0 + 1.0 + + + contrast + 0.8 + 1.0 + 1.0 + 1.0 + + + fade + 4.0 + 0.5 + + + colorize + 1.0 + 0.0 + 1.0 + 0.4 + 0.0 + 0.2 + + + diff --git a/indra/newview/app_settings/filters/Saturate30.xml b/indra/newview/app_settings/filters/Saturate30.xml new file mode 100755 index 0000000000..b77f07a037 --- /dev/null +++ b/indra/newview/app_settings/filters/Saturate30.xml @@ -0,0 +1,8 @@ + + + + saturate + 3.0 + + + diff --git a/indra/newview/app_settings/filters/SepiaV.xml b/indra/newview/app_settings/filters/SepiaV.xml new file mode 100755 index 0000000000..d26df608b9 --- /dev/null +++ b/indra/newview/app_settings/filters/SepiaV.xml @@ -0,0 +1,26 @@ + + + + linearize + 0.01 + 1.0 + 1.0 + 1.0 + + + contrast + 0.8 + 1.0 + 1.0 + 1.0 + + + fade + 4.0 + 0.5 + + + sepia + + + diff --git a/indra/newview/app_settings/filters/Sutro.xml b/indra/newview/app_settings/filters/Sutro.xml deleted file mode 100755 index 3b0a58f01e..0000000000 --- a/indra/newview/app_settings/filters/Sutro.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - linearize - 0.05 - 1.0 - 1.0 - 1.0 - - - fade - 4.0 - 0.5 - - - sepia - - - diff --git a/indra/newview/app_settings/filters/Toaster.xml b/indra/newview/app_settings/filters/Toaster.xml deleted file mode 100755 index 170a1183ed..0000000000 --- a/indra/newview/app_settings/filters/Toaster.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - contrast - 0.8 - 1.0 - 1.0 - 1.0 - - - fade - 4.0 - 0.5 - - - brighten - 10.0 - 1.0 - 1.0 - 1.0 - - - diff --git a/indra/newview/app_settings/filters/VividV.xml b/indra/newview/app_settings/filters/VividV.xml new file mode 100755 index 0000000000..203130bdee --- /dev/null +++ b/indra/newview/app_settings/filters/VividV.xml @@ -0,0 +1,45 @@ + + + + linearize + 0.1 + 1.0 + 1.0 + 1.0 + + + contrast + 0.8 + 1.0 + 1.0 + 1.0 + + + saturate + 1.5 + + + fade + 1.0 + 0.25 + + + saturate + 0.8 + + + contrast + 1.1 + 1.0 + 1.0 + 1.0 + + + brighten + 30 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/newview/app_settings/filters/VividYellowV.xml b/indra/newview/app_settings/filters/VividYellowV.xml new file mode 100755 index 0000000000..2da27e53c1 --- /dev/null +++ b/indra/newview/app_settings/filters/VividYellowV.xml @@ -0,0 +1,39 @@ + + + + linearize + 0.1 + 1.0 + 1.0 + 1.0 + + + contrast + 1.1 + 1.0 + 1.0 + 1.0 + + + fade + 1.0 + 0.25 + + + colorize + 1.0 + 1.0 + 1.0 + 0.3 + 0.2 + 0.0 + + + contrast + 1.1 + 1.0 + 1.0 + 1.0 + + + diff --git a/indra/newview/app_settings/filters/YellowV.xml b/indra/newview/app_settings/filters/YellowV.xml new file mode 100755 index 0000000000..0dab2489a0 --- /dev/null +++ b/indra/newview/app_settings/filters/YellowV.xml @@ -0,0 +1,41 @@ + + + + linearize + 0.1 + 1.0 + 1.0 + 1.0 + + + contrast + 0.8 + 1.0 + 1.0 + 1.0 + + + colorize + 1.0 + 1.0 + 1.0 + 0.5 + 0.0 + 0.0 + + + blend + 10.0 + 0.0 + + + colorize + 1.0 + 1.0 + 1.0 + 0.1 + 0.1 + 0.0 + + + diff --git a/indra/newview/llimagefiltersmanager.cpp b/indra/newview/llimagefiltersmanager.cpp new file mode 100755 index 0000000000..efc4f56ad3 --- /dev/null +++ b/indra/newview/llimagefiltersmanager.cpp @@ -0,0 +1,84 @@ +/** + * @file llimagefilters.cpp + * @brief Load and execute image filters. Mostly used for Flickr at the moment. + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2014, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llimagefilters.h" + +#include "lldiriterator.h" + + +//--------------------------------------------------------------------------- +// LLImageFilters +//--------------------------------------------------------------------------- + +LLImageFilters::LLImageFilters() +{ +} + +LLImageFilters::~LLImageFilters() +{ +} + +// virtual static +void LLImageFilters::initSingleton() +{ + loadAllFilters(); +} + +// static +std::string LLImageFilters::getSysDir() +{ + return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "filters", ""); +} + +void LLImageFilters::loadAllFilters() +{ + // Load system (coming out of the box) filters + loadFiltersFromDir(getSysDir()); +} + +void LLImageFilters::loadFiltersFromDir(const std::string& dir) +{ + LLDirIterator dir_iter(dir, "*.xml"); + while (1) + { + std::string file; + if (!dir_iter.next(file)) + { + break; // no more files + } + + std::string path = gDirUtilp->add(dir, file); + + // For the moment, just output the file found to the log + llinfos << "Merov : loadFiltersFromDir, filter = " << path << llendl; + } +} + + + +//============================================================================ diff --git a/indra/newview/llimagefiltersmanager.h b/indra/newview/llimagefiltersmanager.h new file mode 100755 index 0000000000..52b4a56b9b --- /dev/null +++ b/indra/newview/llimagefiltersmanager.h @@ -0,0 +1,74 @@ +/** + * @file llimagefilters.h + * @brief Load and execute image filters. Mostly used for Flickr at the moment. + * + * $LicenseInfo:firstyear=2000&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2014, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLIMAGEFILTERS_H +#define LL_LLIMAGEFILTERS_H + +#include "llsingleton.h" +#include "llimage.h" +/* +typedef enum e_vignette_mode +{ + VIGNETTE_MODE_NONE = 0, + VIGNETTE_MODE_BLEND = 1, + VIGNETTE_MODE_FADE = 2 +} EVignetteMode; + +typedef enum e_screen_mode +{ + SCREEN_MODE_2DSINE = 0, + SCREEN_MODE_LINE = 1 +} EScreenMode; +*/ +//============================================================================ +// library initialization class + +class LLImageFilters : public LLSingleton +{ + LOG_CLASS(LLImageFilters); +public: + // getFilters(); get a vector of std::string containing the filter names + //LLSD loadFilter(const std::string& filter_name); + //void executeFilter(const LLSD& filter_data, LLPointer raw_image); + +protected: +private: + void loadAllFilters(); + void loadFiltersFromDir(const std::string& dir); + LLSD loadFilter(const std::string& path); + + static std::string getSysDir(); + + friend class LLSingleton; + /*virtual*/ void initSingleton(); + LLImageFilters(); + ~LLImageFilters(); + + // Needed here: + // - a map of filter files with name and path +}; + +#endif diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 9e8623c1f9..3a76773dde 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -98,6 +98,9 @@ class ViewerManifest(LLManifest): # ... and the entire windlight directory self.path("windlight") + # ... and the entire image filters directory + self.path("filters") + # ... and the included spell checking dictionaries pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') if self.prefix(src=pkgdir,dst=""): -- cgit v1.2.3