Skip to content
Snippets Groups Projects
Commit 7d8e4020 authored by Merov Linden's avatar Merov Linden
Browse files

ACME-1244 : WIP : Move files around and introduced an llimagefiltersmanager to get the filters

parent ac3becf8
No related branches found
No related tags found
No related merge requests found
Showing
with 337 additions and 70 deletions
...@@ -328,6 +328,7 @@ set(viewer_SOURCE_FILES ...@@ -328,6 +328,7 @@ set(viewer_SOURCE_FILES
llfloaterimsessiontab.cpp llfloaterimsessiontab.cpp
llfloaterimsession.cpp llfloaterimsession.cpp
llfloaterimcontainer.cpp llfloaterimcontainer.cpp
llimagefiltersmanager.cpp
llimhandler.cpp llimhandler.cpp
llimview.cpp llimview.cpp
llinspect.cpp llinspect.cpp
...@@ -919,6 +920,7 @@ set(viewer_HEADER_FILES ...@@ -919,6 +920,7 @@ set(viewer_HEADER_FILES
llfloaterimsessiontab.h llfloaterimsessiontab.h
llfloaterimsession.h llfloaterimsession.h
llfloaterimcontainer.h llfloaterimcontainer.h
llimagefiltersmanager.h
llimview.h llimview.h
llinspect.h llinspect.h
llinspectavatar.h llinspectavatar.h
......
...@@ -2,22 +2,20 @@ ...@@ -2,22 +2,20 @@
<array> <array>
<array> <array>
<string>linearize</string> <string>linearize</string>
<real>0.0</real> <real>0.01</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
</array> </array>
<array>
<string>blend</string>
<real>4.0</real>
<real>0.5</real>
</array>
<array> <array>
<string>contrast</string> <string>contrast</string>
<real>2.0</real> <real>0.8</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
</array> </array>
<array>
<string>grayscale</string>
</array>
</array> </array>
</llsd> </llsd>
<llsd> <llsd>
<array> <array>
<array>
<string>blend</string>
<real>4.0</real>
<real>0.0</real>
</array>
<array> <array>
<string>linearize</string> <string>linearize</string>
<real>0.2</real> <real>0.1</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
</array> </array>
<array> <array>
<string>brighten</string> <string>colorize</string>
<real>20.0</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
<real>0.0</real>
<real>0.3</real>
<real>0.0</real>
</array>
<array>
<string>saturate</string>
<real>0.35</real>
</array> </array>
</array> </array>
</llsd> </llsd>
...@@ -2,29 +2,24 @@ ...@@ -2,29 +2,24 @@
<array> <array>
<array> <array>
<string>linearize</string> <string>linearize</string>
<real>0.0</real> <real>0.1</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
</array> </array>
<array> <array>
<string>gamma</string> <string>grayscale</string>
<real>1.5</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array> </array>
<array> <array>
<string>colorize</string> <string>blend</string>
<real>0.0</real>
<real>0.0</real> <real>0.0</real>
<real>0.0</real> <real>0.0</real>
<real>0.0</real>
<real>0.0</real>
<real>1.0</real>
</array> </array>
<array> <array>
<string>grayscale</string> <string>screen</string>
<string>line</string>
<real>5.0</real>
<real>0.0</real>
</array> </array>
</array> </array>
</llsd> </llsd>
<llsd>
<array>
<array>
<string>linearize</string>
<real>0.05</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>grayscale</string>
</array>
</array>
</llsd>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<array> <array>
<array> <array>
<string>linearize</string> <string>linearize</string>
<real>0.2</real> <real>0.1</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<array> <array>
<string>screen</string> <string>screen</string>
<string>2Dsine</string> <string>2Dsine</string>
<real>15.0</real> <real>5.0</real>
<real>0.0</real> <real>0.0</real>
</array> </array>
</array> </array>
......
...@@ -2,7 +2,14 @@ ...@@ -2,7 +2,14 @@
<array> <array>
<array> <array>
<string>linearize</string> <string>linearize</string>
<real>0.0</real> <real>0.1</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>contrast</string>
<real>0.8</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
<real>1.0</real> <real>1.0</real>
...@@ -16,10 +23,10 @@ ...@@ -16,10 +23,10 @@
<string>colorize</string> <string>colorize</string>
<real>1.0</real> <real>1.0</real>
<real>0.0</real> <real>0.0</real>
<real>0.0</real> <real>1.0</real>
<real>0.4</real> <real>0.4</real>
<real>0.0</real> <real>0.0</real>
<real>0.0</real> <real>0.2</real>
</array> </array>
</array> </array>
</llsd> </llsd>
<llsd>
<array>
<array>
<string>saturate</string>
<real>3.0</real>
</array>
</array>
</llsd>
<llsd> <llsd>
<array> <array>
<array>
<string>linearize</string>
<real>0.01</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array> <array>
<string>contrast</string> <string>contrast</string>
<real>0.8</real> <real>0.8</real>
...@@ -13,11 +20,7 @@ ...@@ -13,11 +20,7 @@
<real>0.5</real> <real>0.5</real>
</array> </array>
<array> <array>
<string>brighten</string> <string>sepia</string>
<real>10.0</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array> </array>
</array> </array>
</llsd> </llsd>
<llsd>
<array>
<array>
<string>linearize</string>
<real>0.05</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>fade</string>
<real>4.0</real>
<real>0.5</real>
</array>
<array>
<string>sepia</string>
</array>
</array>
</llsd>
<llsd>
<array>
<array>
<string>linearize</string>
<real>0.1</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>contrast</string>
<real>0.8</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>saturate</string>
<real>1.5</real>
</array>
<array>
<string>fade</string>
<real>1.0</real>
<real>0.25</real>
</array>
<array>
<string>saturate</string>
<real>0.8</real>
</array>
<array>
<string>contrast</string>
<real>1.1</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>brighten</string>
<real>30</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
</array>
</llsd>
<llsd>
<array>
<array>
<string>linearize</string>
<real>0.1</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>contrast</string>
<real>1.1</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>fade</string>
<real>1.0</real>
<real>0.25</real>
</array>
<array>
<string>colorize</string>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
<real>0.3</real>
<real>0.2</real>
<real>0.0</real>
</array>
<array>
<string>contrast</string>
<real>1.1</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
</array>
</llsd>
<llsd>
<array>
<array>
<string>linearize</string>
<real>0.1</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>contrast</string>
<real>0.8</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
<array>
<string>colorize</string>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
<real>0.5</real>
<real>0.0</real>
<real>0.0</real>
</array>
<array>
<string>blend</string>
<real>10.0</real>
<real>0.0</real>
</array>
<array>
<string>colorize</string>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
<real>0.1</real>
<real>0.1</real>
<real>0.0</real>
</array>
</array>
</llsd>
/**
* @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;
}
}
//============================================================================
/**
* @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<LLImageFilters>
{
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<LLImageRaw> 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<LLImageFilters>;
/*virtual*/ void initSingleton();
LLImageFilters();
~LLImageFilters();
// Needed here:
// - a map of filter files with name and path
};
#endif
...@@ -98,6 +98,9 @@ def construct(self): ...@@ -98,6 +98,9 @@ def construct(self):
# ... and the entire windlight directory # ... and the entire windlight directory
self.path("windlight") self.path("windlight")
# ... and the entire image filters directory
self.path("filters")
# ... and the included spell checking dictionaries # ... and the included spell checking dictionaries
pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
if self.prefix(src=pkgdir,dst=""): if self.prefix(src=pkgdir,dst=""):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment