Summary: | GLReadBufferUtil/AWTReadBufferUtil: 'hasAlpha' usage is not functional | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | Sven Gothel <sgothel> |
Component: | core | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | askinner, sgothel |
Priority: | P4 | ||
Version: | 2.4.0 | ||
Hardware: | All | ||
OS: | all | ||
Type: | DEFECT | SCM Refs: |
jogl 154e91978498d8b6db9ce34a1f06b298bcf4c361
|
Workaround: | --- |
Description
Sven Gothel
2019-05-13 10:50:19 CEST
(In reply to Sven Gothel from comment #0) > Either (1) store the 'requestedAlpha' immutable and use it always, > or (2) determine 'hasAlpha' with construction. > > (2) probably is desired anyways and (1) for better documentation (debugging). > Hence both options probably should be implemented and (2) will also lead to > proper host PixelFormat. > > This erroneous behavior is now visible using AWTGLReadBufferUtil, > which can be mitigated using 'hasAlpha = true' in the construction. (2) 'hasAlpha' cannot be determined w/o a valid GL instance or at least GLProfile at construction, since none is currently passed in the constructor, we need to keep 'hasAlpha' being lazily evaluated by the first readPixel call. (1) immutable storage of requestedAlpha will resolve this issue It is up to the AWTGLReadBufferUtil user to use different pixel formats for host and GL, i.e. RGB stored within 32bit INT on the host side being filled by OpenGL with RGBA or BGRA data. jogl 154e91978498d8b6db9ce34a1f06b298bcf4c361 Keep host PixelFormat functional using requested immutable alphaRequested + add appropriate API doc |