PageRenderTime 13ms CodeModel.GetById 1ms app.highlight 9ms RepoModel.GetById 0ms app.codeStats 0ms

/dmagick/c/monitor.d

http://github.com/MikeWey/DMagick
D | 23 lines | 19 code | 4 blank | 0 comment | 5 complexity | 29ed7edfdced0ba6bd8df9fc079e1560 MD5 | raw file
 1module dmagick.c.monitor;
 2
 3import dmagick.c.image;
 4import dmagick.c.magickType;
 5
 6extern(C)
 7{
 8	alias MagickBooleanType function(const(char)*, const MagickOffsetType, const MagickSizeType, void*) MagickProgressMonitor;
 9
10	MagickProgressMonitor SetImageProgressMonitor(Image*, const MagickProgressMonitor, void*);
11	MagickProgressMonitor SetImageInfoProgressMonitor(ImageInfo*, const MagickProgressMonitor, void*);
12}
13
14static pure nothrow MagickBooleanType QuantumTick(const MagickOffsetType offset, const MagickSizeType span)
15{
16	if (span <= 100)
17		return(true);
18	if (offset == cast(MagickOffsetType) (span-1))
19		return(true);
20	if ((offset % (span/100)) == 0)
21		return(true);
22	return(false);
23}