SkRandom Class Reference

#include <SkRandom.h>

List of all members.

Public Member Functions

 SkRandom ()
 SkRandom (uint32_t seed)
uint32_t nextU ()
int32_t nextS ()
U16CPU nextU16 ()
S16CPU nextS16 ()
uint32_t nextBits (unsigned bitCount)
uint32_t nextRangeU (uint32_t min, uint32_t max)
SkFixed nextUFixed1 ()
SkFixed nextSFixed1 ()
SkScalar nextUScalar1 ()
SkScalar nextSScalar1 ()
void next64 (Sk64 *a)
void setSeed (int32_t seed)

Detailed Description

Utility class that implements pseudo random 32bit numbers using a fast linear equation. Unlike rand(), this class holds its own seed (initially set to 0), so that multiple instances can be used with no side-effects.

Definition at line 29 of file SkRandom.h.


Constructor & Destructor Documentation

SkRandom::SkRandom (  )  [inline]

Definition at line 31 of file SkRandom.h.

SkRandom::SkRandom ( uint32_t  seed  )  [inline]

Definition at line 32 of file SkRandom.h.


Member Function Documentation

void SkRandom::next64 ( Sk64 a  )  [inline]

Return the next pseudo random number as a signed 64bit value.

Definition at line 89 of file SkRandom.h.

uint32_t SkRandom::nextBits ( unsigned  bitCount  )  [inline]

Return the next pseudo random number, as an unsigned value of at most bitCount bits.

Parameters:
bitCount The maximum number of bits to be returned

Definition at line 54 of file SkRandom.h.

uint32_t SkRandom::nextRangeU ( uint32_t  min,
uint32_t  max 
) [inline]

Return the next pseudo random unsigned number, mapped to lie within [min, max] inclusive.

Definition at line 62 of file SkRandom.h.

int32_t SkRandom::nextS (  )  [inline]

Return the next pseudo random number as a signed 32bit value.

Definition at line 40 of file SkRandom.h.

S16CPU SkRandom::nextS16 (  )  [inline]

Return the next pseudo random number as a signed 16bit value.

Definition at line 48 of file SkRandom.h.

SkFixed SkRandom::nextSFixed1 (  )  [inline]

Return the next pseudo random number expressed as a signed SkFixed in the range (-SK_Fixed1..SK_Fixed1).

Definition at line 75 of file SkRandom.h.

SkScalar SkRandom::nextSScalar1 (  )  [inline]

Return the next pseudo random number expressed as a SkScalar in the range (-SK_Scalar1..SK_Scalar1).

Definition at line 85 of file SkRandom.h.

uint32_t SkRandom::nextU (  )  [inline]

Return the next pseudo random number as an unsigned 32bit value.

Definition at line 36 of file SkRandom.h.

U16CPU SkRandom::nextU16 (  )  [inline]

Return the next pseudo random number as an unsigned 16bit value.

Definition at line 44 of file SkRandom.h.

SkFixed SkRandom::nextUFixed1 (  )  [inline]

Return the next pseudo random number expressed as an unsigned SkFixed in the range [0..SK_Fixed1).

Definition at line 70 of file SkRandom.h.

SkScalar SkRandom::nextUScalar1 (  )  [inline]

Return the next pseudo random number expressed as a SkScalar in the range [0..SK_Scalar1).

Definition at line 80 of file SkRandom.h.

void SkRandom::setSeed ( int32_t  seed  )  [inline]

Set the seed of the random object. The seed is initialized to 0 when the object is first created, and is updated each time the next pseudo random number is requested.

Definition at line 98 of file SkRandom.h.


The documentation for this class was generated from the following file:

Generated on Tue Oct 20 11:03:42 2009 for Skia by  doxygen 1.6.1