更改alpha值

@param srcInput   图像输入
@param destOutput 图像输出
@param alpha      要设置的alpha值
@param filter     alpha filter
@throws IOException IOException
166727
public static void changeAlpha(InputStream srcInput, OutputStream destOutput, byte alpha,
                                   AlphaFilter filter) throws IOException {
        //加载图片
        log.debug("开始加载图片");
        BufferedImage old = ImageIO.read(srcInput);
        log.debug("图片加载完毕，开始改变图片的alpha值");

        //使用32位深带alpha通道模式
        BufferedImage bufferedImage = new BufferedImage(old.getWidth(), old.getHeight(),
            BufferedImage.TYPE_4BYTE_ABGR);

        if (filter == null) {
            filter = (x, y, rgb) -> true;
        }

        // 循环每一个像素点，改变像素点的Alpha值
        for (int x = 0; x < bufferedImage.getWidth(); x++) {
            for (int y = 0; y < bufferedImage.getHeight(); y++) {
                int rgb = old.getRGB(x, y);
                if (filter.filter(x, y, rgb)) {
                    //设置alpha值
                    rgb = (alpha << 24) | (rgb & 0x00ffffff);
                }
                bufferedImage.setRGB(x, y, rgb);
            }
        }
        log.debug("图片aphasia值更改完毕");
        // 生成图片为PNG
        ImageIO.write(bufferedImage, "png", destOutput);
    }
285601
public static void changeAlpha(String oldPath, String newPath, byte alpha) throws IOException {
        changeAlpha(new FileInputStream(oldPath), new FileOutputStream(newPath), alpha);
    }
1042849
function (h, op) {
    if (typeof op !== "undefined") {
      h.style.opacity = op;
    }
    if (typeof h.style.opacity !== "undefined" && h.style.opacity !== "") {
      h.style.filter = "alpha(opacity=" + (h.style.opacity * 100) + ")";
    }
  }
956969
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException
    {
        try
        {
            // invoke the wrapped filter
            if (_filterState == FILTER_STATE_AVAILABLE)
            {
            	nServicing.incrementAndGet();
            	try
            	{  
            	    if (request.isAsyncSupported()){
            	        //141092
            	        boolean isAsyncSupported = this._filterConfig.isAsyncSupported();
            	        if (!isAsyncSupported){
            	            WebContainerRequestState reqState = WebContainerRequestState.getInstance(true);
            	            if (reqState != null) {
            	                reqState.setAttribute("resourceNotSupportAsync", "filter[ "+ this._filterName +" ]");
            	            }
            	        }
            	        //141092
            	        ServletUtil.unwrapRequest(request).setAsyncSupported(isAsyncSupported);
            	    }
            	    
            	    // LIDB-3598: begin
            	    //_filterInstance.doFilter(request, response, chain);
            	    if(_eventSource != null && _eventSource.hasFilterInvocationListeners()){
            	        FilterInvocationEvent event = getFilterInvocationEvent(request);
            	        _eventSource.onFilterStartDoFilter(event);
            	        _filterInstance.doFilter(request, response, chain);
            	        _eventSource.onFilterFinishDoFilter(event);
            	    }
            	    else{
            	        _filterInstance.doFilter(request, response, chain);
            	    }
            	    // LIDB-3598: end

            	}
            	catch (ServletException se)
            	{
            		throw se;
            	}
            	catch (IOException ioe)    //174668 
                {
                    throw ioe;
                }                          //174668
            	catch (Throwable th)
            	{
            		throw th;
            	}
            	finally
            	{
            		nServicing.decrementAndGet();
            	}
            }
            else
            {
                throw new ServletException(MessageFormat.format("Filter [{0}]: filter is unavailable.", new Object[] {_filterName}));
            }
        }
        catch (ServletException se)
        {
            if(_eventSource != null && _eventSource.hasFilterErrorListeners()){
                FilterErrorEvent errorEvent = getFilterErrorEvent(se);
                _eventSource.onFilterDoFilterError(errorEvent);
            }
            //start 140014
            if(_filterState != FILTER_STATE_DESTROYING && _filterState != FILTER_STATE_DESTROYED)
                com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(se, "com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter", "144", this);
            else if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
                logger.logp(Level.FINE, CLASS_NAME, "doFilter", "Can not invoke filter because application is destroyed", se);
            //end 140014
            throw se;
        }
        catch (RuntimeException re){
            throw re;
        }
        catch (FileNotFoundException fnfe) {
            //same as throwable without traces
            if(_eventSource != null && _eventSource.hasFilterErrorListeners()){
                FilterErrorEvent errorEvent = getFilterErrorEvent(fnfe);
                _eventSource.onFilterDoFilterError(errorEvent);
            }
            throw new ServletException(fnfe);
        }
        catch (IOException ioe){                //174668            
            if((com.ibm.ws.webcontainer.osgi.WebContainer.getServletContainerSpecLevel() >= 31) 
                            && ioe.getMessage()!=null 
                            && ioe.getMessage().contains("SRVE0918E")){
                throw ioe;
            }
            if(_eventSource != null && _eventSource.hasFilterErrorListeners()){
                FilterErrorEvent errorEvent = getFilterErrorEvent(ioe);
                _eventSource.onFilterDoFilterError(errorEvent);
            }
            
            com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(ioe, "com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter", "260", this);
            
            if (com.ibm.ws.webcontainer.osgi.WebContainer.getServletContainerSpecLevel() >= 31 )
            {
                if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
                    logger.logp(Level.FINE, CLASS_NAME, "doFilter", "rethrow IOE", ioe);
                throw ioe;
            }
            else // to prevent regression for servlet 3.0..same as Throwable() below
            {
                if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
                    logger.logp(Level.FINE, CLASS_NAME, "doFilter", "wrap IOE with ServletException", ioe );
                throw new ServletException(ioe);
            }
            
        }                               //174668
        catch (Throwable th)
        {
            logger.logp(Level.SEVERE, CLASS_NAME, "service", "uncaught.filter.exception", new Object[] {_filterName, th});
            if(_eventSource != null && _eventSource.hasFilterErrorListeners()){
                FilterErrorEvent errorEvent = getFilterErrorEvent(th);
                _eventSource.onFilterDoFilterError(errorEvent);
            }
            com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(th, "com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter", "149", this);
            throw new ServletException(th);
        }

    }
1002674
private static void parseFilters(final FilterType filterType, final WebApp webApp) {
		final WebAppFilter filter = new WebAppFilter();
		if (filterType.getFilterName() != null) {
			filter.setFilterName(filterType.getFilterName().getValue());
		}
		if (filterType.getFilterClass() != null) {
			filter.setFilterClass(filterType.getFilterClass().getValue());
		}

		if (filterType.getAsyncSupported() != null) {
			filter.setAsyncSupported(filterType.getAsyncSupported().isValue());
		}

		webApp.addFilter(filter);
		List<ParamValueType> initParams = filterType.getInitParam();
		if (initParams != null && initParams.size() > 0) {
			for (ParamValueType initParamElement : initParams) {
				final WebAppInitParam initParam = new WebAppInitParam();
				initParam.setParamName(initParamElement.getParamName().getValue());
				initParam.setParamValue(initParamElement.getParamValue().getValue());
				filter.addInitParam(initParam);
			}
		}

		List<DescriptionType> description = filterType.getDescription();
		for (DescriptionType descriptionType : description) {
			filter.addDispatcherType(DispatcherType.valueOf(descriptionType.getValue()));
		}
	}
1292849
function BrotliFilter(inputNode, options) {
    if (!(this instanceof BrotliFilter))
        return new BrotliFilter(inputNode, options);

    options = options || {};

    this.brotliOptions = {
        mode: options.mode || 0,
        quality: options.quality || 11,
        lgwin: options.lgwin || 22,
        lgblock: options.lgblock || 0
    };
    this.keepUncompressed = options.keepUncompressed;
    this.appendSuffix = (options.hasOwnProperty('appendSuffix') ?
                         options.appendSuffix :
                         true);

    // Default file encoding is raw to handle binary files
    this.inputEncoding = options.inputEncoding || null;
    this.outputEncoding = options.outputEncoding || null;

    if (this.keepUncompressed && !this.appendSuffix) {
        throw new Error('Cannot keep uncompressed files without appending suffix. Filenames would be the same.');
    }

    Filter.call(this, inputNode, options);
}
248446
@TargetApi(11)
    public void setStatusBarAlpha(float alpha) {
        if (mStatusBarAvailable && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            mStatusBarTintView.setAlpha(alpha);
        }
    }
1050950
public static void setInputSlicePredicate(Configuration conf, SlicePredicate predicate)
    {
        conf.set(INPUT_PREDICATE_CONFIG, thriftToString(predicate));
    }
534666
public void dimAt(float alpha) {
        if (!mDimEnabled) {
            return;
        }
        if (mDimView == null) {
            mDimView = makeDimView();
        }
        if (!mDimView.isShown()) {
            mDimView.setVisibility(VISIBLE);
            mDimView.setBackgroundColor(mDimColor);
        }
        mDimView.setAlpha(alpha);
    }
645007
public void checkSkipReadForFixLengthPart(AbstractPagedInputView source) throws IOException {
		// skip if there is no enough size.
		// Note: Use currentSegmentLimit instead of segmentSize.
		int available = source.getCurrentSegmentLimit() - source.getCurrentPositionInSegment();
		if (available < getSerializedRowFixedPartLength()) {
			source.advance();
		}
	}
678523
public void setPointerAlpha(int alpha) {
        if (alpha >= 0 && alpha <= 255) {
            mPointerAlpha = alpha;
            mPointerHaloPaint.setAlpha(mPointerAlpha);
            invalidate();
        }
    }
1281079
public static void copyDirToDir(File source, File dest, FilenameFilter filter) throws IOException {
        if (!source.isDirectory() || !dest.isDirectory()) {
            return;
        }

        List<File> files = listFiles(source, filter, true);
        String sourcePath = source.getAbsolutePath();
        String destPath = dest.getAbsolutePath();
        for (File file : files) {
            String filePath = file.getAbsolutePath();
            if (sourcePath.equals(filePath)) {
                continue;
            }
            String newPath = destPath + File.separator + filePath.substring(sourcePath.length());
            File destFile = new File(newPath);
            if (file.isDirectory()) {
                destFile.mkdirs();
            } else {
                copy(file, destFile);
            }
        }
    }
986245
public static void pressImage(File srcImageFile, File destImageFile, Image pressImg, int x, int y, float alpha) {
		pressImage(read(srcImageFile), destImageFile, pressImg, x, y, alpha);
	}
290179
@Override
    public void addSourceTargetSet(UnicodeSet inputFilter, UnicodeSet sourceSet, UnicodeSet targetSet) {
        UnicodeSet myFilter = getFilterAsUnicodeSet(inputFilter);
        if (myFilter.size() > 0) {
            sourceSet.addAll(myFilter);
            targetSet.addAll('0', '9')
            .addAll('A', 'Z')
            .add('-')
            .add(' ')
            .addAll(OPEN_DELIM)
            .add(CLOSE_DELIM)
            .addAll('a', 'z') // for controls
            .add('<').add('>') // for controls
            .add('(').add(')') // for controls
            ;
        }
    }
1109750
void filterTree(String filter) {

        HierarchicalContainer container = (HierarchicalContainer)m_tree.getContainerDataSource();
        container.removeAllContainerFilters();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
            final String lowerCaseFilter = filter.toLowerCase();
            container.addContainerFilter(new Filter() {

                private static final long serialVersionUID = 1L;

                public boolean appliesToProperty(Object propertyId) {

                    return true;
                }

                public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException {

                    CmsCategory cat = (CmsCategory)itemId;

                    return cat.getPath().toLowerCase().contains(lowerCaseFilter)
                        || ((cat.getTitle() != null) && cat.getTitle().toLowerCase().contains(lowerCaseFilter));
                }
            });
        }
    }
651183
public void updateFilter(String filter) {
    if (isInitialized) {
      LynxConfig lynxConfig = lynx.getConfig();
      lynxConfig.setFilter(filter);
      lynx.setConfig(lynxConfig);
      clearView();
      restartLynx();
    }
  }
497428
public boolean alphaNum(TextProvider textProvider)
        
    {
        clearLastToken(textProvider);
        clearLeadingSpaces(textProvider);
        mark(textProvider);
        if (m_debug)
			debug("testing",textProvider);
        StringBuilder sb = new StringBuilder();
        while (true)
        {
            char c = getNextChar(textProvider);

            if (!Character.isLetterOrDigit(c)) break;
            remark(textProvider);
            sb.append(c);
        }
        reset(textProvider); // removes last char
        if (sb.toString().length() == 0) return false;
        textProvider.setLastToken(sb.toString());
        debug(textProvider);
        return true;
    }