00001
00002
00003
00004
00005
00006
00007
00008 #define MAGICK_IMPLEMENTATION 1
00009
00010
#include "Magick++/Include.h"
00011
#include <string>
00012
#include <string.h>
00013
00014
#include "Magick++/Montage.h"
00015
#include "Magick++/Functions.h"
00016
00017 Magick::Montage::Montage (
void )
00018 : _backgroundColor("#ffffff"),
00019 _compose(
OverCompositeOp),
00020 _fileName(),
00021 _fill("#000000ff"),
00022 _font(),
00023 _geometry("120x120+4+3>"),
00024 _gravity(
CenterGravity),
00025 _label(),
00026 _pointSize(12),
00027 _shadow(false),
00028 _stroke(),
00029 _texture(),
00030 _tile("6x4"),
00031 _title(),
00032 _transparentColor()
00033 {
00034 }
00035
00036 Magick::Montage::~Montage(
void )
00037 {
00038
00039 }
00040
00041 Magick::MontageFramed::MontageFramed (
void )
00042 : _borderColor("#dfdfdf"),
00043 _borderWidth(0),
00044 _frame(),
00045 _matteColor("#bdbdbd")
00046 {
00047 }
00048
00049 Magick::MontageFramed::~MontageFramed (
void )
00050 {
00051
00052 }
00053
00054 void Magick::Montage::updateMontageInfo (
MontageInfo &montageInfo_ )
const
00055
{
00056
00057 memset(&montageInfo_,0,
sizeof(
MontageInfo));
00058
00059
00060 montageInfo_.
background_color =
_backgroundColor;
00061
00062 montageInfo_.
border_color =
Color();
00063
00064 montageInfo_.
border_width = 0;
00065
00066
_fileName.copy( montageInfo_.
filename,
MaxTextExtent - 1 );
00067 montageInfo_.
filename[
_fileName.length() ] = 0;
00068
00069 montageInfo_.
fill =
_fill;
00070
00071
if (
_font.length() != 0 )
00072
Magick::CloneString( &montageInfo_.
font,
_font );
00073
else
00074 montageInfo_.
font=(
char *)
RelinquishMagickMemory(montageInfo_.
font);
00075
00076 montageInfo_.
frame=(
char *) montageInfo_.
frame;
00077
00078
if (
_geometry.
isValid() )
00079
Magick::CloneString( &montageInfo_.
geometry,
_geometry );
00080
else
00081 montageInfo_.
geometry=(
char *)
00082
RelinquishMagickMemory(montageInfo_.
geometry);
00083
00084 montageInfo_.
gravity =
_gravity;
00085
00086 montageInfo_.
matte_color =
Color();
00087
00088 montageInfo_.
pointsize =
_pointSize;
00089
00090 montageInfo_.
shadow = static_cast<MagickBooleanType>
00091 (
_shadow ?
MagickTrue :
MagickFalse);
00092
00093 montageInfo_.
signature =
MagickSignature;
00094
00095 montageInfo_.
stroke =
_stroke;
00096
00097
if (
_texture.length() != 0 )
00098
Magick::CloneString( &montageInfo_.
texture,
_texture );
00099
else
00100 montageInfo_.
texture=(
char *)
RelinquishMagickMemory(montageInfo_.
texture);
00101
00102
if (
_tile.
isValid() )
00103
Magick::CloneString( &montageInfo_.
tile,
_tile );
00104
else
00105 montageInfo_.
tile=(
char *)
RelinquishMagickMemory(montageInfo_.
tile);
00106
00107
if (
_title.length() != 0 )
00108
Magick::CloneString( &montageInfo_.
title,
_title );
00109
else
00110 montageInfo_.
title=(
char *)
RelinquishMagickMemory(montageInfo_.
title);
00111 }
00112
00113
00114
00115
00116
00117
void
00118 Magick::MontageFramed::updateMontageInfo (
MontageInfo &montageInfo_ )
const
00119
{
00120
00121 Montage::updateMontageInfo ( montageInfo_ );
00122
00123
00124 montageInfo_.
border_color =
_borderColor;
00125
00126 montageInfo_.
border_width =
_borderWidth;
00127
00128
if (
_frame.
isValid() )
00129
Magick::CloneString( &montageInfo_.
frame,
_frame );
00130
else
00131 montageInfo_.
frame=(
char *)
RelinquishMagickMemory(montageInfo_.
frame);
00132
00133 montageInfo_.
matte_color =
_matteColor;
00134 }