[OpenJDK 2D-Dev] How to determine if SurfaceType supports transparency?

Clemens Eisserer linuxhippy at gmail.com
Wed Jun 10 10:53:30 UTC 2009


Hi Jim,

I thought about something like supportsTransparency() or something
with the same semantics as you described.
However, I'll simply look at it at blit-time.

Thanks, Clemens

> That isn't currently possible, but it sounds like a useful thing to add.
>  One problem is that there are some types that know that they have alpha,
> others that know that they do not, and still others which are too general
> and may have alpha or may not, so how do you encapsulate that information in
> a query?
>
> For example, IntArgb does have alpha, IntRgb does not, but AnyIntDcm may or
> may not have alpha.
>
> If we simply have ST implement Transparency then I suppose the types that
> are too general could simply return "Translucent" in order to avoid the
> promise of opacity.  It's the "safe" answer since Translucent doesn't
> guarantee that the pixels themselves will not be opaque - just that they
> have the option to be non-opaque...
>
>                        ...jim
>
> Clemens Eisserer wrote:
>>
>> Hello,
>>
>> Is it possible to determine wether a SurfaceType does support
>> transparency?
>> I know its possible with SurfaceData, but I need to know at
>> loop-registerion time where I only have access to SurfaceTypes of
>> course.
>>
>> Thank you in advance, Clemens
>



More information about the 2d-dev mailing list