Magick++  6.9.3
ImageRef.h
Go to the documentation of this file.
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
4 // Copyright Dirk Lemstra 2015
5 //
6 // Definition of an Image reference
7 //
8 // This is a private implementation class which should never be
9 // referenced by any user code.
10 //
11 
12 #if !defined(Magick_ImageRef_header)
13 #define Magick_ImageRef_header
14 
15 #include "Magick++/Include.h"
16 #include "Magick++/Thread.h"
17 
18 namespace Magick
19 {
20  class Options;
21 
22  //
23  // Reference counted access to Image *
24  //
26  {
27  friend class Image;
28 
29  private:
30 
31  // Construct with null image and default options
32  ImageRef(void);
33 
34  // Construct with an image pointer and default options
35  ImageRef(MagickCore::Image *image_);
36 
37  // Construct with an image pointer and options
38  ImageRef(MagickCore::Image *image_,const Options *options_);
39 
40  // Destroy image and options
41  ~ImageRef(void);
42 
43  // Copy constructor and assignment are not supported
44  ImageRef(const ImageRef&);
45  ImageRef& operator=(const ImageRef&);
46 
47  // Retrieve image from reference
48  void image(MagickCore::Image *image_);
49  MagickCore::Image *&image(void);
50 
51  // Retrieve Options from reference
52  void options(Options *options_);
53  Options *options(void);
54 
55  MagickCore::Image *_image; // ImageMagick Image
56  Options *_options; // User-specified options
57  ::ssize_t _refCount; // Reference count
58  MutexLock _mutexLock; // Mutex lock
59  };
60 
61 } // end of namespace Magick
62 
63 //
64 // Inlines
65 //
66 
67 inline MagickCore::Image *&Magick::ImageRef::image(void)
68 {
69  return(_image);
70 }
71 
72 inline Magick::Options *Magick::ImageRef::options(void)
73 {
74  return(_options);
75 }
76 
77 #endif // Magick_ImageRef_header
#define MagickPPExport
Definition: Include.h:255
class MagickPPExport Image
Definition: Drawable.h:647
Definition: Blob.h:15