From f1229912280fe67b272f5c1ba424524d738ed867 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 15 Jan 2014 09:24:06 -0800 Subject: ACME-1236 : Add comments to LLImageFilter --- indra/llimage/llimagefilter.cpp | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'indra/llimage') diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp index ed97d9ae17..5c969001b7 100755 --- a/indra/llimage/llimagefilter.cpp +++ b/indra/llimage/llimagefilter.cpp @@ -62,6 +62,34 @@ LLImageFilter::~LLImageFilter() } /* + *TODO + * Rename vignette to stencil + * Separate shape from mode + * Add shapes : uniform and gradients + * Add modes + * Add stencil (min,max) range + * Suppress alpha from colorcorrect and use uniform alpha instead + * Refactor stencil composition in the filter primitives + + + stencil + shape + blend_mode + min + max + param1 + param2 + param3 + param4 + + + vignette : center_x, center_y, width, feather + sine : wavelength, angle + flat + gradient : start_x, start_y, end_x, end_y + + * Document all the admissible names in the wiki + " Apply the filter to the input images using the optional value. Admissible names:\n" " - 'grayscale' converts to grayscale (no param).\n" " - 'sepia' converts to sepia (no param).\n" @@ -85,7 +113,10 @@ LLImageFilter::~LLImageFilter() " - 'fade' : the filter is applied with full intensity in the center and fades to black to the periphery.\n" */ +//============================================================================ // Load filter from file +//============================================================================ + void LLImageFilter::loadFromFile(const std::string& file_path) { //std::cout << "Loading filter settings from : " << file_path << std::endl; @@ -104,7 +135,10 @@ void LLImageFilter::loadFromFile(const std::string& file_path) } } +//============================================================================ // Apply the filter data to the image passed as parameter +//============================================================================ + void LLImageFilter::executeFilter(LLPointer raw_image) { mImage = raw_image; @@ -203,7 +237,10 @@ void LLImageFilter::executeFilter(LLPointer raw_image) } } +//============================================================================ // Filter Primitives +//============================================================================ + void LLImageFilter::colorCorrect(const U8* lut_red, const U8* lut_green, const U8* lut_blue) { const S32 components = mImage->getComponents(); @@ -353,7 +390,10 @@ void LLImageFilter::filterScreen(EScreenMode mode, const S32 wave_length, const } } +//============================================================================ // Procedural Stencils +//============================================================================ + void LLImageFilter::setVignette(EVignetteMode mode, EVignetteType type, F32 gamma, F32 min) { mVignetteMode = mode; @@ -386,7 +426,10 @@ F32 LLImageFilter::getVignetteAlpha(S32 i, S32 j) return (mVignetteMin + alpha * (1.0 - mVignetteMin)); } +//============================================================================ // Histograms +//============================================================================ + U32* LLImageFilter::getBrightnessHistogram() { if (!mHistoBrightness) @@ -444,7 +487,10 @@ void LLImageFilter::computeHistograms() } } +//============================================================================ // Secondary Filters +//============================================================================ + void LLImageFilter::filterGrayScale() { LLMatrix3 gray_scale; -- cgit v1.2.3