Powered by Pair ImageMagick logo
Image Magick
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

ImageMagick-6.1.1/Magick++/lib/Montage.cpp

Go to the documentation of this file.
00001 // This may look like C code, but it is really -*- C++ -*- 00002 // 00003 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 00004 // 00005 // Implementation of Montage 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 // Nothing to do 00039 } 00040 00041 Magick::MontageFramed::MontageFramed ( void ) 00042 : _borderColor("#dfdfdf"), 00043 _borderWidth(0), 00044 _frame(), 00045 _matteColor("#bdbdbd") 00046 { 00047 } 00048 00049 /* virtual */ Magick::MontageFramed::~MontageFramed ( void ) 00050 { 00051 // Nothing to do 00052 } 00053 00054 void Magick::Montage::updateMontageInfo ( MontageInfo &montageInfo_ ) const 00055 { 00056 00057 memset(&montageInfo_,0,sizeof(MontageInfo)); 00058 00059 // background_color 00060 montageInfo_.background_color = _backgroundColor; 00061 // border_color 00062 montageInfo_.border_color = Color(); 00063 // border_width 00064 montageInfo_.border_width = 0; 00065 // filename 00066 _fileName.copy( montageInfo_.filename, MaxTextExtent - 1 ); 00067 montageInfo_.filename[ _fileName.length() ] = 0; // null terminate 00068 // fill 00069 montageInfo_.fill = _fill; 00070 // font 00071 if ( _font.length() != 0 ) 00072 Magick::CloneString( &montageInfo_.font, _font ); 00073 else 00074 montageInfo_.font=(char *) RelinquishMagickMemory(montageInfo_.font); 00075 // frame 00076 montageInfo_.frame=(char *) montageInfo_.frame; 00077 // geometry 00078 if ( _geometry.isValid() ) 00079 Magick::CloneString( &montageInfo_.geometry, _geometry ); 00080 else 00081 montageInfo_.geometry=(char *) 00082 RelinquishMagickMemory(montageInfo_.geometry); 00083 // gravity 00084 montageInfo_.gravity = _gravity; 00085 // matte_color 00086 montageInfo_.matte_color = Color(); 00087 // pointsize 00088 montageInfo_.pointsize = _pointSize; 00089 // shadow 00090 montageInfo_.shadow = static_cast<MagickBooleanType> 00091 (_shadow ? MagickTrue : MagickFalse); 00092 // signature (validity stamp) 00093 montageInfo_.signature = MagickSignature; 00094 // stroke 00095 montageInfo_.stroke = _stroke; 00096 // texture 00097 if ( _texture.length() != 0 ) 00098 Magick::CloneString( &montageInfo_.texture, _texture ); 00099 else 00100 montageInfo_.texture=(char *) RelinquishMagickMemory(montageInfo_.texture); 00101 // tile 00102 if ( _tile.isValid() ) 00103 Magick::CloneString( &montageInfo_.tile, _tile ); 00104 else 00105 montageInfo_.tile=(char *) RelinquishMagickMemory(montageInfo_.tile); 00106 // title 00107 if ( _title.length() != 0 ) 00108 Magick::CloneString( &montageInfo_.title, _title ); 00109 else 00110 montageInfo_.title=(char *) RelinquishMagickMemory(montageInfo_.title); 00111 } 00112 00113 // 00114 // Implementation of MontageFramed 00115 // 00116 00117 /* virtual */ void 00118 Magick::MontageFramed::updateMontageInfo ( MontageInfo &montageInfo_ ) const 00119 { 00120 // Do base updates 00121 Montage::updateMontageInfo ( montageInfo_ ); 00122 00123 // border_color 00124 montageInfo_.border_color = _borderColor; 00125 // border_width 00126 montageInfo_.border_width = _borderWidth; 00127 // frame 00128 if ( _frame.isValid() ) 00129 Magick::CloneString( &montageInfo_.frame, _frame ); 00130 else 00131 montageInfo_.frame=(char *) RelinquishMagickMemory(montageInfo_.frame); 00132 // matte_color 00133 montageInfo_.matte_color = _matteColor; 00134 }

Generated on Mon Oct 25 13:41:12 2004 for ImageMagick by doxygen 1.3.7
ImageMagick Copyright © 2004, ImageMagick Studio LLC