X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=utilities%2FCxImage%2Fximalyr.cpp;h=18363639849f22b500a63785bb667777ad58ef57;hb=9a6fa24ce833e9d1b57b72d8124ede509250a7f2;hp=0b409c2ee9a56a090444395760a15c5deec0e092;hpb=3fd15028ab81e6746d3af96695526d7d973a26c8;p=clitk.git diff --git a/utilities/CxImage/ximalyr.cpp b/utilities/CxImage/ximalyr.cpp index 0b409c2..1836363 100644 --- a/utilities/CxImage/ximalyr.cpp +++ b/utilities/CxImage/ximalyr.cpp @@ -1,116 +1,116 @@ -// xImaLyr.cpp : Layers functions -/* 21/04/2003 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 6.0.0 02/Feb/2008 - */ - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_LAYERS - -//////////////////////////////////////////////////////////////////////////////// -/** - * If the object is an internal layer, GetParent return its parent in the hierarchy. - */ -CxImage* CxImage::GetParent() const -{ - return info.pParent; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Number of layers allocated directly by the object. - */ -long CxImage::GetNumLayers() const -{ - return info.nNumLayers; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Creates an empty layer. If position is less than 0, the new layer will be placed in the last position - */ -bool CxImage::LayerCreate(long position) -{ - if ( position < 0 || position > info.nNumLayers ) position = info.nNumLayers; - - CxImage** ptmp = new CxImage*[info.nNumLayers + 1]; - if (ptmp==0) return false; - - int i=0; - for (int n=0; ninfo.pParent = this; - } else { - free(ptmp); - return false; - } - - info.nNumLayers++; - delete [] ppLayers; - ppLayers = ptmp; - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Deletes a layer. If position is less than 0, the last layer will be deleted - */ -bool CxImage::LayerDelete(long position) -{ - if ( position >= info.nNumLayers ) return false; - if ( position < 0) position = info.nNumLayers - 1; - if ( position < 0) return false; - - if (info.nNumLayers>1){ - - CxImage** ptmp = new CxImage*[info.nNumLayers - 1]; - if (ptmp==0) return false; - - int i=0; - for (int n=0; n= info.nNumLayers ) return NULL; - if ( position < 0) position = info.nNumLayers - 1; - return ppLayers[position]; -} -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_LAYERS +// xImaLyr.cpp : Layers functions +/* 21/04/2003 v1.00 - Davide Pizzolato - www.xdp.it + * CxImage version 6.0.0 02/Feb/2008 + */ + +#include "ximage.h" + +#if CXIMAGE_SUPPORT_LAYERS + +//////////////////////////////////////////////////////////////////////////////// +/** + * If the object is an internal layer, GetParent return its parent in the hierarchy. + */ +CxImage* CxImage::GetParent() const +{ + return info.pParent; +} +//////////////////////////////////////////////////////////////////////////////// +/** + * Number of layers allocated directly by the object. + */ +long CxImage::GetNumLayers() const +{ + return info.nNumLayers; +} +//////////////////////////////////////////////////////////////////////////////// +/** + * Creates an empty layer. If position is less than 0, the new layer will be placed in the last position + */ +bool CxImage::LayerCreate(long position) +{ + if ( position < 0 || position > info.nNumLayers ) position = info.nNumLayers; + + CxImage** ptmp = new CxImage*[info.nNumLayers + 1]; + if (ptmp==0) return false; + + int i=0; + for (int n=0; ninfo.pParent = this; + } else { + free(ptmp); + return false; + } + + info.nNumLayers++; + delete [] ppLayers; + ppLayers = ptmp; + return true; +} +//////////////////////////////////////////////////////////////////////////////// +/** + * Deletes a layer. If position is less than 0, the last layer will be deleted + */ +bool CxImage::LayerDelete(long position) +{ + if ( position >= info.nNumLayers ) return false; + if ( position < 0) position = info.nNumLayers - 1; + if ( position < 0) return false; + + if (info.nNumLayers>1){ + + CxImage** ptmp = new CxImage*[info.nNumLayers - 1]; + if (ptmp==0) return false; + + int i=0; + for (int n=0; n= info.nNumLayers ) return NULL; + if ( position < 0) position = info.nNumLayers - 1; + return ppLayers[position]; +} +//////////////////////////////////////////////////////////////////////////////// +#endif //CXIMAGE_SUPPORT_LAYERS