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


Java Transparency.BITMASK属性代码示例

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


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

示例1: createCompatibleVolatileImage

/**
 * {@inheritDoc}
 *
 * @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
 */
@Override
public VolatileImage
    createCompatibleVolatileImage(int width, int height,
                                  int transparency, int type)
{
    if ((type != FBOBJECT && type != TEXTURE)
            || transparency == Transparency.BITMASK
            || type == FBOBJECT && !isCapPresent(CAPS_EXT_FBOBJECT)) {
        return null;
    }
    SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height,
                                                      transparency, type);
    Surface sd = vi.getDestSurface();
    if (!(sd instanceof AccelSurface) ||
        ((AccelSurface)sd).getType() != type)
    {
        vi.flush();
        vi = null;
    }

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

示例2: getColorModel

@Override
public ColorModel getColorModel(int transparency) {
    switch (transparency) {
    case Transparency.OPAQUE:
        // REMIND: once the ColorModel spec is changed, this should be
        //         an opaque premultiplied DCM...
        return new DirectColorModel(24, 0xff0000, 0xff00, 0xff);
    case Transparency.BITMASK:
        return new DirectColorModel(25, 0xff0000, 0xff00, 0xff, 0x1000000);
    case Transparency.TRANSLUCENT:
        ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
        return new DirectColorModel(cs, 32,
                                    0xff0000, 0xff00, 0xff, 0xff000000,
                                    true, DataBuffer.TYPE_INT);
    default:
        return null;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:D3DGraphicsConfig.java

示例3: getColorModel

/**
 * Returns the color model associated with this configuration that
 * supports the specified transparency.
 */
public ColorModel getColorModel(int transparency) {

    if (model.getTransparency() == transparency) {
        return model;
    }
    switch (transparency) {
    case Transparency.OPAQUE:
        return new DirectColorModel(24, 0xff0000, 0xff00, 0xff);
    case Transparency.BITMASK:
        return new DirectColorModel(25, 0xff0000, 0xff00, 0xff, 0x1000000);
    case Transparency.TRANSLUCENT:
        return ColorModel.getRGBdefault();
    default:
        return null;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:BufferedImageGraphicsConfig.java

示例4: getColorModel

/**
 * Returns the color model associated with this configuration that
 * supports the specified transparency.
 */
public ColorModel getColorModel(int transparency) {
    switch (transparency) {
    case Transparency.OPAQUE:
        return getColorModel();
    case Transparency.BITMASK:
        return new DirectColorModel(25, 0xff0000, 0xff00, 0xff, 0x1000000);
    case Transparency.TRANSLUCENT:
        return ColorModel.getRGBdefault();
    default:
        return null;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:X11GraphicsConfig.java

示例5: TriStateImageType

public TriStateImageType(Group parent, String nodename, String desc,
                         int transparency)
{
    super(parent, nodename, desc);
    setHorizontal();
    new DrawableImage(this, Transparency.OPAQUE, true);
    new DrawableImage(this, Transparency.BITMASK,
                      (transparency != Transparency.OPAQUE));
    new DrawableImage(this, Transparency.TRANSLUCENT,
                      (transparency == Transparency.TRANSLUCENT));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:ImageTests.java

示例6: createCompatibleVolatileImage

/**
 * {@inheritDoc}
 *
 * @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
 */
@Override
public VolatileImage
    createCompatibleVolatileImage(int width, int height,
                                  int transparency, int type)
{
    if (type == FLIP_BACKBUFFER || type == WINDOW || type == UNDEFINED ||
        transparency == Transparency.BITMASK)
    {
        return null;
    }

    if (type == FBOBJECT) {
        if (!isCapPresent(CAPS_EXT_FBOBJECT)) {
            return null;
        }
    } else if (type == PBUFFER) {
        boolean isOpaque = transparency == Transparency.OPAQUE;
        if (!isOpaque && !isCapPresent(CAPS_STORED_ALPHA)) {
            return null;
        }
    }

    SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height,
                                                      transparency, type);
    Surface sd = vi.getDestSurface();
    if (!(sd instanceof AccelSurface) ||
        ((AccelSurface)sd).getType() != type)
    {
        vi.flush();
        vi = null;
    }

    return vi;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:39,代码来源:GLXGraphicsConfig.java

示例7: SunVolatileImage

protected SunVolatileImage(Component comp,
                           GraphicsConfiguration graphicsConfig,
                           int width, int height, Object context,
                           int transparency, ImageCapabilities caps,
                           int accType)
{
    this.comp = comp;
    this.graphicsConfig = graphicsConfig;
    this.width = width;
    this.height = height;
    this.forcedAccelSurfaceType = accType;
    if (!(transparency == Transparency.OPAQUE ||
        transparency == Transparency.BITMASK ||
        transparency == Transparency.TRANSLUCENT))
    {
        throw new IllegalArgumentException("Unknown transparency type:" +
                                           transparency);
    }
    this.transparency = transparency;
    this.volSurfaceManager = createSurfaceManager(context, caps);
    SurfaceManager.setManager(this, volSurfaceManager);

    // post-construction initialization of the surface manager
    volSurfaceManager.initialize();
    // clear the background
    volSurfaceManager.initContents();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:SunVolatileImage.java

示例8: createCompatibleVolatileImage

/**
 * {@inheritDoc}
 *
 * @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
 */
@Override
public VolatileImage
    createCompatibleVolatileImage(int width, int height,
                                  int transparency, int type)
{
    if (type == FLIP_BACKBUFFER || type == WINDOW || type == UNDEFINED ||
        transparency == Transparency.BITMASK)
    {
        return null;
    }
    boolean isOpaque = transparency == Transparency.OPAQUE;
    if (type == RT_TEXTURE) {
        int cap = isOpaque ? CAPS_RT_TEXTURE_OPAQUE : CAPS_RT_TEXTURE_ALPHA;
        if (!device.isCapPresent(cap)) {
            return null;
        }
    } else if (type == RT_PLAIN) {
        if (!isOpaque && !device.isCapPresent(CAPS_RT_PLAIN_ALPHA)) {
            return null;
        }
    }

    SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height,
                                                      transparency, type);
    Surface sd = vi.getDestSurface();
    if (!(sd instanceof AccelSurface) ||
        ((AccelSurface)sd).getType() != type)
    {
        vi.flush();
        vi = null;
    }

    return vi;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:D3DGraphicsConfig.java

示例9: SunVolatileImage

protected SunVolatileImage(Component comp,
                           GraphicsConfiguration graphicsConfig,
                           int width, int height, Object context,
                           int transparency, ImageCapabilities caps,
                           int accType)
{
    this.comp = comp;
    this.graphicsConfig = graphicsConfig;
    if (width <= 0 || height <= 0) {
        throw new IllegalArgumentException("Width (" + width + ")" +
                          " and height (" + height + ") cannot be <= 0");
    }
    this.width = width;
    this.height = height;
    this.forcedAccelSurfaceType = accType;
    if (!(transparency == Transparency.OPAQUE ||
        transparency == Transparency.BITMASK ||
        transparency == Transparency.TRANSLUCENT))
    {
        throw new IllegalArgumentException("Unknown transparency type:" +
                                           transparency);
    }
    this.transparency = transparency;
    this.volSurfaceManager = createSurfaceManager(context, caps);
    SurfaceManager.setManager(this, volSurfaceManager);

    // post-construction initialization of the surface manager
    volSurfaceManager.initialize();
    // clear the background
    volSurfaceManager.initContents();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:31,代码来源:SunVolatileImage.java

示例10: init

public static void init() {
    destroot = new Group.EnableSet(TestEnvironment.globaloptroot,
                                   "dest", "Output Destination Options");

    new Screen();
    new OffScreen();

    if (GraphicsTests.hasGraphics2D) {
        if (ImageTests.hasCompatImage) {
            compatimgdestroot =
                new Group.EnableSet(destroot, "compatimg",
                                    "Compatible Image Destinations");
            compatimgdestroot.setHorizontal();

            new CompatImg();
            new CompatImg(Transparency.OPAQUE);
            new CompatImg(Transparency.BITMASK);
            new CompatImg(Transparency.TRANSLUCENT);
        }

        if (ImageTests.hasVolatileImage) {
            new VolatileImg();
        }

        bufimgdestroot = new Group.EnableSet(destroot, "bufimg",
                                             "BufferedImage Destinations");

        new BufImg(BufferedImage.TYPE_INT_RGB);
        new BufImg(BufferedImage.TYPE_INT_ARGB);
        new BufImg(BufferedImage.TYPE_INT_ARGB_PRE);
        new BufImg(BufferedImage.TYPE_3BYTE_BGR);
        new BufImg(BufferedImage.TYPE_BYTE_INDEXED);
        new BufImg(BufferedImage.TYPE_BYTE_GRAY);
        new CustomImg();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:36,代码来源:Destinations.java

示例11: BmByteIndexBufImg

public BmByteIndexBufImg() {
    super(bufimgsrcroot,
          "ByteIndexedBm",
          "8-bit Transparent Indexed Image",
          Transparency.BITMASK);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:ImageTests.java

示例12: getTransparency

public int getTransparency() {
    return Transparency.BITMASK;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:3,代码来源:X11SurfaceDataProxy.java


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