更改图片的alpha值

@param srcInput   图像输入
@param destOutput 图像输出
@param alpha      要设置的alpha值
@throws IOException IOException
169256
public static void changeAlpha(InputStream srcInput, OutputStream destOutput,
                                   byte alpha) throws IOException {
        changeAlpha(srcInput, destOutput, alpha, null);
    }
733908
public final void setA(double alpha, int x, int y){
        int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
        int idx = x + y * width;
        int tmpR = pixels[idx] >> 16 & 0x000000ff;
        int tmpG = pixels[idx] >> 8  & 0x000000ff;
        int tmpB = pixels[idx]       & 0x000000ff;
        pixels[idx] = (int)alpha << 24 |
                            tmpR << 16 |
                            tmpG << 8  |
                            tmpB;
    }
1342528
protected void renderInputBegin(FacesContext facesContext,
            UIComponent uiComponent) throws IOException
    {
        ResponseWriter writer = facesContext.getResponseWriter();
        
        writer.startElement(HTML.INPUT_ELEM, uiComponent);
        writer.writeAttribute(HTML.TYPE_ATTR, org.apache.myfaces.shared.renderkit.html.HTML.INPUT_TYPE_PASSWORD, null);

        if (uiComponent instanceof ClientBehaviorHolder
                && !((ClientBehaviorHolder) uiComponent).getClientBehaviors().isEmpty())
        {
            writer.writeAttribute(HTML.ID_ATTR, 
                                  uiComponent.getClientId(facesContext), null);
        }
        else
        {
            HtmlRendererUtils.writeIdIfNecessary(writer, uiComponent, facesContext);
        }
        writer.writeAttribute(HTML.NAME_ATTR,
                              uiComponent.getClientId(facesContext), null);

        boolean isRedisplay;
        if (uiComponent instanceof HtmlInputSecret)
        {
            isRedisplay = ((HtmlInputSecret)uiComponent).isRedisplay();
        }
        else
        {
            isRedisplay = org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent, 
                    JSFAttr.REDISPLAY_ATTR, false);
        }
        if (isRedisplay)
        {
            String strValue = RendererUtils.getStringValue(facesContext, uiComponent);
            writer.writeAttribute(HTML.VALUE_ATTR, strValue, JSFAttr.VALUE_ATTR);
        }

        Map<String, List<ClientBehavior>> behaviors = null;
        if (uiComponent instanceof ClientBehaviorHolder)
        {
            behaviors = ((ClientBehaviorHolder) uiComponent).getClientBehaviors();
            
            long commonPropertiesMarked = 0L;
            if (isCommonPropertiesOptimizationEnabled(facesContext))
            {
                commonPropertiesMarked = CommonPropertyUtils.getCommonPropertiesMarked(uiComponent);
            }
            if (behaviors.isEmpty() && isCommonPropertiesOptimizationEnabled(facesContext))
            {
                CommonPropertyUtils.renderChangeEventProperty(writer, 
                        commonPropertiesMarked, uiComponent);
                CommonPropertyUtils.renderEventProperties(writer, 
                        commonPropertiesMarked, uiComponent);
                CommonPropertyUtils.renderFieldEventPropertiesWithoutOnchange(writer, 
                        commonPropertiesMarked, uiComponent);
            }
            else
            {
                HtmlRendererUtils.renderBehaviorizedOnchangeEventHandler(facesContext, writer, uiComponent, behaviors);
                if (isCommonEventsOptimizationEnabled(facesContext))
                {
                    Long commonEventsMarked = CommonEventUtils.getCommonEventsMarked(uiComponent);
                    CommonEventUtils.renderBehaviorizedEventHandlers(facesContext, writer, 
                            commonPropertiesMarked, commonEventsMarked, uiComponent, behaviors);
                    CommonEventUtils.renderBehaviorizedFieldEventHandlersWithoutOnchange(
                        facesContext, writer, commonPropertiesMarked, commonEventsMarked, uiComponent, behaviors);
                }
                else
                {
                    HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, uiComponent, behaviors);
                    HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchange(
                            facesContext, writer, uiComponent, behaviors);
                }
            }
            if (isCommonPropertiesOptimizationEnabled(facesContext))
            {
                CommonPropertyUtils.renderInputPassthroughPropertiesWithoutDisabledAndEvents(writer, 
                        commonPropertiesMarked, uiComponent);
            }
            else
            {
                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, 
                        HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
            }
        }
        else
        {
            if (isCommonPropertiesOptimizationEnabled(facesContext))
            {
                CommonPropertyUtils.renderInputPassthroughPropertiesWithoutDisabled(writer, 
                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
            }
            else
            {
                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, 
                        HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
            }
        }

        if (isDisabled(facesContext, uiComponent))
        {
            writer.writeAttribute(HTML.DISABLED_ATTR, Boolean.TRUE, null);
        }

        if (isAutocompleteOff(facesContext, uiComponent))
        {
            writer.writeAttribute(HTML.AUTOCOMPLETE_ATTR, AUTOCOMPLETE_VALUE_OFF, HTML.AUTOCOMPLETE_ATTR);
        }
    }
963662
private void read(final DataInput pInput) throws IOException {
        byte[] bytes = new byte[64];
        pInput.readFully(bytes);

        // NOTE: Length is in bytes, including the null-terminator...
        int nameLength = pInput.readShort();
        name = new String(bytes, 0, nameLength - 2, Charset.forName("UTF-16LE"));
//        System.out.println("name: " + name);

        type = pInput.readByte();
//        System.out.println("type: " + type);

        nodeColor = pInput.readByte();
//        System.out.println("nodeColor: " + nodeColor);

        prevDId = pInput.readInt();
//        System.out.println("prevDId: " + prevDId);
        nextDId = pInput.readInt();
//        System.out.println("nextDId: " + nextDId);
        rootNodeDId = pInput.readInt();
//        System.out.println("rootNodeDId: " + rootNodeDId);

        // UID (16) + user flags (4), ignored
        if (pInput.skipBytes(20) != 20) {
            throw new CorruptDocumentException();
        }

        createdTimestamp = CompoundDocument.toJavaTimeInMillis(pInput.readLong());
        modifiedTimestamp = CompoundDocument.toJavaTimeInMillis(pInput.readLong());

        startSId = pInput.readInt();
//        System.out.println("startSId: " + startSId);
        streamSize = pInput.readInt();
//        System.out.println("streamSize: " + streamSize);

        // Reserved
        pInput.readInt();
    }
413519
@Override
    public ImageHeader readHeader(InputStream input) throws IOException
    {
        checkSkippedError(input.skip(2), 2);
        int current = input.read();
        while (255 == current)
        {
            final int marker = input.read();
            final int len = readInt(input, 2, true);
            if (MARKER_1 == marker || MARKER_2 == marker || MARKER_3 == marker)
            {
                final long skipped = input.skip(1);
                checkSkippedError(skipped, 1);
                final int height = readInt(input, 2, true);
                final int width = readInt(input, 2, true);
                final ImageFormat format = ImageFormat.JPG;

                return new ImageHeaderModel(width, height, format);
            }
            final long skipped = input.skip(len - 2L);
            checkSkippedError(skipped, len - 2);
            current = input.read();
        }
        throw new IOException(ERROR_JPG);
    }
743266
public int readFrom(ByteBuffer src, long destOffset) {
        if (src.remaining() + destOffset >= size())
            throw new BufferOverflowException();
        int readLen = src.remaining();
        ByteBuffer b = toDirectByteBuffer(destOffset, readLen);
        b.position(0);
        b.put(src);
        return readLen;
    }
94659
private static void closeStreams( InputStream src, OutputStream dest )
    {
        try
        {
            src.close();
        }
        catch( IOException e )
        {
            e.printStackTrace();
        }

        try
        {
            dest.close();
        }
        catch( IOException e )
        {
            e.printStackTrace();
        }
    }
569669
def SetAlpha(self, alpha):
        '''
        
        '''
        self._AlphaChannel = alpha
        if self._AlphaChannel is not None:
            self.QT_QMainWindow.setWindowOpacity(self._AlphaChannel)
959762
private static long asciidump(InputStream is, PrintWriter pw) throws Exception
   {
      byte[] buffer = new byte[BUFFER_SIZE];
      long byteCount = 0;

      char c;
      int loop;
      int count;
      StringBuilder sb = new StringBuilder();

      while (true)
      {
         count = is.read(buffer);
         if (count == -1)
         {
            break;
         }

         byteCount += count;

         sb.setLength(0);
         for (loop = 0; loop < count; loop++)
         {
            c = (char) buffer[loop];
            if (c > 200 || c < 27)
            {
               c = ' ';
            }

            sb.append(c);
         }

         pw.print(sb.toString());
      }

      return (byteCount);
   }
660969
static ByteBuffer unescapeBytes(final CharSequence input)
    {
        int pos = 0, len = input.length();
        final byte[] result = new byte[len];
        ByteBuffer buffer = ByteBuffer.wrap(result);
        for (int i = 0; i < len; i++)
        {
            char c = input.charAt(i);
            if (c == '\\')
            {
                if (i + 1 < len)
                {
                    ++i;
                    c = input.charAt(i);
                    if (isOctal(c))
                    {
                        // Octal escape.
                        int code = digitValue(c);
                        if (i + 1 < len && isOctal(input.charAt(i + 1)))
                        {
                            ++i;
                            code = code * 8 + digitValue(input.charAt(i));
                        }
                        if (i + 1 < len && isOctal(input.charAt(i + 1)))
                        {
                            ++i;
                            code = code * 8 + digitValue(input.charAt(i));
                        }
                        result[pos++] = (byte) code;
                    }
                    else
                    {
                        switch (c)
                        {
                            case 'a':
                                result[pos++] = 0x07;
                                break;
                            case 'b':
                                result[pos++] = '\b';
                                break;
                            case 'f':
                                result[pos++] = '\f';
                                break;
                            case 'n':
                                result[pos++] = '\n';
                                break;
                            case 'r':
                                result[pos++] = '\r';
                                break;
                            case 't':
                                result[pos++] = '\t';
                                break;
                            case 'v':
                                result[pos++] = 0x0b;
                                break;
                            case '\\':
                                result[pos++] = '\\';
                                break;
                            case '\'':
                                result[pos++] = '\'';
                                break;
                            case '"':
                                result[pos++] = '\"';
                                break;

                            case 'x':
                                // hex escape
                                int code = 0;
                                if (i + 1 < len && isHex(input.charAt(i + 1)))
                                {
                                    ++i;
                                    code = digitValue(input.charAt(i));
                                }
                                else
                                {
                                    throw new InvalidEscapeSequenceException(
                                            "Invalid escape sequence: '\\x' with no digits");
                                }
                                if (i + 1 < len && isHex(input.charAt(i + 1)))
                                {
                                    ++i;
                                    code = code * 16 + digitValue(input.charAt(i));
                                }
                                result[pos++] = (byte) code;
                                break;

                            default:
                                throw new InvalidEscapeSequenceException(
                                        "Invalid escape sequence: '\\" + c + '\'');
                        }
                    }
                }
                else
                {
                    throw new InvalidEscapeSequenceException(
                            "Invalid escape sequence: '\\' at end of string.");
                }
            }
            else
            {
                result[pos++] = (byte) c;
            }
        }
        buffer.limit(pos);
        return buffer;
    }
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);
    }
696650
public void preconfigureInput(InputComponent<?, ?> input, WithAttributes atts)
   {
      if (atts != null)
      {
         input.setEnabled(atts.enabled());
         input.setLabel(atts.label());
         input.setRequired(atts.required());
         input.setRequiredMessage(atts.requiredMessage());
         input.setDescription(atts.description());
         input.setDeprecated(atts.deprecated());
         input.setDeprecatedMessage(atts.deprecatedMessage());

         // Set input type
         if (!InputType.DEFAULT.equals(atts.type()))
         {
            input.getFacet(HintsFacet.class).setInputType(atts.type());
         }

         // Set Default Value
         if (!atts.defaultValue().isEmpty())
         {
            InputComponents.setDefaultValueFor(converterFactory, (InputComponent<?, Object>) input,
                     atts.defaultValue());
         }
         // Set Note
         if (!atts.note().isEmpty())
         {
            input.setNote(atts.note());
         }
      }
   }
744267
public void copyBufferStateFrom(WstxInputData src)
    {
        mInputBuffer = src.mInputBuffer;
        mInputPtr = src.mInputPtr;
        mInputEnd = src.mInputEnd;

        mCurrInputProcessed = src.mCurrInputProcessed;
        mCurrInputRow = src.mCurrInputRow;
        mCurrInputRowStart = src.mCurrInputRowStart;
    }
1256697
protected void moskitoDoPut(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		super.doPut(req, res);
	}
1216757
public void toWEBP(File src, File dest) {
        try {
            String command = commandDir + (src.getName().endsWith(".gif") ? "/gif2webp " : "/cwebp ") + src.getPath() + " -o " + dest.getPath();
            this.executeCommand(command);
        } catch (Exception e) {
            throw new WebpIOException(e);
        }
    }
1296732
def SetAlpha(self, alpha):
        '''
        
        '''
        self._AlphaChannel = alpha
        self.TKroot.attributes('-alpha', alpha)
697122
private void getConnInput() throws IOException
  {
    if (_didGet)
      return;

    try {
      getConnInputImpl();
    } catch (IOException e) {
      _isKeepalive = false;
      throw e;
    } catch (RuntimeException e) {
      _isKeepalive = false;
      throw e;
    }
  }