|
MagickCore 7.1.0
Convert, Edit, Or Compose Bitmap Images
|
#include "MagickCore/studio.h"#include "MagickCore/exception.h"#include "MagickCore/exception-private.h"#include "MagickCore/image-private.h"#include "MagickCore/memory_.h"#include "MagickCore/memory-private.h"#include "MagickCore/random_.h"#include "MagickCore/random-private.h"#include "MagickCore/resource_.h"#include "MagickCore/semaphore.h"#include "MagickCore/signature-private.h"#include "MagickCore/string_.h"#include "MagickCore/thread_.h"#include "MagickCore/thread-private.h"#include "MagickCore/utility.h"#include "MagickCore/utility-private.h"Go to the source code of this file.
Data Structures | |
| struct | _RandomInfo |
Macros | |
| #define | PseudoRandomHash SHA256Hash |
| #define | RandomEntropyLevel 9 |
| #define | RandomFilename "reservoir.xdm" |
| #define | RandomFiletype "random" |
| #define | RandomProtocolMajorVersion 1 |
| #define | RandomProtocolMinorVersion 0 |
| #define | MaxEntropyExtent 64 /* max permitted: 256 */ |
| #define | RandomROTL(x, k) (((x) << (k)) | ((x) >> (64-(k)))) |
Variables | |
| char ** | environ |
| static SemaphoreInfo * | random_semaphore = (SemaphoreInfo *) NULL |
| static unsigned long | secret_key = ~0UL |
| static MagickBooleanType | gather_true_random = MagickFalse |
| #define MaxEntropyExtent 64 /* max permitted: 256 */ |
| #define RandomROTL | ( | x, | |
| k | |||
| ) | (((x) << (k)) | ((x) >> (64-(k)))) |
| MagickExport RandomInfo * AcquireRandomInfo | ( | void | ) |
Definition at line 166 of file random.c.
References AcquireCriticalMemory(), AcquireSemaphoreInfo(), AcquireSignatureInfo(), AcquireStringInfo(), DestroySignatureInfo(), DestroyStringInfo(), FinalizeSignature(), GenerateEntropicChaos(), GetRandomKey(), GetSignatureDigest(), GetSignatureDigestsize(), GetStringInfoDatum(), InitializeSignature(), MagickCoreSignature, MagickMin, MagickULLConstant, _RandomInfo::nonce, _RandomInfo::normalize, _RandomInfo::protocol_major, _RandomInfo::protocol_minor, random_info, RandomProtocolMajorVersion, RandomProtocolMinorVersion, _RandomInfo::reservoir, ResetStringInfo(), ResourceLimitFatalError, _RandomInfo::secret_key, secret_key, _RandomInfo::seed, _RandomInfo::semaphore, SetStringInfo(), SetStringInfoDatum(), SetStringInfoLength(), _RandomInfo::signature, _RandomInfo::signature_info, ThrowFatalException, _RandomInfo::timestamp, and UpdateSignature().
Referenced by AcquireRandomInfoTLS(), AcquireUniqueFileResource(), AllocFxRt(), GetVirtualPixelCacheNexus(), KmeansImage(), PlasmaImage(), and ShredFile().
| MagickExport RandomInfo * DestroyRandomInfo | ( | RandomInfo * | random_info | ) |
Definition at line 277 of file random.c.
References DestroySignatureInfo(), DestroyStringInfo(), GetMagickModule, IsEventLogging(), LockSemaphoreInfo(), LogMagickEvent(), MagickCoreSignature, MagickFalse, _RandomInfo::nonce, random_info, RelinquishMagickMemory(), RelinquishSemaphoreInfo(), _RandomInfo::reservoir, _RandomInfo::seed, _RandomInfo::semaphore, _RandomInfo::signature, _RandomInfo::signature_info, TraceEvent, and UnlockSemaphoreInfo().
Referenced by DestroyFxRt(), DestroyPixelCache(), DestroyRandomInfoTLS(), KmeansImage(), PlasmaImage(), ResourceComponentTerminus(), and ShredFile().
|
static |
Definition at line 351 of file random.c.
References AcquireString(), AcquireStringInfo(), ConcatenateStringInfo(), DestroyString(), DestroyStringInfo(), environ, gather_true_random, GetMagickThreadId(), GetStringInfoDatum(), LockSemaphoreInfo(), MagickFalse, MaxEntropyExtent, O_BINARY, open_utf8(), random_info, ReadRandom(), _RandomInfo::semaphore, SetStringInfoDatum(), SetStringInfoLength(), StringToStringInfo(), and UnlockSemaphoreInfo().
Referenced by AcquireRandomInfo().
| MagickExport double GetPseudoRandomValue | ( | RandomInfo *magick_restrict | random_info | ) |
Definition at line 602 of file random.c.
References _RandomInfo::normalize, random_info, RandomROTL, and _RandomInfo::seed.
Referenced by AllocFxRt(), ExecuteRPN(), GenerateDifferentialNoise(), PlasmaPixel(), RandomThresholdImage(), RandomX(), RandomY(), SketchImage(), and SpreadImage().
| MagickPrivate double GetRandomInfoNormalize | ( | const RandomInfo * | random_info | ) |
Definition at line 642 of file random.c.
References _RandomInfo::normalize, and random_info.
| MagickPrivate unsigned long * GetRandomInfoSeed | ( | RandomInfo * | random_info | ) |
Definition at line 670 of file random.c.
References random_info, and _RandomInfo::seed.
| MagickExport StringInfo * GetRandomKey | ( | RandomInfo * | random_info, |
| const size_t | length | ||
| ) |
Definition at line 700 of file random.c.
References AcquireStringInfo(), GetStringInfoDatum(), random_info, and SetRandomKey().
Referenced by AcquireRandomInfo(), AcquireUniqueFileResource(), and ShredFile().
| MagickExport unsigned long GetRandomSecretKey | ( | const RandomInfo * | random_info | ) |
Definition at line 733 of file random.c.
References random_info, and _RandomInfo::secret_key.
Referenced by AddNoiseImage(), EvaluateImage(), EvaluateImages(), RandomThresholdImage(), SketchImage(), and SpreadImage().
| MagickExport double GetRandomValue | ( | RandomInfo * | random_info | ) |
Definition at line 758 of file random.c.
References random_info, and SetRandomKey().
|
inlinestatic |
Definition at line 850 of file random.c.
References GetStringInfoDatum(), GetStringInfoLength(), RandomFatalError, and ThrowFatalException.
Referenced by SetRandomKey().
| MagickPrivate MagickBooleanType RandomComponentGenesis | ( | void | ) |
Definition at line 790 of file random.c.
References AcquireSemaphoreInfo(), MagickTrue, and random_semaphore.
Referenced by MagickCoreGenesis().
| MagickPrivate void RandomComponentTerminus | ( | void | ) |
Definition at line 815 of file random.c.
References ActivateSemaphoreInfo(), random_semaphore, and RelinquishSemaphoreInfo().
Referenced by MagickCoreTerminus().
|
static |
Definition at line 324 of file random.c.
Referenced by GenerateEntropicChaos().
| MagickExport void SetRandomKey | ( | RandomInfo * | random_info, |
| const size_t | length, | ||
| unsigned char * | key | ||
| ) |
Definition at line 868 of file random.c.
References FinalizeSignature(), GetSignatureDigest(), GetSignatureDigestsize(), GetStringInfoDatum(), _RandomInfo::i, IncrementRandomNonce(), InitializeSignature(), LockSemaphoreInfo(), _RandomInfo::nonce, random_info, _RandomInfo::reservoir, _RandomInfo::semaphore, SetStringInfo(), _RandomInfo::signature_info, UnlockSemaphoreInfo(), and UpdateSignature().
Referenced by GetRandomKey(), and GetRandomValue().
| MagickExport void SetRandomSecretKey | ( | const unsigned long | key | ) |
Definition at line 945 of file random.c.
References secret_key.
| MagickExport void SetRandomTrueRandom | ( | const MagickBooleanType | true_random | ) |
Definition at line 974 of file random.c.
References gather_true_random.
|
extern |
Referenced by GenerateEntropicChaos().
|
static |
Definition at line 140 of file random.c.
Referenced by GenerateEntropicChaos(), and SetRandomTrueRandom().
|
static |
Definition at line 134 of file random.c.
Referenced by RandomComponentGenesis(), and RandomComponentTerminus().
|
static |
Definition at line 137 of file random.c.
Referenced by AcquireRandomInfo(), and SetRandomSecretKey().