Ignore:
Timestamp:
Nov 9, 2000, 7:15:23 PM (25 years ago)
Author:
sandervl
Message:

Icon api rewrite + small fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/dib.cpp

    r2804 r4573  
    1 /* $Id: dib.cpp,v 1.5 2000-02-16 14:34:16 sandervl Exp $ */
     1/* $Id: dib.cpp,v 1.6 2000-11-09 18:15:18 sandervl Exp $ */
    22
    33/*
     
    2020#include <stdlib.h>
    2121#include <misc.h>
     22#include "dib.h"
    2223
    2324#define DBG_LOCALLOG    DBG_dib
     
    208209
    209210}
     211
     212/***********************************************************************
     213 *           BITMAP_GetWidthBytes
     214 *
     215 * Return number of bytes taken by a scanline of 16-bit aligned Windows DDB
     216 * data.
     217 */
     218int BITMAP_GetWidthBytes( INT bmWidth, INT bpp )
     219{
     220    switch(bpp)
     221    {
     222    case 1:
     223        return 2 * ((bmWidth+15) >> 4);
     224
     225    case 24:
     226        bmWidth *= 3; /* fall through */
     227    case 8:
     228        return bmWidth + (bmWidth & 1);
     229
     230    case 32:
     231        return bmWidth * 4;
     232
     233    case 16:
     234    case 15:
     235        return bmWidth * 2;
     236
     237    case 4:
     238        return 2 * ((bmWidth+3) >> 2);
     239
     240    default:
     241        dprintf(("BITMAP_GetWidthBytes: Unknown depth %d, please report.\n", bpp ));
     242    }
     243    return -1;
     244}
Note: See TracChangeset for help on using the changeset viewer.