• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Dirk Lemstra 2014-2018
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     // The maximum number of images in an image list.
42     static void listLength(const MagickSizeType limit_);
43     static MagickSizeType listLength();
44 
45     // Pixel cache limit in bytes.  Once this memory limit is exceeded,
46     // all subsequent pixels cache operations are to/from disk.
47     static void map(const MagickSizeType limit_);
48     static MagickSizeType map(void);
49 
50     // Pixel cache limit in bytes. Once this memory limit is exceeded,
51     // all subsequent pixels cache operations are to/from disk or to/from
52     // memory mapped files.
53     static void memory(const MagickSizeType limit_);
54     static MagickSizeType memory(void);
55 
56     // Limits the number of threads used in multithreaded operations.
57     static void thread(const MagickSizeType limit_);
58     static MagickSizeType thread(void);
59 
60     // Periodically yield the CPU for at least the time specified in
61     // milliseconds.
62     static void throttle(const MagickSizeType limit_);
63     static MagickSizeType throttle(void);
64 
65     // The maximum width of an image.
66     static void width(const MagickSizeType limit_);
67     static MagickSizeType width(void);
68 
69   private:
70     ResourceLimits(void);
71 
72   }; // class ResourceLimits
73 
74 } // Magick namespace
75 
76 #endif // Magick_ResourceLimits_header
77