summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-01-16 18:34:51 -0800
committerMerov Linden <merov@lindenlab.com>2014-01-16 18:34:51 -0800
commitfda7b94f490564568dee0ba6d6516943b0fd82a0 (patch)
tree15bd248eee608856779ddc42cf88f384392792d2 /indra/llimage
parent91f401fa2de8c78da7c83561501a1be993588867 (diff)
ACME-1236 : Small LLImageFilter clean up
Diffstat (limited to 'indra/llimage')
-rwxr-xr-xindra/llimage/llimagefilter.cpp33
-rwxr-xr-xindra/llimage/llimagefilter.h6
2 files changed, 13 insertions, 26 deletions
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
index 5c969001b7..cd03454cdd 100755
--- a/indra/llimage/llimagefilter.cpp
+++ b/indra/llimage/llimagefilter.cpp
@@ -39,7 +39,7 @@
// LLImageFilter
//---------------------------------------------------------------------------
-LLImageFilter::LLImageFilter() :
+LLImageFilter::LLImageFilter(const std::string& file_path) :
mFilterData(LLSD::emptyArray()),
mImage(NULL),
mHistoRed(NULL),
@@ -50,6 +50,15 @@ LLImageFilter::LLImageFilter() :
mVignetteGamma(1.0),
mVignetteMin(0.0)
{
+ // Load filter description from file
+ llifstream filter_xml(file_path);
+ if (filter_xml.is_open())
+ {
+ // Load and parse the file
+ LLPointer<LLSDParser> parser = new LLSDXMLParser();
+ parser->parse(filter_xml, mFilterData, LLSDSerialize::SIZE_UNLIMITED);
+ filter_xml.close();
+ }
}
LLImageFilter::~LLImageFilter()
@@ -114,28 +123,6 @@ LLImageFilter::~LLImageFilter()
*/
//============================================================================
-// Load filter from file
-//============================================================================
-
-void LLImageFilter::loadFromFile(const std::string& file_path)
-{
- //std::cout << "Loading filter settings from : " << file_path << std::endl;
- llifstream filter_xml(file_path);
- if (filter_xml.is_open())
- {
- // Load and parse the file
- LLPointer<LLSDParser> parser = new LLSDXMLParser();
- parser->parse(filter_xml, mFilterData, LLSDSerialize::SIZE_UNLIMITED);
- filter_xml.close();
- }
- else
- {
- // File couldn't be open, reset the filter data
- mFilterData = LLSD();
- }
-}
-
-//============================================================================
// Apply the filter data to the image passed as parameter
//============================================================================
diff --git a/indra/llimage/llimagefilter.h b/indra/llimage/llimagefilter.h
index c67789ede0..dc092a47a5 100755
--- a/indra/llimage/llimagefilter.h
+++ b/indra/llimage/llimagefilter.h
@@ -54,15 +54,15 @@ typedef enum e_screen_mode
} EScreenMode;
//============================================================================
-// Image Filter
+// LLImageFilter
+//============================================================================
class LLImageFilter
{
public:
- LLImageFilter();
+ LLImageFilter(const std::string& file_path);
~LLImageFilter();
- void loadFromFile(const std::string& file_path);
void executeFilter(LLPointer<LLImageRaw> raw_image);
private: