Changeset 1673 for trunk/dll/loadbmp.c


Ignore:
Timestamp:
Dec 30, 2012, 7:51:01 PM (13 years ago)
Author:
Gregg Young
Message:

Update to Doxygen comment style Ticket 55. Also some minor code cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/loadbmp.c

    r1544 r1673  
    9696  }
    9797
    98   /* Read bitmap info header
    99      Allocate enough to hold a complete 2.x bitmap array file header
    100      fixme to support > 256 colors?
     98  /**
     99   * Read bitmap info header
     100   * Allocate enough to hold a complete 2.x bitmap array file header
     101   * fixme to support > 256 colors?
    101102   */
    102103  pbmafh2 =
     
    104105  if (!pbmafh2)
    105106    goto ExitLoadBMP;
    106   /* Assign pointers to the file header and bitmap info header etc.
    107      Both the 1.x and 2.x structures are assigned to simplify code
    108      fixme to clean this up - aliased pointers are evil
     107  /**
     108   * Assign pointers to the file header and bitmap info header etc.
     109   * Both the 1.x and 2.x structures are assigned to simplify code
     110   * fixme to clean this up - aliased pointers are evil
    109111   */
    110112  pbmfh2 = &pbmafh2->bfh2;
     
    119121  case BFT_COLORPOINTER:
    120122    {
    121       /* Assume image is a 2.0 image and read as a 2.x header
    122          OK for 1.x file - read will not fail unless file is corrupted
     123      /**
     124       * Assume image is a 2.0 image and read as a 2.x header
     125       * OK for 1.x file - read will not fail unless file is corrupted
    123126       */
    124127      rc = fseek(pf, 0, SEEK_SET);
     
    135138
    136139      is2x = pbmih2->cbFix > sizeof(BITMAPINFOHEADER);  // 1.x or 2.x bitmap
    137       /* We will read the color table later
    138          Color table follows header but
    139          location depends on the type of the bitmap (old vs new)
    140          1.x header is fixed size
    141          2.x header is variable sized, so offset must be calculated
    142          cbFix contains actual size of BITMAPINFOHEADER2 in file
     140      /**
     141       * We will read the color table later
     142       * Color table follows header but
     143       * location depends on the type of the bitmap (old vs new)
     144       * 1.x header is fixed size
     145       * 2.x header is variable sized, so offset must be calculated
     146       *  cbFix contains actual size of BITMAPINFOHEADER2 in file
    143147       */
    144148      ulRGBOffset = is2x ? sizeof(*pbmfh2) - sizeof(*pbmih2) + pbmih2->cbFix :
     
    149153  case BFT_BITMAPARRAY:
    150154    {
    151       /* Now we are dealing with a bitmap array which is a collection of bitmaps
    152          Each bitmap has its own file header
     155      /**
     156       * Now we are dealing with a bitmap array which is a collection of bitmaps
     157       * Each bitmap has its own file header
    153158       */
    154159
     
    163168      HDC hdc;
    164169
    165       /* Scan the array and chose the bitmap best suited
    166          for the current display size and color capacities
     170      /**
     171       * Scan the array and chose the bitmap best suited
     172       * for the current display size and color capacities
    167173       */
    168174      hdc = GpiQueryDevice(hPS);
     
    233239
    234240      is2x = pbmih2->cbFix > sizeof(BITMAPINFOHEADER);
    235       /* As before, we calculate offset in file stream to color table
    236          This code must match single bitmap logic
     241      /**
     242       * As before, we calculate offset in file stream to color table
     243       * This code must match single bitmap logic
    237244       */
    238245      ulRGBOffset = ulOffsetPicked;
     
    257264  // Read color table
    258265  if (is2x) {
    259     /* For a 2.0 bitmap, read the color table as is
    260        The bitmap info structure is header + color table
    261        If we have 24 bits per pel, there is usually no color table, unless
    262        pbmih2->cclrUsed or pbmih2->cclrImportant are non zero
    263        fixme to test this
     266    /**
     267     * For a 2.0 bitmap, read the color table as is
     268     * The bitmap info structure is header + color table
     269     * If we have 24 bits per pel, there is usually no color table, unless
     270     * pbmih2->cclrUsed or pbmih2->cclrImportant are non zero
     271     *  fixme to test this
    264272     */
    265273    if (pbmih2->cBitCount < 24) {
     
    284292  }
    285293  else {
    286     /* This is a 1.x format bitmap
    287        Since the current standard format is the 2.0
    288        convert the header and color table to 2.x format
     294    /**
     295     * This is a 1.x format bitmap
     296     * Since the current standard format is the 2.0
     297     * convert the header and color table to 2.x format
    289298     */
    290299    ULONG ul;
     
    319328  }                                     // if 1.x
    320329
    321   /* The 2.0 bitmap info structure set up
    322      Position to start of the bitmap data
     330  /**
     331   * The 2.0 bitmap info structure set up
     332   * Position to start of the bitmap data
    323333   */
    324334  rc = fseek(pf, pbmfh2->offBits, SEEK_SET);
     
    328338  }
    329339
    330   /* Read the bitmap data
    331      The read size is derived using the magic formula
    332      Each bitmap scan line is aligned on a doubleword boundary
    333      The size of the scan line is the number of pels times the bpp
    334      After aligning it, we divide by 4 to get the number of bytes, and
    335      multiply by the number of scan lines and the number of pel planes
     340  /**
     341   * Read the bitmap data
     342   * The read size is derived using the magic formula
     343   * Each bitmap scan line is aligned on a doubleword boundary
     344   * The size of the scan line is the number of pels times the bpp
     345   * After aligning it, we divide by 4 to get the number of bytes, and
     346   * multiply by the number of scan lines and the number of pel planes
    336347   */
    337348  if (pbmi2->ulCompression)
Note: See TracChangeset for help on using the changeset viewer.