Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsBMPDecoder.cpp File Reference
#include <stdlib.h>
#include "nsBMPDecoder.h"
#include "nsIInputStream.h"
#include "nsIComponentManager.h"
#include "imgIContainerObserver.h"
#include "imgILoad.h"
#include "prlog.h"

Go to the source code of this file.

Functions

static void calcBitmask (PRUint32 aMask, PRUint8 &aBegin, PRUint8 &aLength)

Function Documentation

static void calcBitmask ( PRUint32  aMask,
PRUint8 aBegin,
PRUint8 aLength 
) [static]

Definition at line 181 of file nsBMPDecoder.cpp.

{
    // find the rightmost 1
    PRUint8 pos;
    PRBool started = PR_FALSE;
    aBegin = aLength = 0;
    for (pos = 0; pos <= 31; pos++) {
        if (!started && (aMask & (1 << pos))) {
            aBegin = pos;
            started = PR_TRUE;
        }
        else if (started && !(aMask & (1 << pos))) {
            aLength = pos - aBegin;
            break;
        }
    }
}

Here is the caller graph for this function: