Changeset 1179:e75e2d589069


Ignore:
Timestamp:
03/15/09 12:27:42 (3 years ago)
Author:
niam
Branch:
default
Message:

organized includes in graphicsDraw, graphicsImage; minor include cleanup in other modules

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/libdodo/cgiDialogue.h

    r1167 r1179  
    3636 
    3737#include <libdodo/cgi.h> 
    38 #include <libdodo/cgiExchange.h> 
    3938 
    4039namespace dodo 
     
    5049        namespace cgi 
    5150        { 
     51                class exchange; 
     52 
    5253                /** 
    5354                 * @note 
  • trunk/include/libdodo/cgiFastExchange.h

    r1177 r1179  
    3434 
    3535#ifdef FASTCGI_EXT 
    36 #include <libdodo/cgiExchange.h> 
    3736#include <libdodo/types.h> 
    3837 
     
    4140        namespace cgi 
    4241        { 
     42                class exchange; 
     43 
    4344                namespace fast 
    4445                { 
  • trunk/include/libdodo/cgiServer.h

    r1167 r1179  
    3333#include <libdodo/directives.h> 
    3434 
    35 #include <libdodo/cgiExchange.h> 
    36  
    3735namespace dodo 
    3836{ 
    3937        namespace cgi 
    4038        { 
     39                class exchange; 
     40 
    4141                /** 
    4242                 * @typedef serverHandler 
  • trunk/include/libdodo/dataBaseSqlite.h

    r1177 r1179  
    3434 
    3535#ifdef SQLITE3_EXT 
     36#include <libdodo/types.h> 
    3637#include <libdodo/dataBaseSqlConstructor.h> 
    3738 
  • trunk/include/libdodo/dataFormatJsonProcessor.h

    r1175 r1179  
    3434 
    3535#include <libdodo/types.h> 
    36 #include <libdodo/dataFormatJsonNode.h> 
    3736 
    3837namespace dodo 
     
    4443                        namespace json 
    4544                        { 
     45                                class node; 
     46 
    4647                                /** 
    4748                                 * @class processor 
  • trunk/include/libdodo/dataFormatXmlProcessor.h

    r1175 r1179  
    3434 
    3535#include <libdodo/types.h> 
    36 #include <libdodo/dataFormatXmlNode.h> 
    3736 
    3837namespace dodo 
     
    4443                        namespace xml 
    4544                        { 
     45                                class node; 
     46 
    4647                                /** 
    4748                                 * @struct __node 
  • trunk/include/libdodo/dataTplProcessor.h

    r1177 r1179  
    3434 
    3535#include <libdodo/types.h> 
    36 #include <libdodo/ioChannel.h> 
    3736 
    3837namespace dodo 
    3938{ 
     39        namespace io 
     40        { 
     41                class channel; 
     42        }; 
     43 
    4044        namespace data 
    4145        { 
  • trunk/include/libdodo/graphicsDraw.h

    r1164 r1179  
    3434 
    3535#ifdef IMAGEMAGICK_EXT 
    36  
    37 #ifndef IMAGEMAGICK_PRE_63 
    38  
    39 #include <magick/MagickCore.h> 
    40  
    41 #else 
    42  
    43 #include <magick/ImageMagick.h> 
    44  
    45 #endif 
    46  
    47 #include <math.h> 
    48  
    4936#include <libdodo/types.h> 
    50 #include <libdodo/graphicsImage.h> 
    51 #include <libdodo/graphicsColor.h> 
    52 #include <libdodo/graphicsDrawEx.h> 
    53 #include <libdodo/xexec.h> 
    5437 
    5538namespace dodo 
     
    5740        namespace graphics 
    5841        { 
     42                class image; 
     43 
    5944                /** 
    6045                 * class point 
     
    213198        }; 
    214199}; 
    215  
    216200#endif 
    217201 
  • trunk/include/libdodo/graphicsImage.h

    r1164 r1179  
    3434 
    3535#ifdef IMAGEMAGICK_EXT 
    36  
    37 #ifndef IMAGEMAGICK_PRE_63 
    38  
    39 #include <magick/MagickCore.h> 
    40  
    41 #else 
    42  
    43 #include <magick/ImageMagick.h> 
    44  
    45 #endif 
    46  
    47 #include <math.h> 
    48  
    4936#include <libdodo/types.h> 
    5037#include <libdodo/graphicsColor.h> 
    51 #include <libdodo/graphicsImageEx.h> 
    5238#include <libdodo/xexec.h> 
    5339 
     
    5743        { 
    5844                /** 
     45                 * @struct __imageHandle 
     46                 * @brief defines internal handlers for image processing library 
     47                 */ 
     48                struct __imageHandle; 
     49 
     50                /** 
    5951                 * @enum imageOperTypeEnum defines type of operation for hook 
    6052                 */ 
     
    7163                 */ 
    7264                class __xexecImageCollectedData 
    73  
    7465#ifndef GRAPHICS_WO_XEXEC 
    75  
    7666                        : public __xexecCollectedData 
    77  
    7867#endif 
    7968                { 
    8069                  public: 
    8170 
     71                        /** 
     72                         * constructor 
     73                         */ 
     74                        __xexecImageCollectedData(); 
     75 
    8276#ifndef GRAPHICS_WO_XEXEC 
    83  
    8477                        /** 
    8578                         * constructor 
     
    8982                        __xexecImageCollectedData(xexec *executor, 
    9083                                                                          short execObject); 
    91  
    92 #endif 
    93  
    94                         ImageInfo * imInfo; ///< image info handler 
    95                         Image *imHandle;    ///< image handler 
     84#endif 
     85 
     86                        /** 
     87                         * destructor 
     88                         */ 
     89                        ~__xexecImageCollectedData(); 
     90 
     91                        __imagecHandle *handle; ///< ImageMagic handle 
    9692                }; 
    9793 
     
    193189                 */ 
    194190                class image 
    195  
    196191#ifndef GRAPHICS_WO_XEXEC 
    197  
    198192                        : public xexec 
    199  
    200193#endif 
    201194                { 
  • trunk/src/dataFormatXmlProcessor.cc

    r1177 r1179  
    3636 
    3737#include <libdodo/dataFormatXmlProcessor.h> 
     38#include <libdodo/dataFormatXmlNode.h> 
    3839#include <libdodo/dataFormatXmlProcessorEx.h> 
    3940 
     
    7475using namespace dodo::data::format::xml; 
    7576 
     77#ifdef LIBXML2_EXT 
    7678__node::__node(xmlNodePtr node) : node(node) 
    7779{ 
     
    8385{ 
    8486} 
     87#endif 
    8588 
    8689//------------------------------------------------------------------- 
  • trunk/src/graphicsDraw.cc

    r1162 r1179  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
     32#ifdef IMAGEMAGICK_EXT 
     33#ifndef IMAGEMAGICK_PRE_63 
     34#include <magick/MagickCore.h> 
     35#else 
     36#include <magick/ImageMagick.h> 
     37#endif 
     38#include <math.h> 
     39 
    3040#include <libdodo/graphicsDraw.h> 
    31  
    32 #ifdef IMAGEMAGICK_EXT 
     41#include <libdodo/types.h> 
     42#include <libdodo/graphicsImage.h> 
     43#include <libdodo/graphicsColor.h> 
     44#include <libdodo/graphicsDrawEx.h> 
    3345 
    3446using namespace dodo::graphics; 
     
    8698 
    8799#ifndef IMAGEMAGICK_PRE_63 
    88  
    89100        DrawInfo *di = AcquireDrawInfo(); 
    90  
    91101#else 
    92  
    93102        DrawInfo *di = CloneDrawInfo(im->collectedData.imInfo, NULL); 
    94  
    95103#endif 
    96104 
     
    196204 
    197205#ifndef IMAGEMAGICK_PRE_63 
    198  
    199206        DrawInfo *di = AcquireDrawInfo(); 
    200  
    201207#else 
    202  
    203208        DrawInfo *di = CloneDrawInfo(im->collectedData.imInfo, NULL); 
    204  
    205209#endif 
    206210 
     
    329333 
    330334#ifndef IMAGEMAGICK_PRE_63 
    331  
    332335        DrawInfo *di = AcquireDrawInfo(); 
    333  
    334336#else 
    335  
    336337        DrawInfo *di = CloneDrawInfo(im->collectedData.imInfo, NULL); 
    337  
    338338#endif 
    339339 
     
    356356        DestroyDrawInfo(di); 
    357357} 
    358  
    359 #endif 
    360  
    361 //------------------------------------------------------------------- 
    362  
     358#endif 
     359 
     360//------------------------------------------------------------------- 
     361 
  • trunk/src/graphicsImage.cc

    r1162 r1179  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
     32#ifdef IMAGEMAGICK_EXT 
     33#ifndef IMAGEMAGICK_PRE_63 
     34#include <magick/MagickCore.h> 
     35#else 
     36#include <magick/ImageMagick.h> 
     37#endif 
     38 
     39#include <math.h> 
     40 
    3041#include <libdodo/graphicsImage.h> 
    31  
    32 #ifdef IMAGEMAGICK_EXT 
     42#include <libdodo/types.h> 
     43#include <libdodo/graphicsColor.h> 
     44#include <libdodo/graphicsImageEx.h> 
     45#include <libdodo/xexec.h> 
    3346 
    3447namespace dodo 
     
    3750        { 
    3851                __image_init__ __image_init_object__; 
     52 
     53                struct __imageHandle 
     54                { 
     55                        ImageInfo *imInfo; ///< image info handler 
     56                        Image     *imHandle;    ///< image handler 
     57                }; 
    3958        }; 
    4059}; 
     
    4564 
    4665#ifndef GRAPHICS_WO_XEXEC 
    47  
    4866__xexecImageCollectedData::__xexecImageCollectedData(xexec *executor, 
    49                                                                                                          short execObject) : __xexecCollectedData(executor, execObject) 
    50 { 
    51 } 
    52  
    53 #endif 
     67                                                                                                         short execObject) : __xexecCollectedData(executor, execObject), 
     68                                                                                                                                                 handle(new __imageHandle) 
     69{ 
     70} 
     71#endif 
     72 
     73//------------------------------------------------------------------- 
     74 
     75__xexecImageCollectedData::__xexecImageCollectedData() : handle(new __imageHandle) 
     76{ 
     77} 
     78 
     79//------------------------------------------------------------------- 
     80 
     81__xexecImageCollectedData::~__xexecImageCollectedData() 
     82{ 
     83        delete handle; 
     84} 
    5485 
    5586//------------------------------------------------------------------- 
     
    5889{ 
    5990        if (IsMagickInstantiated() == MagickFalse) 
     91        { 
    6092#ifndef IMAGEMAGICK_PRE_63 
    61  
    62         { 
    6393                MagickCoreGenesis(NULL, MagickFalse); 
    64         } 
    65  
    6694#else 
    67  
    68         { 
    6995                InitializeMagick(NULL); 
    70         } 
    71 #endif 
     96#endif 
     97        } 
    7298 
    7399        SetFatalErrorHandler(imErrorHandler); 
     
    81107{ 
    82108        if (IsMagickInstantiated() == MagickTrue) 
     109        { 
    83110#ifndef IMAGEMAGICK_PRE_63 
    84  
    85         { 
    86111                MagickCoreTerminus(); 
    87         } 
    88  
    89112#else 
    90  
    91         { 
    92113                DestroyMagick(); 
    93         } 
    94  
    95 #endif 
     114#endif 
     115        } 
    96116} 
    97117 
     
    172192 
    173193image::image(image &a_image) 
    174  
    175 #ifndef GRAPHICS_WO_XEXEC 
    176  
     194#ifndef GRAPHICS_WO_XEXEC 
    177195        : collectedData(this, XEXEC_OBJECT_GRAPHICSIMAGE) 
    178  
    179196#endif 
    180197{ 
     
    184201 
    185202image::image() 
    186  
    187 #ifndef GRAPHICS_WO_XEXEC 
    188  
     203#ifndef GRAPHICS_WO_XEXEC 
    189204        : collectedData(this, XEXEC_OBJECT_GRAPHICSIMAGE) 
    190  
    191 #endif 
    192 { 
    193         collectedData.imHandle = NULL; 
     205#endif 
     206{ 
     207        collectedData.handle->imHandle = NULL; 
    194208 
    195209#ifndef IMAGEMAGICK_PRE_63 
    196  
    197         collectedData.imInfo = AcquireImageInfo(); 
    198  
     210        collectedData.handle->imInfo = AcquireImageInfo(); 
    199211#else 
    200  
    201         collectedData.imInfo = CloneImageInfo(NULL); 
    202  
     212        collectedData.handle->imInfo = CloneImageInfo(NULL); 
    203213#endif 
    204214} 
     
    208218image::~image() 
    209219{ 
    210         if (collectedData.imHandle != NULL) 
    211         { 
    212                 DestroyImage(collectedData.imHandle); 
    213         } 
    214  
    215         DestroyImageInfo(collectedData.imInfo); 
     220        if (collectedData.handle->imHandle != NULL) 
     221        { 
     222                DestroyImage(collectedData.handle->imHandle); 
     223        } 
     224 
     225        DestroyImageInfo(collectedData.handle->imInfo); 
    216226        DestroyExceptionInfo(&exInfo); 
    217227} 
     
    235245 
    236246        GetExceptionInfo(&exInfo); 
    237         GetImageInfo(collectedData.imInfo); 
    238  
    239         strncpy(collectedData.imInfo->filename, str.c_str(), size); 
    240  
    241         if (collectedData.imHandle != NULL) 
    242         { 
    243                 DestroyImage(collectedData.imHandle); 
    244         } 
    245  
    246         collectedData.imHandle = ReadImage(collectedData.imInfo, &exInfo); 
    247         if (collectedData.imHandle == NULL) 
     247        GetImageInfo(collectedData.handle->imInfo); 
     248 
     249        strncpy(collectedData.handle->imInfo->filename, str.c_str(), size); 
     250 
     251        if (collectedData.handle->imHandle != NULL) 
     252        { 
     253                DestroyImage(collectedData.handle->imHandle); 
     254        } 
     255 
     256        collectedData.handle->imHandle = ReadImage(collectedData.handle->imInfo, &exInfo); 
     257        if (collectedData.handle->imHandle == NULL) 
    248258        { 
    249259                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_READ, exception::ERRNO_IMAGEMAGICK, exInfo.error_number, exInfo.reason, __LINE__, __FILE__, exInfo.description); 
    250260        } 
    251261 
    252         collectedData.imInfo->compression = collectedData.imHandle->compression; 
    253         collectedData.imInfo->quality = collectedData.imHandle->quality; 
    254  
    255         strcpy(collectedData.imInfo->magick, collectedData.imHandle->magick); 
     262        collectedData.handle->imInfo->compression = collectedData.handle->imHandle->compression; 
     263        collectedData.handle->imInfo->quality = collectedData.handle->imHandle->quality; 
     264 
     265        strcpy(collectedData.handle->imInfo->magick, collectedData.handle->imHandle->magick); 
    256266 
    257267#ifndef GRAPHICS_WO_XEXEC 
     
    271281 
    272282        GetExceptionInfo(&exInfo); 
    273         GetImageInfo(collectedData.imInfo); 
    274  
    275         if (collectedData.imHandle != NULL) 
    276         { 
    277                 DestroyImage(collectedData.imHandle); 
    278         } 
    279  
    280         collectedData.imHandle = BlobToImage(collectedData.imInfo, data.data(), data.size(), &exInfo); 
    281         if (collectedData.imHandle == NULL) 
     283        GetImageInfo(collectedData.handle->imInfo); 
     284 
     285        if (collectedData.handle->imHandle != NULL) 
     286        { 
     287                DestroyImage(collectedData.handle->imHandle); 
     288        } 
     289 
     290        collectedData.handle->imHandle = BlobToImage(collectedData.handle->imInfo, data.data(), data.size(), &exInfo); 
     291        if (collectedData.handle->imHandle == NULL) 
    282292        { 
    283293                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_READ, exception::ERRNO_IMAGEMAGICK, exInfo.error_number, exInfo.reason, __LINE__, __FILE__, exInfo.description); 
    284294        } 
    285295 
    286         collectedData.imInfo->compression = collectedData.imHandle->compression; 
    287         collectedData.imInfo->quality = collectedData.imHandle->quality; 
    288  
    289         strcpy(collectedData.imInfo->magick, collectedData.imHandle->magick); 
     296        collectedData.handle->imInfo->compression = collectedData.handle->imHandle->compression; 
     297        collectedData.handle->imInfo->quality = collectedData.handle->imHandle->quality; 
     298 
     299        strcpy(collectedData.handle->imInfo->magick, collectedData.handle->imHandle->magick); 
    290300 
    291301#ifndef GRAPHICS_WO_XEXEC 
     
    310320 
    311321        GetExceptionInfo(&exInfo); 
    312         GetImageInfo(collectedData.imInfo); 
    313  
    314         if (collectedData.imHandle != NULL) 
    315         { 
    316                 DestroyImage(collectedData.imHandle); 
    317         } 
    318  
    319         collectedData.imHandle = ConstituteImage(info.width, info.height, mappingStArr[info.mapping], pixelSizeStArr[info.pixelSize], info.data, &exInfo); 
    320         if (collectedData.imHandle == NULL) 
     322        GetImageInfo(collectedData.handle->imInfo); 
     323 
     324        if (collectedData.handle->imHandle != NULL) 
     325        { 
     326                DestroyImage(collectedData.handle->imHandle); 
     327        } 
     328 
     329        collectedData.handle->imHandle = ConstituteImage(info.width, info.height, mappingStArr[info.mapping], pixelSizeStArr[info.pixelSize], info.data, &exInfo); 
     330        if (collectedData.handle->imHandle == NULL) 
    321331        { 
    322332                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_READ, exception::ERRNO_IMAGEMAGICK, exInfo.error_number, exInfo.reason, __LINE__, __FILE__, exInfo.description); 
    323333        } 
    324334 
    325         collectedData.imInfo->compression = collectedData.imHandle->compression; 
    326         collectedData.imInfo->quality = collectedData.imHandle->quality; 
    327  
    328         strcpy(collectedData.imInfo->magick, collectedData.imHandle->magick); 
     335        collectedData.handle->imInfo->compression = collectedData.handle->imHandle->compression; 
     336        collectedData.handle->imInfo->quality = collectedData.handle->imHandle->quality; 
     337 
     338        strcpy(collectedData.handle->imInfo->magick, collectedData.handle->imHandle->magick); 
    329339 
    330340#ifndef GRAPHICS_WO_XEXEC 
     
    347357 
    348358        GetExceptionInfo(&exInfo); 
    349         GetImageInfo(collectedData.imInfo); 
    350  
    351         if (collectedData.imHandle != NULL) 
    352         { 
    353                 DestroyImage(collectedData.imHandle); 
     359        GetImageInfo(collectedData.handle->imInfo); 
     360 
     361        if (collectedData.handle->imHandle != NULL) 
     362        { 
     363                DestroyImage(collectedData.handle->imHandle); 
    354364        } 
    355365 
     
    367377        bg.index = 0; 
    368378 
    369         collectedData.imHandle = NewMagickImage(collectedData.imInfo, width, height, &bg); 
    370         if (collectedData.imHandle == NULL) 
     379        collectedData.handle->imHandle = NewMagickImage(collectedData.handle->imInfo, width, height, &bg); 
     380        if (collectedData.handle->imHandle == NULL) 
    371381        { 
    372382                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_CREATE, exception::ERRNO_IMAGEMAGICK, exInfo.error_number, exInfo.reason, __LINE__, __FILE__, exInfo.description); 
    373383        } 
    374384 
    375         collectedData.imInfo->compression = collectedData.imHandle->compression; 
    376         collectedData.imInfo->quality = collectedData.imHandle->quality; 
    377  
    378         strcpy(collectedData.imInfo->magick, collectedData.imHandle->magick); 
     385        collectedData.handle->imInfo->compression = collectedData.handle->imHandle->compression; 
     386        collectedData.handle->imInfo->quality = collectedData.handle->imHandle->quality; 
     387 
     388        strcpy(collectedData.handle->imInfo->magick, collectedData.handle->imHandle->magick); 
    379389 
    380390#ifndef GRAPHICS_WO_XEXEC 
     
    393403        } 
    394404 
    395         if (collectedData.imHandle == NULL) 
     405        if (collectedData.handle->imHandle == NULL) 
    396406        { 
    397407                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_SETTYPE, exception::ERRNO_IMAGEMAGICK, IMAGEEX_EMPTYIMAGE, GRAPHICSIMAGEEX_EMPTYIMAGE_STR, __LINE__, __FILE__); 
    398408        } 
    399409 
    400         if (SetImageType(collectedData.imHandle, typeStArr[type]) == MagickFalse) 
     410        if (SetImageType(collectedData.handle->imHandle, typeStArr[type]) == MagickFalse) 
    401411        { 
    402412                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_SETTYPE, exception::ERRNO_IMAGEMAGICK, IMAGEEX_CANNOTSETTYPE, GRAPHICSIMAGEEX_CANNOTSETTYPE_STR, __LINE__, __FILE__); 
     
    409419image::setAlpha() 
    410420{ 
    411         if (collectedData.imHandle == NULL) 
     421        if (collectedData.handle->imHandle == NULL) 
    412422        { 
    413423                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_SETALPHA, exception::ERRNO_IMAGEMAGICK, IMAGEEX_EMPTYIMAGE, GRAPHICSIMAGEEX_EMPTYIMAGE_STR, __LINE__, __FILE__); 
    414424        } 
    415425 
    416         collectedData.imHandle->matte = MagickTrue; 
     426        collectedData.handle->imHandle->matte = MagickTrue; 
    417427} 
    418428 
     
    422432image::removeAlpha() 
    423433{ 
    424         if (collectedData.imHandle == NULL) 
     434        if (collectedData.handle->imHandle == NULL) 
    425435        { 
    426436                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_REMOVEALPHA, exception::ERRNO_IMAGEMAGICK, IMAGEEX_EMPTYIMAGE, GRAPHICSIMAGEEX_EMPTYIMAGE_STR, __LINE__, __FILE__); 
    427437        } 
    428438 
    429         collectedData.imHandle->matte = MagickFalse; 
     439        collectedData.handle->imHandle->matte = MagickFalse; 
    430440} 
    431441 
     
    435445image::setOpacity(unsigned short opacity) 
    436446{ 
    437         if (collectedData.imHandle == NULL) 
     447        if (collectedData.handle->imHandle == NULL) 
    438448        { 
    439449                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_SETOPACITY, exception::ERRNO_IMAGEMAGICK, IMAGEEX_EMPTYIMAGE, GRAPHICSIMAGEEX_EMPTYIMAGE_STR, __LINE__, __FILE__); 
    440450        } 
    441451 
    442         SetImageOpacity(collectedData.imHandle, opacity); 
     452        SetImageOpacity(collectedData.handle->imHandle, opacity); 
    443453} 
    444454 
     
    448458image::setBackgroundColor(__color background) 
    449459{ 
    450         if (collectedData.imHandle == NULL) 
     460        if (collectedData.handle->imHandle == NULL) 
    451461        { 
    452462                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_SETBACKGROUNDCOLOR, exception::ERRNO_IMAGEMAGICK, IMAGEEX_EMPTYIMAGE, GRAPHICSIMAGEEX_EMPTYIMAGE_STR, __LINE__, __FILE__); 
    453463        } 
    454464 
    455         collectedData.imHandle->background_color.red = background.red; 
    456         collectedData.imHandle->background_color.green = background.green; 
    457         collectedData.imHandle->background_color.blue = background.blue; 
    458         collectedData.imHandle->background_color.opacity = background.opacity; 
    459  
    460         SetImageBackgroundColor(collectedData.imHandle); 
     465        collectedData.handle->imHandle->background_color.red = background.red; 
     466        collectedData.handle->imHandle->background_color.green = background.green; 
     467        collectedData.handle->imHandle->background_color.blue = background.blue; 
     468        collectedData.handle->imHandle->background_color.opacity = background.opacity; 
     469 
     470        SetImageBackgroundColor(collectedData.handle->imHandle); 
    461471} 
    462472 
     
    466476image::close() 
    467477{ 
    468         if (collectedData.imHandle != NULL) 
    469         { 
    470                 DestroyImage(collectedData.imHandle); 
    471  
    472                 collectedData.imHandle = NULL; 
     478        if (collectedData.handle->imHandle != NULL) 
     479        { 
     480                DestroyImage(collectedData.handle->imHandle); 
     481 
     482                collectedData.handle->imHandle = NULL; 
    473483        } 
    474484} 
     
    484494#endif 
    485495 
    486         if (collectedData.imHandle == NULL) 
     496        if (collectedData.handle->imHandle == NULL) 
    487497        { 
    488498                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_WRITE, exception::ERRNO_IMAGEMAGICK, IMAGEEX_EMPTYIMAGE, GRAPHICSIMAGEEX_EMPTYIMAGE_STR, __LINE__, __FILE__); 
     
    496506        } 
    497507 
    498         strncpy(collectedData.imHandle->filename, str.c_str(), size); 
     508        strncpy(collectedData.handle->imHandle->filename, str.c_str(), size); 
    499509 
    500510        GetExceptionInfo(&exInfo); 
    501511 
    502         if (WriteImage(collectedData.imInfo, collectedData.imHandle) == MagickFalse) 
    503         { 
    504                 throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_WRITE, exception::ERRNO_IMAGEMAGICK, collectedData.imHandle->exception.error_number, exInfo.reason, __LINE__, __FILE__, exInfo.description); 
     512        if (WriteImage(collectedData.handle->imInfo, collectedData.handle->imHandle) == MagickFalse) 
     513        { 
     514                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_WRITE, exception::ERRNO_IMAGEMAGICK, collectedData.handle->imHandle->exception.error_number, exInfo.reason, __LINE__, __FILE__, exInfo.description); 
    505515        } 
    506516 
     
    520530#endif 
    521531 
    522         if (collectedData.imHandle == NULL) 
     532        if (collectedData.handle->imHandle == NULL) 
    523533        { 
    524534                throw exception::basic(exception::ERRMODULE_GRAPHICSIMAGE, IMAGEEX_WRITE, exception::ERRNO_IMAGEMAGICK, IMAGEEX_EMPTYIMAGE, GRAPHICSIMAGEEX_EMPTYIMAGE_STR, __LINE__, __FILE__); 
     
    528538 
    529539        unsigned long size = 0; 
    530         unsigned char *imData = ImageToBlob(collectedData.imInfo, collectedData.imHandle, (size_t *)&size, &exInfo); 
     540        unsigned char *imData = ImageToBlob(collectedData.handle->imInfo, collectedData.handle->imHandle, (size_t *)&size, &exInfo); 
    531541        if (imData == NULL) 
    532542        { 
     
    551561        } 
    552562 
    553         collectedData.imInfo->compression = compressionStArr[type]; 
     563        collectedData.handle->imInfo->compression = compressionStArr[type]; 
    554564} 
    555565 
     
    559569image::setQuality(short quality) 
    560570{ 
    561         collectedData.imInfo->quality = quality; 
     571        collectedData.handle->imInfo->quality = quality; 
    562572} 
    563573 
     
    572582        } 
    573583 
    574         strcpy(collectedData.imInfo->magick, encoderStArr[encoder]); 
     584        strcpy(collectedData.handle->imInfo->magick, encoderStArr[encoder]); 
    575585} 
    576586 
     
    582592        for (int i = 0; i < IMAGE_COMPRESSIONSTATEMENTS; ++i) 
    583593        { 
    584                 if (collectedData.imInfo->compression == compressionStArr[i]) 
     594                if (collectedData.handle->imInfo->compression == compressionStArr[i]) 
    585595                { 
    586596                        return i; 
     
    594604image::getQuality() 
    595605{ 
    596         return collectedData.imInfo->quality; 
     606        return collectedData.handle->imInfo->quality; 
    597607} 
    598608 
     
    604614        for (int i = 0; i < IMAGE_ENCODERSTATEMENTS; ++i) 
    605615        { 
    606                 if (strcmp(collectedData.imInfo->magick, encoderStArr[i]) == 0) 
     616                if (strcmp(collectedData.handle->imInfo->magick, encoderStArr[i]) == 0) 
    607617                { 
    608618                        return i; 
     
    616626image::getImageSize() 
    617627{ 
    618         if (collectedData.imHandle == NULL) 
     628        if (collectedData.handle->imHandle == NULL) 
    619629        { 
    620630                return __imageSize(); 
     
    623633        __imageSize info; 
    624634 
    625         info.height = collectedData.imHandle->rows; 
    626         info.width = collectedData.imHandle->columns; 
     635        info.height = collectedData.handle->imHandle->rows; 
     636        info.width = collectedData.handle->imHandle->columns; 
    627637 
    628638        return info; 
Note: See TracChangeset for help on using the changeset viewer.