www/api/Magick++/ImageRef_8h_source.html
| Magick++ 7.1.0 |
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 //
5 // Copyright @ 2014 ImageMagick Studio LLC, a non-profit organization
6 // dedicated to making software imaging solutions freely available.
7 //
8 // Definition of an Image reference
9 //
10 // This is a private implementation class which should never be
11 // referenced by any user code.
12 //
13
14 #if !defined(Magick_ImageRef_header)
15 #define Magick_ImageRef_header
16
17 #include <string>
18 #include "Magick++/Include.h"
19 #include "Magick++/Thread.h"
20
21 namespace Magick
22 {
23class Options;
24
25//
26// Reference counted access to Image *
27//
28class MagickPPExport ImageRef
29 {
30public:
31
32// Construct with null image and default options
33ImageRef(void);
34
35// Construct with an image pointer and default options
36ImageRef(MagickCore::Image *image_);
37
38// Destroy image and options
39 ~ImageRef(void);
40
41// Decreases reference count and return the new count
42size_t decrease();
43
44// Retrieve image from reference
45MagickCore::Image *&image(void);
46
47// Increases reference count
48void increase();
49
50// Returns true if the reference count is more than one
51bool isShared();
52
53// Retrieve Options from reference
54void options(Options *options_);
55Options *options(void);
56
57// Tries to replaces the images with the specified image, returns
58// a new instance when the current image is shared.
59static ImageRef *replaceImage(ImageRef *imgRef,
60MagickCore::Image *replacement_);
61
62// Image signature. Set force_ to true in order to re-calculate
63// the signature regardless of whether the image data has been
64// modified.
65 std::string signature(const bool force_=false);
66
67private:
68
69// Construct with an image pointer and options
70ImageRef(MagickCore::Image *image_,const Options *options_);
71
72// Copy constructor and assignment are not supported
74
75ImageRef& operator=(const ImageRef&);
76
77MagickCore::Image *_image; // ImageMagick Image
78MutexLock _mutexLock; // Mutex lock
79Options *_options; // User-specified options
80 ::ssize_t _refCount; // Reference count
81 };
82
83 } // end of namespace Magick
84
85 #endif // Magick_ImageRef_header
Definition: Options.h:30
Definition: ImageRef.h:28
Definition: Thread.h:29
#define MagickPPExport
Definition: Include.h:297
class MagickPPExport Image
Definition: Drawable.h:722
Definition: Blob.h:17