11#define MAGICKCORE_IMPLEMENTATION 1
12#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
14#include "Magick++/Include.h"
15#include "Magick++/BlobRef.h"
16#include "Magick++/Exception.h"
17#include "Magick++/Thread.h"
20Magick::BlobRef::BlobRef(
const void* data_,
const size_t length_)
21 : allocator(Magick::Blob::NewAllocator),
27 if (data_ != (
const void*) NULL)
29 data=
new unsigned char[length_];
30 memcpy(data,data_,length_);
34Magick::BlobRef::~BlobRef(
void)
36 if (allocator == Magick::Blob::NewAllocator)
38 delete[]
static_cast<unsigned char*
>(data);
41 else if (allocator == Magick::Blob::MallocAllocator)
42 data=(
void *) RelinquishMagickMemory(data);
45size_t Magick::BlobRef::decrease()
54 throwExceptionExplicit(MagickCore::OptionError,
55 "Invalid call to decrease");
63void Magick::BlobRef::increase()