本文整理汇总了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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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));
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
}
示例11: BmByteIndexBufImg
public BmByteIndexBufImg() {
super(bufimgsrcroot,
"ByteIndexedBm",
"8-bit Transparent Indexed Image",
Transparency.BITMASK);
}
示例12: getTransparency
public int getTransparency() {
return Transparency.BITMASK;
}