ACME-1315 : Fix anisotropy in filters applied to thumbnail. Deleted some unused code
parent
73c9e42faf
commit
51844473c0
|
|
@ -542,31 +542,6 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
|
|||
//============================================================================
|
||||
// Procedural Stencils
|
||||
//============================================================================
|
||||
|
||||
void LLImageFilter::setStencil(EStencilBlendMode mode, EStencilShape type, F32 gamma, F32 min, F32 max)
|
||||
{
|
||||
mStencilBlendMode = mode;
|
||||
mStencilShape = type;
|
||||
mStencilGamma = gamma;
|
||||
mStencilMin = llmin(llmax(min, -1.0f), 1.0f);
|
||||
mStencilMax = llmin(llmax(max, -1.0f), 1.0f);
|
||||
|
||||
// We center the vignette on the image and fits it in the image smallest dimension
|
||||
mStencilCenterX = mImage->getWidth()/2;
|
||||
mStencilCenterY = mImage->getHeight()/2;
|
||||
mStencilWidth = llmin(mImage->getWidth()/2,mImage->getHeight()/2);
|
||||
|
||||
mStencilWavelength = gamma;
|
||||
mStencilSine = 0.0;
|
||||
mStencilCosine = 1.0;
|
||||
|
||||
mStencilStartX = 0.0;
|
||||
mStencilStartY = 0.0;
|
||||
mStencilGradX = 0.0;
|
||||
mStencilGradY = (F32)(mImage->getHeight());
|
||||
mStencilGradN = (F32)(mImage->getHeight()*mImage->getHeight());
|
||||
}
|
||||
|
||||
void LLImageFilter::setStencil(EStencilShape shape, EStencilBlendMode mode, F32 min, F32 max, F32* params)
|
||||
{
|
||||
mStencilShape = shape;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ private:
|
|||
void convolve(const LLMatrix3 &kernel, bool normalize, bool abs_value);
|
||||
|
||||
// Procedural Stencils
|
||||
void setStencil(EStencilBlendMode mode, EStencilShape type, F32 gamma, F32 min, F32 max);
|
||||
void setStencil(EStencilShape shape, EStencilBlendMode mode, F32 min, F32 max, F32* params);
|
||||
F32 getStencilAlpha(S32 i, S32 j);
|
||||
|
||||
|
|
|
|||
|
|
@ -556,10 +556,8 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
|
|||
mPreviewImage->getHeight(),
|
||||
mPreviewImage->getComponents());
|
||||
raw->copy(mPreviewImage);
|
||||
// Scale to the thumbnal size modulo a power of 2
|
||||
S32 width = LLImageRaw::expandDimToPowerOfTwo(mThumbnailWidth,MAX_IMAGE_SIZE);
|
||||
S32 height = LLImageRaw::expandDimToPowerOfTwo(mThumbnailHeight,MAX_IMAGE_SIZE);
|
||||
if (!raw->scale(width, height))
|
||||
// Scale to the thumbnail size
|
||||
if (!raw->scale(mThumbnailWidth, mThumbnailHeight))
|
||||
{
|
||||
raw = NULL ;
|
||||
}
|
||||
|
|
@ -575,15 +573,12 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
|
|||
{
|
||||
raw = NULL ;
|
||||
}
|
||||
else
|
||||
{
|
||||
raw->expandToPowerOfTwo();
|
||||
}
|
||||
}
|
||||
|
||||
if (raw)
|
||||
{
|
||||
// Filter the thumbnail
|
||||
// Note: filtering needs to be done *before* the scaling to power of 2 or the effect is distorted
|
||||
if (getFilter() != "")
|
||||
{
|
||||
std::string filter_path = LLImageFiltersManager::getInstance()->getFilterPath(getFilter());
|
||||
|
|
@ -597,6 +592,8 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
|
|||
llwarns << "Couldn't find a path to the following filter : " << getFilter() << llendl;
|
||||
}
|
||||
}
|
||||
// Scale to a power of 2 so it can be mapped to a texture
|
||||
raw->expandToPowerOfTwo();
|
||||
mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
|
||||
mThumbnailUpToDate = TRUE ;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue