当前位置: 首页>>代码示例>>Java>>正文


Java TexturePaint.getImage方法代码示例

本文整理汇总了Java中java.awt.TexturePaint.getImage方法的典型用法代码示例。如果您正苦于以下问题:Java TexturePaint.getImage方法的具体用法?Java TexturePaint.getImage怎么用?Java TexturePaint.getImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.TexturePaint的用法示例。


在下文中一共展示了TexturePaint.getImage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTexturePaint

import java.awt.TexturePaint; //导入方法依赖的package包/类
protected Element createTexturePaint( TexturePaint paint, String imgId,
		boolean highlight )
{
	Element elem = dom.createElement( "pattern" ); //$NON-NLS-1$
	if ( highlight )
		elem.setAttribute( "id", getTextureId( paint ) + "h" ); //$NON-NLS-1$ //$NON-NLS-2$
	else
		elem.setAttribute( "id", getTextureId( paint ) ); //$NON-NLS-1$
	
	BufferedImage img = paint.getImage( );
	int width = img.getWidth( );
	int height = img.getHeight( );
	elem.setAttribute( "patternUnits", "userSpaceOnUse" );  //$NON-NLS-1$//$NON-NLS-2$
	elem.setAttribute( "width", Integer.toString( width ) ); //$NON-NLS-1$
	elem.setAttribute( "height", Integer.toString( height ) ); //$NON-NLS-1$

	Element elemUse = dom.createElement( "use" ); //$NON-NLS-1$
	elemUse.setAttribute( "x", "0" );  //$NON-NLS-1$//$NON-NLS-2$
	elemUse.setAttribute( "y", "0" );  //$NON-NLS-1$//$NON-NLS-2$
	elemUse.setAttribute( "xlink:href", "#" + imgId );  //$NON-NLS-1$//$NON-NLS-2$
	
	elem.appendChild( elemUse );
	return elem;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:25,代码来源:SVGGraphics2D.java

示例2: addTexturePaint

import java.awt.TexturePaint; //导入方法依赖的package包/类
private void addTexturePaint(Entry e) throws IOException {
    TexturePaint tp = (TexturePaint) e.paint;

    // open the pattern stream that also holds the inlined picture
    PDFStream pattern = pdf.openStream(e.name, null); // image is encoded.
    pattern.entry("Type", pdf.name("Pattern"));
    pattern.entry("PatternType", 1);
    pattern.entry("PaintType", 1);
    BufferedImage image = tp.getImage();
    pattern.entry("TilingType", 1);
    double width = tp.getAnchorRect().getWidth();
    double height = tp.getAnchorRect().getHeight();
    double offsX = tp.getAnchorRect().getX();
    double offsY = tp.getAnchorRect().getY();
    pattern.entry("BBox", new double[] { 0, 0, width, height });
    pattern.entry("XStep", width);
    pattern.entry("YStep", height);
    PDFDictionary resources = pattern.openDictionary("Resources");
    resources.entry("ProcSet", new Object[] { pdf.name("PDF"),
            pdf.name("ImageC") });
    pattern.close(resources);
    setMatrix(pattern, e, offsX, offsY);

    // scale the tiling image to the correct size
    pattern.matrix(width, 0, 0, -height, 0, height);

    pattern.inlineImage(image, null, e.writeAs);
    pdf.close(pattern);
}
 
开发者ID:phuseman,项目名称:r2cat,代码行数:30,代码来源:PDFPaintDelayQueue.java

示例3: setTexturePaint

import java.awt.TexturePaint; //导入方法依赖的package包/类
/**
 * We use OpenGL's texture coordinate generator to automatically
 * map the TexturePaint image to the geometry being rendered.  The
 * generator uses two separate plane equations that take the (x,y)
 * location (in device space) of the fragment being rendered to
 * calculate (u,v) texture coordinates for that fragment:
 *     u = Ax + By + Cz + Dw
 *     v = Ex + Fy + Gz + Hw
 *
 * Since we use a 2D orthographic projection, we can assume that z=0
 * and w=1 for any fragment.  So we need to calculate appropriate
 * values for the plane equation constants (A,B,D) and (E,F,H) such
 * that {u,v}=0 for the top-left of the TexturePaint's anchor
 * rectangle and {u,v}=1 for the bottom-right of the anchor rectangle.
 * We can easily make the texture image repeat for {u,v} values
 * outside the range [0,1] by specifying the GL_REPEAT texture wrap
 * mode.
 *
 * Calculating the plane equation constants is surprisingly simple.
 * We can think of it as an inverse matrix operation that takes
 * device space coordinates and transforms them into user space
 * coordinates that correspond to a location relative to the anchor
 * rectangle.  First, we translate and scale the current user space
 * transform by applying the anchor rectangle bounds.  We then take
 * the inverse of this affine transform.  The rows of the resulting
 * inverse matrix correlate nicely to the plane equation constants
 * we were seeking.
 */
private static void setTexturePaint(RenderQueue rq,
                                    SunGraphics2D sg2d,
                                    TexturePaint paint,
                                    boolean useMask)
{
    BufferedImage bi = paint.getImage();
    SurfaceData dstData = sg2d.surfaceData;
    SurfaceData srcData =
        dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT,
                                     CompositeType.SrcOver, null);
    boolean filter =
        (sg2d.interpolationType !=
         AffineTransformOp.TYPE_NEAREST_NEIGHBOR);

    // calculate plane equation constants
    AffineTransform at = (AffineTransform)sg2d.transform.clone();
    Rectangle2D anchor = paint.getAnchorRect();
    at.translate(anchor.getX(), anchor.getY());
    at.scale(anchor.getWidth(), anchor.getHeight());

    double xp0, xp1, xp3, yp0, yp1, yp3;
    try {
        at.invert();
        xp0 = at.getScaleX();
        xp1 = at.getShearX();
        xp3 = at.getTranslateX();
        yp0 = at.getShearY();
        yp1 = at.getScaleY();
        yp3 = at.getTranslateY();
    } catch (java.awt.geom.NoninvertibleTransformException e) {
        xp0 = xp1 = xp3 = yp0 = yp1 = yp3 = 0.0;
    }

    // assert rq.lock.isHeldByCurrentThread();
    rq.ensureCapacityAndAlignment(68, 12);
    RenderBuffer buf = rq.getBuffer();
    buf.putInt(SET_TEXTURE_PAINT);
    buf.putInt(useMask ? 1 : 0);
    buf.putInt(filter ? 1 : 0);
    buf.putLong(srcData.getNativeOps());
    buf.putDouble(xp0).putDouble(xp1).putDouble(xp3);
    buf.putDouble(yp0).putDouble(yp1).putDouble(yp3);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:72,代码来源:BufferedPaints.java

示例4: isPaintValid

import java.awt.TexturePaint; //导入方法依赖的package包/类
/**
 * Returns true if the given TexturePaint instance can be used by the
 * accelerated OGLPaints.Texture implementation.  A TexturePaint is
 * considered valid if the following conditions are met:
 *   - the texture image dimensions are power-of-two (or the
 *     GL_ARB_texture_non_power_of_two extension is present)
 *   - the texture image can be (or is already) cached in an OpenGL
 *     texture object
 */
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
    TexturePaint paint = (TexturePaint)sg2d.paint;
    OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
    BufferedImage bi = paint.getImage();

    // see if texture-non-pow2 extension is available
    if (!dstData.isTexNonPow2Available()) {
        int imgw = bi.getWidth();
        int imgh = bi.getHeight();

        // verify that the texture image dimensions are pow2
        if ((imgw & (imgw - 1)) != 0 || (imgh & (imgh - 1)) != 0) {
            return false;
        }
    }

    SurfaceData srcData =
        dstData.getSourceSurfaceData(bi,
                                     SunGraphics2D.TRANSFORM_ISIDENT,
                                     CompositeType.SrcOver, null);
    if (!(srcData instanceof OGLSurfaceData)) {
        // REMIND: this is a hack that attempts to cache the system
        //         memory image from the TexturePaint instance into an
        //         OpenGL texture...
        srcData =
            dstData.getSourceSurfaceData(bi,
                                         SunGraphics2D.TRANSFORM_ISIDENT,
                                         CompositeType.SrcOver, null);
        if (!(srcData instanceof OGLSurfaceData)) {
            return false;
        }
    }

    // verify that the source surface is actually a texture
    OGLSurfaceData oglData = (OGLSurfaceData)srcData;
    if (oglData.getType() != OGLSurfaceData.TEXTURE) {
        return false;
    }

    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:52,代码来源:OGLPaints.java

示例5: isPaintValid

import java.awt.TexturePaint; //导入方法依赖的package包/类
/**
 * Returns true if the given TexturePaint instance can be used by the
 * accelerated BufferedPaints.Texture implementation.
 *
 * A TexturePaint is considered valid if the following conditions
 * are met:
 *   - the texture image dimensions are power-of-two
 *   - the texture image can be (or is already) cached in a D3D
 *     texture object
 */
@Override
public boolean isPaintValid(SunGraphics2D sg2d) {
    TexturePaint paint = (TexturePaint)sg2d.paint;
    D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
    BufferedImage bi = paint.getImage();

    // verify that the texture image dimensions are pow2
    D3DGraphicsDevice gd =
        (D3DGraphicsDevice)dstData.getDeviceConfiguration().getDevice();
    int imgw = bi.getWidth();
    int imgh = bi.getHeight();
    if (!gd.isCapPresent(CAPS_TEXNONPOW2)) {
        if ((imgw & (imgw - 1)) != 0 || (imgh & (imgh - 1)) != 0) {
            return false;
        }
    }
    // verify that the texture image is square if it has to be
    if (!gd.isCapPresent(CAPS_TEXNONSQUARE) && imgw != imgh)
    {
        return false;
    }

    SurfaceData srcData =
        dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
                                     CompositeType.SrcOver, null);
    if (!(srcData instanceof D3DSurfaceData)) {
        // REMIND: this is a hack that attempts to cache the system
        //         memory image from the TexturePaint instance into a
        //         D3D texture...
        srcData =
            dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
                                         CompositeType.SrcOver, null);
        if (!(srcData instanceof D3DSurfaceData)) {
            return false;
        }
    }

    // verify that the source surface is actually a texture
    D3DSurfaceData d3dData = (D3DSurfaceData)srcData;
    if (d3dData.getType() != D3DSurfaceData.TEXTURE) {
        return false;
    }

    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:56,代码来源:D3DPaints.java

示例6: isPaintValid

import java.awt.TexturePaint; //导入方法依赖的package包/类
/**
 * Returns true if the given TexturePaint instance can be used by the
 * accelerated BufferedPaints.Texture implementation.
 *
 * A TexturePaint is considered valid if the following conditions
 * are met:
 *   - the texture image dimensions are power-of-two
 *   - the texture image can be (or is already) cached in a D3D
 *     texture object
 */
@Override
public boolean isPaintValid(SunGraphics2D sg2d) {
    TexturePaint paint = (TexturePaint)sg2d.paint;
    D3DSurfaceData dstData = (D3DSurfaceData)sg2d.surfaceData;
    BufferedImage bi = paint.getImage();

    // verify that the texture image dimensions are pow2
    D3DGraphicsDevice gd =
        (D3DGraphicsDevice)dstData.getDeviceConfiguration().getDevice();
    int imgw = bi.getWidth();
    int imgh = bi.getHeight();
    if (!gd.isCapPresent(CAPS_TEXNONPOW2)) {
        if ((imgw & (imgw - 1)) != 0 || (imgh & (imgh - 1)) != 0) {
            return false;
        }
    }
    // verify that the texture image is square if it has to be
    if (!gd.isCapPresent(CAPS_TEXNONSQUARE) && imgw != imgh)
    {
        return false;
    }

    SurfaceData srcData =
        dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT,
                                     CompositeType.SrcOver, null);
    if (!(srcData instanceof D3DSurfaceData)) {
        // REMIND: this is a hack that attempts to cache the system
        //         memory image from the TexturePaint instance into a
        //         D3D texture...
        srcData =
            dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT,
                                         CompositeType.SrcOver, null);
        if (!(srcData instanceof D3DSurfaceData)) {
            return false;
        }
    }

    // verify that the source surface is actually a texture
    D3DSurfaceData d3dData = (D3DSurfaceData)srcData;
    if (d3dData.getType() != D3DSurfaceData.TEXTURE) {
        return false;
    }

    return true;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:56,代码来源:D3DPaints.java

示例7: fillShape

import java.awt.TexturePaint; //导入方法依赖的package包/类
/**
 * Fills the given <code>shape</code>.
 */
private void fillShape(Graphics2D g2D, Shape shape, PaintMode paintMode)
{
	if (paintMode == PaintMode.PRINT && g2D.getPaint() instanceof TexturePaint && OperatingSystem.isMacOSX()
			&& OperatingSystem.isJavaVersionGreaterOrEqual("1.7"))
	{
		Shape clip = g2D.getClip();
		g2D.setClip(shape);
		TexturePaint paint = (TexturePaint) g2D.getPaint();
		BufferedImage image = paint.getImage();
		Rectangle2D anchorRect = paint.getAnchorRect();
		Rectangle2D shapeBounds = shape.getBounds2D();
		double firstX = anchorRect.getX()
				+ Math.round(shapeBounds.getX() / anchorRect.getWidth()) * anchorRect.getWidth();
		if (firstX > shapeBounds.getX())
		{
			firstX -= anchorRect.getWidth();
		}
		double firstY = anchorRect.getY()
				+ Math.round(shapeBounds.getY() / anchorRect.getHeight()) * anchorRect.getHeight();
		if (firstY > shapeBounds.getY())
		{
			firstY -= anchorRect.getHeight();
		}
		for (double x = firstX; x < shapeBounds.getMaxX(); x += anchorRect.getWidth())
		{
			for (double y = firstY; y < shapeBounds.getMaxY(); y += anchorRect.getHeight())
			{
				AffineTransform transform = AffineTransform.getTranslateInstance(x, y);
				transform.concatenate(AffineTransform.getScaleInstance(anchorRect.getWidth() / image.getWidth(),
						anchorRect.getHeight() / image.getHeight()));
				g2D.drawRenderedImage(image, transform);
			}
		}
		g2D.setClip(clip);
	}
	else
	{
		g2D.fill(shape);
	}
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:44,代码来源:PlanComponent.java

示例8: setPaint

import java.awt.TexturePaint; //导入方法依赖的package包/类
public void setPaint(Paint p)
{
  if (p == null)
    return;

  paint = p;
  if (paint instanceof Color)
    {
      setColor((Color) paint);
      customPaint = false;
    }

  else if (paint instanceof TexturePaint)
    {
      TexturePaint tp = (TexturePaint) paint;
      BufferedImage img = tp.getImage();

      // map the image to the anchor rectangle
      int width = (int) tp.getAnchorRect().getWidth();
      int height = (int) tp.getAnchorRect().getHeight();

      double scaleX = width / (double) img.getWidth();
      double scaleY = height / (double) img.getHeight();

      AffineTransform at = new AffineTransform(scaleX, 0, 0, scaleY, 0, 0);
      AffineTransformOp op = new AffineTransformOp(at, getRenderingHints());
      BufferedImage texture = op.filter(img, null);
      int[] pixels = texture.getRGB(0, 0, width, height, null, 0, width);
      setPaintPixels(nativePointer, pixels, width, height, width, true, 0, 0);
      customPaint = false;
    }

  else if (paint instanceof GradientPaint)
    {
      GradientPaint gp = (GradientPaint) paint;
      Point2D p1 = gp.getPoint1();
      Point2D p2 = gp.getPoint2();
      Color c1 = gp.getColor1();
      Color c2 = gp.getColor2();
      setGradient(nativePointer, p1.getX(), p1.getY(), p2.getX(), p2.getY(),
                  c1.getRed(), c1.getGreen(), c1.getBlue(), c1.getAlpha(),
                  c2.getRed(), c2.getGreen(), c2.getBlue(), c2.getAlpha(),
                  gp.isCyclic());
      customPaint = false;
    }
  else
    {
      customPaint = true;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:51,代码来源:CairoGraphics2D.java

示例9: setPaint

import java.awt.TexturePaint; //导入方法依赖的package包/类
public void setPaint(Paint p)
{
  if (p == null)
    return;

  paint = p;
  if (paint instanceof Color)
    {
      setColor((Color) paint);
      customPaint = false;
    }
  
  else if (paint instanceof TexturePaint)
    {
      TexturePaint tp = (TexturePaint) paint;
      BufferedImage img = tp.getImage();

      // map the image to the anchor rectangle  
      int width = (int) tp.getAnchorRect().getWidth();
      int height = (int) tp.getAnchorRect().getHeight();

      double scaleX = width / (double) img.getWidth();
      double scaleY = height / (double) img.getHeight();

      AffineTransform at = new AffineTransform(scaleX, 0, 0, scaleY, 0, 0);
      AffineTransformOp op = new AffineTransformOp(at, getRenderingHints());
      BufferedImage texture = op.filter(img, null);
      int[] pixels = texture.getRGB(0, 0, width, height, null, 0, width);
      setPaintPixels(nativePointer, pixels, width, height, width, true, 0, 0);
      customPaint = false;
    }
  
  else if (paint instanceof GradientPaint)
    {
      GradientPaint gp = (GradientPaint) paint;
      Point2D p1 = gp.getPoint1();
      Point2D p2 = gp.getPoint2();
      Color c1 = gp.getColor1();
      Color c2 = gp.getColor2();
      setGradient(nativePointer, p1.getX(), p1.getY(), p2.getX(), p2.getY(),
                  c1.getRed(), c1.getGreen(), c1.getBlue(), c1.getAlpha(),
                  c2.getRed(), c2.getGreen(), c2.getBlue(), c2.getAlpha(),
                  gp.isCyclic());
      customPaint = false;
    }
  else
    {
      customPaint = true;
    }        
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:51,代码来源:CairoGraphics2D.java

示例10: setTexturePaint

import java.awt.TexturePaint; //导入方法依赖的package包/类
/**
 * We use OpenGL's texture coordinate generator to automatically
 * map the TexturePaint image to the geometry being rendered.  The
 * generator uses two separate plane equations that take the (x,y)
 * location (in device space) of the fragment being rendered to
 * calculate (u,v) texture coordinates for that fragment:
 *     u = Ax + By + Cz + Dw
 *     v = Ex + Fy + Gz + Hw
 *
 * Since we use a 2D orthographic projection, we can assume that z=0
 * and w=1 for any fragment.  So we need to calculate appropriate
 * values for the plane equation constants (A,B,D) and (E,F,H) such
 * that {u,v}=0 for the top-left of the TexturePaint's anchor
 * rectangle and {u,v}=1 for the bottom-right of the anchor rectangle.
 * We can easily make the texture image repeat for {u,v} values
 * outside the range [0,1] by specifying the GL_REPEAT texture wrap
 * mode.
 *
 * Calculating the plane equation constants is surprisingly simple.
 * We can think of it as an inverse matrix operation that takes
 * device space coordinates and transforms them into user space
 * coordinates that correspond to a location relative to the anchor
 * rectangle.  First, we translate and scale the current user space
 * transform by applying the anchor rectangle bounds.  We then take
 * the inverse of this affine transform.  The rows of the resulting
 * inverse matrix correlate nicely to the plane equation constants
 * we were seeking.
 */
private static void setTexturePaint(RenderQueue rq,
                                    SunGraphics2D sg2d,
                                    TexturePaint paint,
                                    boolean useMask)
{
    BufferedImage bi = paint.getImage();
    SurfaceData dstData = sg2d.surfaceData;
    SurfaceData srcData =
        dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
                                     CompositeType.SrcOver, null);
    boolean filter =
        (sg2d.interpolationType !=
         AffineTransformOp.TYPE_NEAREST_NEIGHBOR);

    // calculate plane equation constants
    AffineTransform at = (AffineTransform)sg2d.transform.clone();
    Rectangle2D anchor = paint.getAnchorRect();
    at.translate(anchor.getX(), anchor.getY());
    at.scale(anchor.getWidth(), anchor.getHeight());

    double xp0, xp1, xp3, yp0, yp1, yp3;
    try {
        at.invert();
        xp0 = at.getScaleX();
        xp1 = at.getShearX();
        xp3 = at.getTranslateX();
        yp0 = at.getShearY();
        yp1 = at.getScaleY();
        yp3 = at.getTranslateY();
    } catch (java.awt.geom.NoninvertibleTransformException e) {
        xp0 = xp1 = xp3 = yp0 = yp1 = yp3 = 0.0;
    }

    // assert rq.lock.isHeldByCurrentThread();
    rq.ensureCapacityAndAlignment(68, 12);
    RenderBuffer buf = rq.getBuffer();
    buf.putInt(SET_TEXTURE_PAINT);
    buf.putInt(useMask ? 1 : 0);
    buf.putInt(filter ? 1 : 0);
    buf.putLong(srcData.getNativeOps());
    buf.putDouble(xp0).putDouble(xp1).putDouble(xp3);
    buf.putDouble(yp0).putDouble(yp1).putDouble(yp3);
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:72,代码来源:BufferedPaints.java

示例11: isPaintValid

import java.awt.TexturePaint; //导入方法依赖的package包/类
/**
 * Returns true if the given TexturePaint instance can be used by the
 * accelerated OGLPaints.Texture implementation.  A TexturePaint is
 * considered valid if the following conditions are met:
 *   - the texture image dimensions are power-of-two (or the
 *     GL_ARB_texture_non_power_of_two extension is present)
 *   - the texture image can be (or is already) cached in an OpenGL
 *     texture object
 */
@Override
boolean isPaintValid(SunGraphics2D sg2d) {
    TexturePaint paint = (TexturePaint)sg2d.paint;
    OGLSurfaceData dstData = (OGLSurfaceData)sg2d.surfaceData;
    BufferedImage bi = paint.getImage();

    // see if texture-non-pow2 extension is available
    if (!dstData.isTexNonPow2Available()) {
        int imgw = bi.getWidth();
        int imgh = bi.getHeight();

        // verify that the texture image dimensions are pow2
        if ((imgw & (imgw - 1)) != 0 || (imgh & (imgh - 1)) != 0) {
            return false;
        }
    }

    SurfaceData srcData =
        dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
                                     CompositeType.SrcOver, null);
    if (!(srcData instanceof OGLSurfaceData)) {
        // REMIND: this is a hack that attempts to cache the system
        //         memory image from the TexturePaint instance into an
        //         OpenGL texture...
        srcData =
            dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
                                         CompositeType.SrcOver, null);
        if (!(srcData instanceof OGLSurfaceData)) {
            return false;
        }
    }

    // verify that the source surface is actually a texture
    OGLSurfaceData oglData = (OGLSurfaceData)srcData;
    if (oglData.getType() != OGLSurfaceData.TEXTURE) {
        return false;
    }

    return true;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:50,代码来源:OGLPaints.java


注:本文中的java.awt.TexturePaint.getImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。