• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Dirk Lemstra 2014
4 //
5 // Definition of resource limits.
6 //
7 
8 #if !defined(Magick_ResourceLimits_header)
9 #define Magick_ResourceLimits_header
10 
11 #include "Magick++/Include.h"
12 
13 namespace Magick
14 {
15   class MagickPPExport ResourceLimits
16   {
17   public:
18 
19     // Pixel cache limit in bytes. Requests for memory above this limit
20     // are automagically allocated on disk.
21     static void area(const MagickSizeType limit_);
22     static MagickSizeType area(void);
23 
24     // Pixel cache limit in bytes. Requests for memory above this limit
25     // will fail.
26     static void disk(const MagickSizeType limit_);
27     static MagickSizeType disk(void);
28 
29     // The maximum number of open pixel cache files. When this limit is
30     // exceeded, any subsequent pixels cached to disk are closed and reopened
31     // on demand. This behavior permits a large number of images to be accessed
32     // simultaneously on disk, but with a speed penalty due to repeated
33     // open/close calls.
34     static void file(const MagickSizeType limit_);
35     static MagickSizeType file(void);
36 
37     // The maximum height of an image.
38     static void height(const MagickSizeType limit_);
39     static MagickSizeType height(void);
40 
41     // Pixel cache limit in bytes.  Once this memory limit is exceeded,
42     // all subsequent pixels cache operations are to/from disk.
43     static void map(const MagickSizeType limit_);
44     static MagickSizeType map(void);
45 
46     // Pixel cache limit in bytes. Once this memory limit is exceeded,
47     // all subsequent pixels cache operations are to/from disk or to/from
48     // memory mapped files.
49     static void memory(const MagickSizeType limit_);
50     static MagickSizeType memory(void);
51 
52     // Limits the number of threads used in multithreaded operations.
53     static void thread(const MagickSizeType limit_);
54     static MagickSizeType thread(void);
55 
56     // Periodically yield the CPU for at least the time specified in
57     // milliseconds.
58     static void throttle(const MagickSizeType limit_);
59     static MagickSizeType throttle(void);
60 
61     // The maximum width of an image.
62     static void width(const MagickSizeType limit_);
63     static MagickSizeType width(void);
64 
65   private:
66     ResourceLimits(void);
67 
68   }; // class ResourceLimits
69 
70 } // Magick namespace
71 
72 #endif // Magick_ResourceLimits_header
73