<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1107</bug_id>
          
          <creation_ts>2014-12-06 21:11:47 +0100</creation_ts>
          <short_desc>Refine PixelFormat, GLPixelBuffer and DirectDataBufferInt/BufferedImageInt</short_desc>
          <delta_ts>2019-03-29 17:54:45 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>2.3.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>sgothel</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>a53e87a84c92444e8a3173f25ce86dcfd536d6a8</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4465</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-12-06 21:11:47 +0100</bug_when>
    <thetext>- PixelFormat 
  Refine definition allowing complete format conversion by its attributes
  instead of static &apos;knowledge&apos;.

  - PixelFormat has_a *new* PixelFormat.Composition

  - PixelFormat.Composition contains all pixel component layout
    information as required for inspection and conversion.
    Component names are enumerated via PixelFormat.CType.

  - PixelFormatUtil.convert(..) utilizes generic conversion 
    based on PixelFormat.Composition rather static type mapping. 
    However, a int32 RGBA static conversion is still supported for performance.
    Utilizes Bitstream for varying pixel component bit-width.

  - Complete w/ hashCode() and equals(..)

- GLPixelBuffer
  - Take &apos;pack&apos; mode into account when determine GLPixelAttributes,
    i.e. on GLES pack=true (e.g. glReadPixel) only RGBA is guaranteed to work.
    Hence querying GLPixelAttributes requires the GLProfile, PixelFormat and pack mode.

  - Complete GLPixelAttributes conversions from PixelFormat or GL format/data-type,
    while taking GL data-type into account, as well as pack-mode.

  - Complete w/ hashCode() and equals(..)

  - SingletonGLPixelBufferProvider queries singleton GLPixelBuffer via 
      - PixelFormat.Composition hostPixelComp, 
      - GLPixelAttributes pixelAttributes, 
      - boolean pack
    which comprise a unique key, allowing the implementation to utilize 
    a hash map. This is implemented in AWTSingletonGLPixelBufferProvider.
    This allows distinct singleton GLPixelBuffer for different 
    host PixelFormat (conversion) and GLPixelAttributes (depending on GLProfile).

  - Removes field &apos;componentCount&apos; which was &apos;hacked in&apos; to pass
    information about an optional host memory layout.
    Implementations utilizing conversion, e.g. AWTGLPixelBuffer,
    can implement GLPixelBufferProvider&apos;s 
      &apos;PixelFormat.Composition getHostPixelComp(final GLProfile glp, final int componentCount)&apos;
    and manage such implementation details, see use-case GLJPanel.
    
- DirectDataBufferInt/BufferedImageInt: Expose underlying NIO ByteBuffer

- AWTMisc.createCursor(..) uses DirectDataBufferInt.BufferedImageInt exposed 
  NIO ByteBuffer, allowing to use generic PixelFormatUtil.convert(..).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4466</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-12-06 21:12:43 +0100</bug_when>
    <thetext>a53e87a84c92444e8a3173f25ce86dcfd536d6a8: Fixed as described</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>