File: ImageRef.h

package info (click to toggle)
imagemagick 8%3A6.9.11.60%2Bdfsg-1.6%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 76,816 kB
  • sloc: ansic: 349,503; cpp: 21,804; xml: 11,029; perl: 6,417; sh: 5,877; makefile: 3,042; tcl: 459
file content (77 lines) | stat: -rw-r--r-- 1,743 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
// Copyright Dirk Lemstra 2015
//
// Definition of an Image reference
//
// This is a private implementation class which should never be
// referenced by any user code.
//

#if !defined(Magick_ImageRef_header)
#define Magick_ImageRef_header

#include "Magick++/Include.h"
#include "Magick++/Thread.h"

namespace Magick
{
  class Options;

  //
  // Reference counted access to Image *
  //
  class MagickPPExport ImageRef
  {
    friend class Image;

  private:

    // Construct with null image and default options
    ImageRef(void);

    // Construct with an image pointer and default options
    ImageRef(MagickCore::Image *image_);

    // Construct with an image pointer and options
    ImageRef(MagickCore::Image *image_,const Options *options_);

    // Destroy image and options
    ~ImageRef(void);

    // Copy constructor and assignment are not supported
    ImageRef(const ImageRef&);
    ImageRef& operator=(const ImageRef&);

    // Retrieve image from reference
    void image(MagickCore::Image *image_);
    MagickCore::Image *&image(void);

    // Retrieve Options from reference
    void options(Options *options_);
    Options *options(void);

    MagickCore::Image *_image;    // ImageMagick Image
    Options           *_options;  // User-specified options
    ::ssize_t         _refCount;  // Reference count
    MutexLock         _mutexLock; // Mutex lock
  };

} // end of namespace Magick

//
// Inlines
//

inline MagickCore::Image *&Magick::ImageRef::image(void)
{
  return(_image);
}

inline Magick::Options *Magick::ImageRef::options(void)
{
  return(_options);
}

#endif // Magick_ImageRef_header