15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    APPLE_row_bytes
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_APPLE_row_bytes
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Andrew Barnes
125bd8deadSopenharmony_ci    John Rosasco
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciContact
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    John Rosasco, Apple Computer (jdr 'at' apple.com)
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciStatus
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    TBD
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciVersion
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Last Modified: October 17, 2006
255bd8deadSopenharmony_ci    Revision: #2
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciNumber
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    372
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciDependencies
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    OpenGL 1.1 is required.
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    Written based on the wording of the OpenGL 2.1 specification.
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ciOverview
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    The APPLE_row_bytes extension was developed to relax the limitations
405bd8deadSopenharmony_ci    within GL regarding the packing and unpacking of pixel data from
415bd8deadSopenharmony_ci    arbitrary arrangements in memory.
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    Prior to this extension, similar, albeit more restrictive, functionality
445bd8deadSopenharmony_ci    existed in GL using pixel storage modes for unpacking, packing, and
455bd8deadSopenharmony_ci    alignment.  The limitation of the existing mechanism lies primarily in how
465bd8deadSopenharmony_ci    packing or unpacking of data is specified with pixel atomicity rather than
475bd8deadSopenharmony_ci    basic machine units.  To some extent, this pixel granularity can be
485bd8deadSopenharmony_ci    overcome using pixel storage modes GL_UNPACK_ALIGNMENT and
495bd8deadSopenharmony_ci    GL_PACK_ALIGNMENT.  Both of these parameters are specified in basic
505bd8deadSopenharmony_ci    machine units but their range of possible values is restricted and even
515bd8deadSopenharmony_ci    then they do not allow for the packing and unpacking of pixel data in a
525bd8deadSopenharmony_ci    fully arbitrary manner.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    Consider this simple example:
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci        Consider a column of pixels in memory.  The pixels are of GL_RGB 
575bd8deadSopenharmony_ci        format and GL_UNSIGNED_BYTE type resulting in 3 bytes per pixel.
585bd8deadSopenharmony_ci        Now consider that this column of pixel data was arranged in memory
595bd8deadSopenharmony_ci        such that each row of the image (in this case each pixel) has two
605bd8deadSopenharmony_ci        bytes padding or space between them.
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci        Each row of 1 pixel then has 5 bytes.  An attempting to express this
635bd8deadSopenharmony_ci        memory arrangement with existing pixel storage semantics would
645bd8deadSopenharmony_ci        naturally start with a GL_UNPACK_ROW_LENGTH of 1 because there is
655bd8deadSopenharmony_ci        one pixel per row.  However, no valid value of GL_UNPACK_ALIGNMENT,
665bd8deadSopenharmony_ci        1, 2, 4, or 8, will allow the proper row padding to express this 
675bd8deadSopenharmony_ci        memory arrangement.
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ciGlossary
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    Storage mode class - delineation of packing vs unpacking pixel storage
725bd8deadSopenharmony_ci    mode values.
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ciIssues
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci    What happens when row bytes pixel storage values are specified in
775bd8deadSopenharmony_ci    conjunction with row length or alignment values ?
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci        Specifying non-zero row bytes packing or unpacking values will
805bd8deadSopenharmony_ci        override all values specified for both row length and alignment
815bd8deadSopenharmony_ci        of the same class.  In other words, if GL_PACK_ROW_BYTES is
825bd8deadSopenharmony_ci        specified as non-zero, it overrides values of both 
835bd8deadSopenharmony_ci        GL_PACK_ROW_LENGTH and GL_PACK_ALIGNMENT.  The same scenario is
845bd8deadSopenharmony_ci        true of unpacking pixel storage parameters.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    How do you switch between using row length and alignment values to row
875bd8deadSopenharmony_ci    bytes values ?
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci        Set the row bytes value to zero for the same storage mode class
905bd8deadSopenharmony_ci        to use conventional row length and alignment semantics.  Set
915bd8deadSopenharmony_ci        row bytes to non-zero to use APPLE_row_bytes semantics.
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci    Does the semantics for packing need to match that of unpacking ?
945bd8deadSopenharmony_ci    (i.e. if you are unpacking with row bytes semantics do you need to pack with
955bd8deadSopenharmony_ci    row bytes ?)
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ci        No.  Storage mode class semantics are independent.
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci    If retrieving data from GL, such as in a ReadPixels() or
1005bd8deadSopenharmony_ci    GetTexImage(), do the unpack settings have any effect ?
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci        Yes.  If the format and type of the data of a source or destination
1035bd8deadSopenharmony_ci        for packing or unpacking is not known, as in the case of a
1045bd8deadSopenharmony_ci        ReadPixels() call or a GetTexImage() call, the storage mode class
1055bd8deadSopenharmony_ci        values for the unknown arrangement should be set to GL default
1065bd8deadSopenharmony_ci        values.  In the case cited above, the packing modes can be specified
1075bd8deadSopenharmony_ci        but the unpacking modes should be set to default GL values.
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci    What are the default values for GL_PACK_ROW_BYTES and GL_UNPACK_ROW_BYTES
1105bd8deadSopenharmony_ci    ?
1115bd8deadSopenharmony_ci        Zero.
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ciNew Procedures and Functions
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    None.
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ciErrors
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    None.
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ciNew Types
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci    None.
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ciNew Tokens
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    Accepted by the <pname> parameter of PixelStorei and the <pname>
1325bd8deadSopenharmony_ci    parameter of GetIntegerv:
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci        PACK_ROW_BYTES_APPLE          0x8A15
1355bd8deadSopenharmony_ci        UNPACK_ROW_BYTES_APPLE        0x8A16
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ciNew State
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    Get Value               Get Command     Type    Value       Attrib
1415bd8deadSopenharmony_ci    ---------               -----------     ----    -------     ------
1425bd8deadSopenharmony_ci    PACK_ROW_BYTES_APPLE    GetIntegerv     Z+      0           client_pixel_store   
1435bd8deadSopenharmony_ci    UNPACK_ROW_BYTES_APPLE  GetIntegerv     Z+      0           client_pixel_store  
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ciAdditions to table 3.1 of the 2.1 specification (PixelStore parameters (write)):
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci    Parameter Name          Type        Initial Value   Valid Range
1505bd8deadSopenharmony_ci    UNPACK_ROW_BYTES_APPLE  integer     0               [0, inf]
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ciAdditions to table 4.5 of the 2.1 specification (PixelStore parameters (read)):
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    Parameter Name          Type        Initial Value   Valid Range
1565bd8deadSopenharmony_ci    PACK_ROW_BYTES_APPLE    integer     0               [0, inf]
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ciVersion History
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci#1 - Initial document.
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci#2 - Added state segment.
164