File: Blob.tex

package info (click to toggle)
imagemagick 6:6.0.6.2-2.9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 33,284 kB
  • ctags: 14,844
  • sloc: ansic: 190,790; cpp: 17,203; sh: 8,740; perl: 4,190; makefile: 1,740; tcl: 459
file content (81 lines) | stat: -rw-r--r-- 3,863 bytes parent folder | download
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
78
79
80
81
\section{Magick::Blob}
\scriptsize{
\begin{verbatim}

Blob provides the means to contain any opaque data. It is named after the
term "Binary Large OBject" commonly used to describe unstructured data (such
as encoded images) which is stored in a database. While the function of Blob
is very simple (store a pointer and and size associated with allocated
data), the Blob class provides some very useful capabilities. In particular,
it is fully reference counted just like the Image class.

The Blob class supports value assignment while preserving any outstanding
earlier versions of the object. Since assignment is via a pointer
internally, Blob is efficient enough to be stored directly in an STL
container or any other data structure which requires assignment. In
particular, by storing a Blob in an associative container (such as STL's
'map') it is possible to create simple indexed in-memory "database" of
Blobs.

Magick++ currently uses Blob to contain encoded images (e.g. JPEG) as well
as ICC and IPTC profiles. Since Blob is a general-purpose class, it may be
used for other purposes as well.

The methods Blob provides are shown in the following table:

                                Blob Methods

 Method      Return Type Signature(s)             Description

 Blob                    void                     Default constructor

             const void*
                         Construct object with
             data_,      data, making a copy of
             size_t
             length_     the supplied data


             const Blob& Copy constructor
             blob_       (reference counted)


 operator=   Blob        const Blob& blob_        Assignment operator
                                                  (reference counted)

                                                  Update object contents,
                                                  making a copy of the
 update      void        const void* data_,       supplied data. Any
                         size_t length_
                                                  existing data in the
                                                  object is deallocated.

 data        const void* void                     Obtain pointer to data

 length      size_t      void                     Obtain data length

                                                  Update object contents,
                                                  using supplied pointer
                                                  directly (no copy) Any
                                                  existing data in the
                                                  object is deallocated.
                                                  The user must ensure that
                                                  the pointer supplied is
                                                  not deleted or otherwise
                         void* data_, size_t      modified after it has
                                                  been supplied to this
 updateNoCopyvoid        length_, Blob::Allocator method. The optional
                         allocator_ =
                         Blob::NewAllocator       allocator_ parameter
                                                  allows the user to
                                                  specify if the C
                                                  (MallocAllocator) or C++
                                                  (NewAllocator) memory
                                                  allocation system was
                                                  used to allocate the
                                                  memory. The default is to
                                                  use the C++ memory
                                                  allocator.

\end{verbatim}
}