summaryrefslogtreecommitdiffstats
path: root/digikam/libs/greycstoration/CImg.h
diff options
context:
space:
mode:
Diffstat (limited to 'digikam/libs/greycstoration/CImg.h')
-rw-r--r--digikam/libs/greycstoration/CImg.h450
1 files changed, 225 insertions, 225 deletions
diff --git a/digikam/libs/greycstoration/CImg.h b/digikam/libs/greycstoration/CImg.h
index a5bbba9..5a36940 100644
--- a/digikam/libs/greycstoration/CImg.h
+++ b/digikam/libs/greycstoration/CImg.h
@@ -2000,7 +2000,7 @@ namespace cimg_library {
- \b CImgDisplayException : Thrown when an error occured when trying to display an image in a window.
This exception is thrown when image display request cannot be satisfied.
- The parent class CImgException may be thrown itself when errors that cannot be classified in one of
+ The tqparent class CImgException may be thrown itself when errors that cannot be classified in one of
the above type occur. It is recommended not to throw CImgExceptions yourself, since there are normally
reserved to %CImg Library functions.
\b CImgInstanceException, \b CImgArgumentException, \b CImgIOException and \b CImgDisplayException are simple
@@ -4989,7 +4989,7 @@ namespace cimg_library {
}
//! Find a character in a C-string.
- inline int strfind(const char *const s, const char c) {
+ inline int strtqfind(const char *const s, const char c) {
if (!s) return -1;
int l; for (l = cimg::strlen(s); l>=0 && s[l]!=c; --l) {}
return l;
@@ -5047,7 +5047,7 @@ namespace cimg_library {
//! Compute the basename of a filename.
inline const char* basename(const char *const s) {
- return (cimg_OS!=2)?(s?s+1+cimg::strfind(s,'/'):0):(s?s+1+cimg::strfind(s,'\\'):0);
+ return (cimg_OS!=2)?(s?s+1+cimg::strtqfind(s,'/'):0):(s?s+1+cimg::strtqfind(s,'\\'):0);
}
// Generate a random filename.
@@ -5527,7 +5527,7 @@ namespace cimg_library {
//! Split a filename into two strings 'body' and 'extension'.
inline const char *split_filename(const char *const filename, char *const body=0) {
if (!filename) { if (body) body[0]='\0'; return 0; }
- int l = cimg::strfind(filename,'.');
+ int l = cimg::strtqfind(filename,'.');
if (l>=0) { if (body) { cimg_std::strncpy(body,filename,l); body[l]='\0'; }}
else { if (body) cimg_std::strcpy(body,filename); l = (int)cimg::strlen(filename)-1; }
return filename+l+1;
@@ -6773,8 +6773,8 @@ namespace cimg_library {
then this image is displayed in the current display window.
\param list : The list of images to display.
\param axis : The axis used to append the image for visualization. Can be 'x' (default),'y','z' or 'v'.
- \param align : Defines the relative alignment of images when displaying images of different sizes.
- Can be '\p c' (centered, which is the default), '\p p' (top alignment) and '\p n' (bottom aligment).
+ \param align : Defines the relative tqalignment of images when displaying images of different sizes.
+ Can be '\p c' (centered, which is the default), '\p p' (top tqalignment) and '\p n' (bottom aligment).
**/
template<typename T>
CImgDisplay& display(const CImgList<T>& list, const char axis='x', const char align='p') {
@@ -7624,7 +7624,7 @@ namespace cimg_library {
vtemplate.visualid = XVisualIDFromVisual(visual);
int nb_visuals;
XVisualInfo *vinfo = XGetVisualInfo(cimg::X11attr().display,VisualIDMask,&vtemplate,&nb_visuals);
- if (vinfo && vinfo->red_mask<vinfo->blue_mask) cimg::X11attr().blue_first = true;
+ if (vinfo && vinfo->red_tqmask<vinfo->blue_tqmask) cimg::X11attr().blue_first = true;
cimg::X11attr().byte_order = ImageByteOrder(cimg::X11attr().display);
XFree(vinfo);
XLockDisplay(cimg::X11attr().display);
@@ -9304,12 +9304,12 @@ namespace cimg_library {
MPEnterCriticalRegion(paintCriticalRegion,kDurationForever);
CGrafPtr portPtr = GetWindowPort(carbonWindow);
CGContextRef currentContext = 0;
- QDBeginCGContext(portPtr,&currentContext);
+ TQDBeginCGContext(portPtr,&currentContext);
CGContextSetRGBFillColor(currentContext,255,255,255,255);
CGContextFillRect(currentContext,CGRectMake(0,0,window_width,window_height));
CGContextDrawImage(currentContext,CGRectMake(0,int(window_height-height)<0?0:window_height-height,width,height),imageRef);
CGContextFlush(currentContext);
- QDEndCGContext(portPtr, &currentContext);
+ TQDEndCGContext(portPtr, &currentContext);
MPExitCriticalRegion(paintCriticalRegion);
}
return *this;
@@ -9393,8 +9393,8 @@ namespace cimg_library {
return assign(width,height,title,normalization,!is_fullscreen,false);
}
- static OSStatus CarbonEventHandler(EventHandlerCallRef myHandler, EventRef theEvent, void* userData) {
- OSStatus result = eventNotHandledErr;
+ static OStqStatus CarbonEventHandler(EventHandlerCallRef myHandler, EventRef theEvent, void* userData) {
+ OStqStatus result = eventNotHandledErr;
CImgDisplay* disp = (CImgDisplay*) userData;
(void)myHandler; // Avoid "unused parameter"
cimg::CarbonInfo& c = cimg::CarbonAttr();
@@ -9605,7 +9605,7 @@ namespace cimg_library {
MPSignalSemaphore(c.sync_event); // Notify the caller that all goes fine
EventRef theEvent;
EventTargetRef theTarget;
- OSStatus err;
+ OStqStatus err;
CbSerializedQuery* query;
theTarget = GetEventDispatcherTarget();
@@ -9617,7 +9617,7 @@ namespace cimg_library {
SendEventToEventTarget (theEvent, theTarget);
ReleaseEvent(theEvent);
} else if (err == eventLoopTimedOutErr) { // There is no event to process, so check if there is new messages to process
- OSStatus r =MPWaitOnQueue(c.com_queue,(void**)&query,0,0,10*kDurationMillisecond);
+ OStqStatus r =MPWaitOnQueue(c.com_queue,(void**)&query,0,0,10*kDurationMillisecond);
if (r!=noErr) continue; //nothing in the queue or an error.., bye
// If we're here, we've something to do now.
if (query) {
@@ -9875,7 +9875,7 @@ namespace cimg_library {
\par Image structure
- The \ref CImg<\c T> structure contains \a six fields :
+ The \ref CImg<\c T> structure tqcontains \a six fields :
- \ref width defines the number of \a columns of the image (size along the X-axis).
- \ref height defines the number of \a rows of the image (size along the Y-axis).
- \ref depth defines the number of \a slices of the image (size along the Z-axis).
@@ -11076,7 +11076,7 @@ namespace cimg_library {
//! Return \c true if specified referenced value is inside image boundaries. If true, returns pixel coordinates in (x,y,z,v).
template<typename t>
- bool contains(const T& pixel, t& x, t& y, t& z, t& v) const {
+ bool tqcontains(const T& pixel, t& x, t& y, t& z, t& v) const {
const unsigned long wh = width*height, whz = wh*depth, siz = whz*dim;
const T *const ppixel = &pixel;
if (is_empty() || ppixel<data || ppixel>=data+siz) return false;
@@ -11092,7 +11092,7 @@ namespace cimg_library {
//! Return \c true if specified referenced value is inside image boundaries. If true, returns pixel coordinates in (x,y,z).
template<typename t>
- bool contains(const T& pixel, t& x, t& y, t& z) const {
+ bool tqcontains(const T& pixel, t& x, t& y, t& z) const {
const unsigned long wh = width*height, whz = wh*depth, siz = whz*dim;
const T *const ppixel = &pixel;
if (is_empty() || ppixel<data || ppixel>=data+siz) return false;
@@ -11106,7 +11106,7 @@ namespace cimg_library {
//! Return \c true if specified referenced value is inside image boundaries. If true, returns pixel coordinates in (x,y).
template<typename t>
- bool contains(const T& pixel, t& x, t& y) const {
+ bool tqcontains(const T& pixel, t& x, t& y) const {
const unsigned long wh = width*height, siz = wh*depth*dim;
const T *const ppixel = &pixel;
if (is_empty() || ppixel<data || ppixel>=data+siz) return false;
@@ -11118,7 +11118,7 @@ namespace cimg_library {
//! Return \c true if specified referenced value is inside image boundaries. If true, returns pixel coordinates in (x).
template<typename t>
- bool contains(const T& pixel, t& x) const {
+ bool tqcontains(const T& pixel, t& x) const {
const T *const ppixel = &pixel;
if (is_empty() || ppixel<data || ppixel>=data+size()) return false;
x = (t)(((unsigned long)(ppixel - data))%width);
@@ -11126,7 +11126,7 @@ namespace cimg_library {
}
//! Return \c true if specified referenced value is inside the image boundaries.
- bool contains(const T& pixel) const {
+ bool tqcontains(const T& pixel) const {
const T *const ppixel = &pixel;
return !is_empty() && ppixel>=data && ppixel<data+size();
}
@@ -12049,8 +12049,8 @@ namespace cimg_library {
int
xm = 0, ym = 0, zm = 0, vm = 0,
xM = 0, yM = 0, zM = 0, vM = 0;
- contains(*pm,xm,ym,zm,vm);
- contains(*pM,xM,yM,zM,vM);
+ tqcontains(*pm,xm,ym,zm,vm);
+ tqcontains(*pM,xM,yM,zM,vM);
return CImg<Tfloat>(1,12).fill((Tfloat)m,(Tfloat)M,mean_value,variance_value,
(Tfloat)xm,(Tfloat)ym,(Tfloat)zm,(Tfloat)vm,
(Tfloat)xM,(Tfloat)yM,(Tfloat)zM,(Tfloat)vM);
@@ -14041,7 +14041,7 @@ namespace cimg_library {
//! Resize an image.
/**
- \param src Image giving the geometry of the resize.
+ \param src Image giving the tqgeometry of the resize.
\param interpolation_type Interpolation method :
- 1 = raw memory
- 0 = no interpolation : additional space is filled with 0.
@@ -14067,7 +14067,7 @@ namespace cimg_library {
//! Resize an image.
/**
- \param disp = Display giving the geometry of the resize.
+ \param disp = Display giving the tqgeometry of the resize.
\param interpolation_type = Resizing type :
- 0 = no interpolation : additional space is filled with 0.
- 1 = bloc interpolation (nearest point).
@@ -14096,16 +14096,16 @@ namespace cimg_library {
CImg<T> get_resize_halfXY() const {
if (is_empty()) return *this;
- const Tfloat mask[9] = { 0.07842776544f, 0.1231940459f, 0.07842776544f,
+ const Tfloat tqmask[9] = { 0.07842776544f, 0.1231940459f, 0.07842776544f,
0.1231940459f, 0.1935127547f, 0.1231940459f,
0.07842776544f, 0.1231940459f, 0.07842776544f };
T I[9] = { 0 };
CImg<T> dest(width/2,height/2,depth,dim);
cimg_forZV(*this,z,k) cimg_for3x3(*this,x,y,z,k,I)
if (x%2 && y%2) dest(x/2,y/2,z,k) = (T)
- (I[0]*mask[0] + I[1]*mask[1] + I[2]*mask[2] +
- I[3]*mask[3] + I[4]*mask[4] + I[5]*mask[5] +
- I[6]*mask[6] + I[7]*mask[7] + I[8]*mask[8]);
+ (I[0]*tqmask[0] + I[1]*tqmask[1] + I[2]*tqmask[2] +
+ I[3]*tqmask[3] + I[4]*tqmask[4] + I[5]*tqmask[5] +
+ I[6]*tqmask[6] + I[7]*tqmask[7] + I[8]*tqmask[8]);
return dest;
}
@@ -15746,8 +15746,8 @@ namespace cimg_library {
- -1 = Backward finite differences
- 0 = Centered finite differences
- 1 = Forward finite differences
- - 2 = Using Sobel masks
- - 3 = Using rotation invariant masks
+ - 2 = Using Sobel tqmasks
+ - 3 = Using rotation invariant tqmasks
- 4 = Using Deriche recusrsive filter.
**/
CImgList<Tfloat> get_gradient(const char *const axes=0, const int scheme=3) const {
@@ -15813,7 +15813,7 @@ namespace cimg_library {
grad[1](x,y,z,k) = (Tfloat)Icn - Icc;
}
} break;
- case 2 : { // using Sobel mask
+ case 2 : { // using Sobel tqmask
CImg_3x3(I,T);
const Tfloat a = 1, b = 2;
cimg_forZV(*this,z,k) cimg_for3x3(*this,x,y,z,k,I) {
@@ -15821,7 +15821,7 @@ namespace cimg_library {
grad[1](x,y,z,k) = -a*Ipp - b*Icp - a*Inp + a*Ipn + b*Icn + a*Inn;
}
} break;
- case 3 : { // using rotation invariant mask
+ case 3 : { // using rotation invariant tqmask
CImg_3x3(I,T);
const Tfloat a = (Tfloat)(0.25f*(2-cimg_std::sqrt(2.0f))), b = (Tfloat)(0.5f*(cimg_std::sqrt(2.0f)-1));
cimg_forZV(*this,z,k) cimg_for3x3(*this,x,y,z,k,I) {
@@ -16021,7 +16021,7 @@ namespace cimg_library {
return CImg<Tfloat>(*this,false).distance_hamilton(nb_iter,band_size,precision);
}
- //! Compute the Euclidean distance map to a shape of specified isovalue.
+ //! Compute the Euclidean distance map to a tqshape of specified isovalue.
CImg<T>& distance(const T isovalue,
const float sizex=1, const float sizey=1, const float sizez=1,
const bool compute_sqrt=true) {
@@ -19666,37 +19666,37 @@ namespace cimg_library {
return draw_image(0,sprite,opacity);
}
- //! Draw a sprite image in the instance image (masked version).
+ //! Draw a sprite image in the instance image (tqmasked version).
/**
\param sprite Sprite image.
- \param mask Mask image.
+ \param tqmask Mask image.
\param x0 X-coordinate of the sprite position in the instance image.
\param y0 Y-coordinate of the sprite position in the instance image.
\param z0 Z-coordinate of the sprite position in the instance image.
\param v0 V-coordinate of the sprite position in the instance image.
- \param mask_valmax Maximum pixel value of the mask image \c mask (optional).
+ \param tqmask_valmax Maximum pixel value of the tqmask image \c tqmask (optional).
\param opacity Drawing opacity.
\note
- - Pixel values of \c mask set the opacity of the corresponding pixels in \c sprite.
+ - Pixel values of \c tqmask set the opacity of the corresponding pixels in \c sprite.
- Clipping is supported.
- - Dimensions along x,y and z of \p sprite and \p mask must be the same.
+ - Dimensions along x,y and z of \p sprite and \p tqmask must be the same.
**/
template<typename ti, typename tm>
CImg<T>& draw_image(const int x0, const int y0, const int z0, const int v0,
- const CImg<ti>& sprite, const CImg<tm>& mask, const float opacity=1,
- const float mask_valmax=1) {
+ const CImg<ti>& sprite, const CImg<tm>& tqmask, const float opacity=1,
+ const float tqmask_valmax=1) {
if (is_empty()) return *this;
if (!sprite)
throw CImgArgumentException("CImg<%s>::draw_image() : Specified sprite image (%u,%u,%u,%u,%p) is empty.",
pixel_type(),sprite.width,sprite.height,sprite.depth,sprite.dim,sprite.data);
- if (!mask)
- throw CImgArgumentException("CImg<%s>::draw_image() : Specified mask image (%u,%u,%u,%u,%p) is empty.",
- pixel_type(),mask.width,mask.height,mask.depth,mask.dim,mask.data);
- if (is_overlapped(sprite)) return draw_image(x0,y0,z0,v0,+sprite,mask,opacity,mask_valmax);
- if (is_overlapped(mask)) return draw_image(x0,y0,z0,v0,sprite,+mask,opacity,mask_valmax);
- if (mask.width!=sprite.width || mask.height!=sprite.height || mask.depth!=sprite.depth)
+ if (!tqmask)
+ throw CImgArgumentException("CImg<%s>::draw_image() : Specified tqmask image (%u,%u,%u,%u,%p) is empty.",
+ pixel_type(),tqmask.width,tqmask.height,tqmask.depth,tqmask.dim,tqmask.data);
+ if (is_overlapped(sprite)) return draw_image(x0,y0,z0,v0,+sprite,tqmask,opacity,tqmask_valmax);
+ if (is_overlapped(tqmask)) return draw_image(x0,y0,z0,v0,sprite,+tqmask,opacity,tqmask_valmax);
+ if (tqmask.width!=sprite.width || tqmask.height!=sprite.height || tqmask.depth!=sprite.depth)
throw CImgArgumentException("CImg<%s>::draw_image() : Mask dimension is (%u,%u,%u,%u), while sprite is (%u,%u,%u,%u)",
- pixel_type(),mask.width,mask.height,mask.depth,mask.dim,sprite.width,sprite.height,sprite.depth,sprite.dim);
+ pixel_type(),tqmask.width,tqmask.height,tqmask.depth,tqmask.dim,sprite.width,sprite.height,sprite.depth,sprite.dim);
const bool bx = (x0<0), by = (y0<0), bz = (z0<0), bv = (v0<0);
const int
lX = sprite.dimx() - (x0 + sprite.dimx()>dimx()?x0 + sprite.dimx() - dimx():0) + (bx?x0:0),
@@ -19704,10 +19704,10 @@ namespace cimg_library {
lZ = sprite.dimz() - (z0 + sprite.dimz()>dimz()?z0 + sprite.dimz() - dimz():0) + (bz?z0:0),
lV = sprite.dimv() - (v0 + sprite.dimv()>dimv()?v0 + sprite.dimv() - dimv():0) + (bv?v0:0);
const int
- coff = -(bx?x0:0)-(by?y0*mask.dimx():0)-(bz?z0*mask.dimx()*mask.dimy():0)-(bv?v0*mask.dimx()*mask.dimy()*mask.dimz():0),
- ssize = mask.dimx()*mask.dimy()*mask.dimz();
+ coff = -(bx?x0:0)-(by?y0*tqmask.dimx():0)-(bz?z0*tqmask.dimx()*tqmask.dimy():0)-(bv?v0*tqmask.dimx()*tqmask.dimy()*tqmask.dimz():0),
+ ssize = tqmask.dimx()*tqmask.dimy()*tqmask.dimz();
const ti *ptrs = sprite.data + coff;
- const tm *ptrm = mask.data + coff;
+ const tm *ptrm = tqmask.data + coff;
const unsigned int
offX = width - lX, soffX = sprite.width - lX,
offY = width*(height - lY), soffY = sprite.width*(sprite.height - lY),
@@ -19715,13 +19715,13 @@ namespace cimg_library {
if (lX>0 && lY>0 && lZ>0 && lV>0) {
T *ptrd = ptr(x0<0?0:x0,y0<0?0:y0,z0<0?0:z0,v0<0?0:v0);
for (int v = 0; v<lV; ++v) {
- ptrm = mask.data + (ptrm - mask.data)%ssize;
+ ptrm = tqmask.data + (ptrm - tqmask.data)%ssize;
for (int z = 0; z<lZ; ++z) {
for (int y = 0; y<lY; ++y) {
for (int x=0; x<lX; ++x) {
const float mopacity = (float)(*(ptrm++)*opacity),
- nopacity = cimg::abs(mopacity), copacity = mask_valmax - cimg::max(mopacity,0);
- *ptrd = (T)((nopacity*(*(ptrs++)) + *ptrd*copacity)/mask_valmax);
+ nopacity = cimg::abs(mopacity), copacity = tqmask_valmax - cimg::max(mopacity,0);
+ *ptrd = (T)((nopacity*(*(ptrs++)) + *ptrd*copacity)/tqmask_valmax);
++ptrd;
}
ptrd+=offX; ptrs+=soffX; ptrm+=soffX;
@@ -19737,32 +19737,32 @@ namespace cimg_library {
//! Draw an image.
template<typename ti, typename tm>
CImg<T>& draw_image(const int x0, const int y0, const int z0,
- const CImg<ti>& sprite, const CImg<tm>& mask, const float opacity=1,
- const float mask_valmax=1) {
- return draw_image(x0,y0,z0,0,sprite,mask,opacity,mask_valmax);
+ const CImg<ti>& sprite, const CImg<tm>& tqmask, const float opacity=1,
+ const float tqmask_valmax=1) {
+ return draw_image(x0,y0,z0,0,sprite,tqmask,opacity,tqmask_valmax);
}
//! Draw an image.
template<typename ti, typename tm>
CImg<T>& draw_image(const int x0, const int y0,
- const CImg<ti>& sprite, const CImg<tm>& mask, const float opacity=1,
- const float mask_valmax=1) {
- return draw_image(x0,y0,0,sprite,mask,opacity,mask_valmax);
+ const CImg<ti>& sprite, const CImg<tm>& tqmask, const float opacity=1,
+ const float tqmask_valmax=1) {
+ return draw_image(x0,y0,0,sprite,tqmask,opacity,tqmask_valmax);
}
//! Draw an image.
template<typename ti, typename tm>
CImg<T>& draw_image(const int x0,
- const CImg<ti>& sprite, const CImg<tm>& mask, const float opacity=1,
- const float mask_valmax=1) {
- return draw_image(x0,0,sprite,mask,opacity,mask_valmax);
+ const CImg<ti>& sprite, const CImg<tm>& tqmask, const float opacity=1,
+ const float tqmask_valmax=1) {
+ return draw_image(x0,0,sprite,tqmask,opacity,tqmask_valmax);
}
//! Draw an image.
template<typename ti, typename tm>
- CImg<T>& draw_image(const CImg<ti>& sprite, const CImg<tm>& mask, const float opacity=1,
- const float mask_valmax=1) {
- return draw_image(0,sprite,mask,opacity,mask_valmax);
+ CImg<T>& draw_image(const CImg<ti>& sprite, const CImg<tm>& tqmask, const float opacity=1,
+ const float tqmask_valmax=1) {
+ return draw_image(0,sprite,tqmask,opacity,tqmask_valmax);
}
//! Draw a 4D filled rectangle in the instance image, at coordinates (\c x0,\c y0,\c z0,\c v0)-(\c x1,\c y1,\c z1,\c v1).
@@ -22229,12 +22229,12 @@ namespace cimg_library {
case '\t' : x+=4*font[' '].width; break;
default : if (c<font.size) {
letter = font[c];
- const CImg<T>& mask = (c+256)<(int)font.size?font[c+256]:font[c];
+ const CImg<T>& tqmask = (c+256)<(int)font.size?font[c+256]:font[c];
if (foreground_color) for (unsigned int p = 0; p<letter.width*letter.height; ++p)
- if (mask(p)) cimg_forV(*this,k) letter(p,0,0,k) = (T)(letter(p,0,0,k)*foreground_color[k]);
+ if (tqmask(p)) cimg_forV(*this,k) letter(p,0,0,k) = (T)(letter(p,0,0,k)*foreground_color[k]);
if (background_color) for (unsigned int p = 0; p<letter.width*letter.height; ++p)
- if (!mask(p)) cimg_forV(*this,k) letter(p,0,0,k) = (T)background_color[k];
- if (!background_color && font.size>=512) draw_image(x,y,letter,mask,opacity,(T)1);
+ if (!tqmask(p)) cimg_forV(*this,k) letter(p,0,0,k) = (T)background_color[k];
+ if (!background_color && font.size>=512) draw_image(x,y,letter,tqmask,opacity,(T)1);
else draw_image(x,y,letter,opacity);
x+=letter.width;
}
@@ -22777,11 +22777,11 @@ namespace cimg_library {
\param y Y-coordinate of the starting point of the region to fill.
\param z Z-coordinate of the starting point of the region to fill.
\param color An array of dimv() values of type \c T, defining the drawing color.
- \param region Image that will contain the mask of the filled region mask, as an output.
+ \param region Image that will contain the tqmask of the filled region tqmask, as an output.
\param sigma Tolerance concerning neighborhood values.
\param opacity Opacity of the drawing.
\param high_connexity Tells if 8-connexity must be used (only for 2D images).
- \return \p region is initialized with the binary mask of the filled region.
+ \return \p region is initialized with the binary tqmask of the filled region.
**/
template<typename tc, typename t>
CImg<T>& draw_fill(const int x, const int y, const int z,
@@ -24508,45 +24508,45 @@ namespace cimg_library {
//@{
//----------------------------
- //! Compute the correlation of the instance image by a mask.
+ //! Compute the correlation of the instance image by a tqmask.
/**
- The correlation of the instance image \p *this by the mask \p mask is defined to be :
+ The correlation of the instance image \p *this by the tqmask \p tqmask is defined to be :
- res(x,y,z) = sum_{i,j,k} (*this)(x+i,y+j,z+k)*mask(i,j,k)
+ res(x,y,z) = sum_{i,j,k} (*this)(x+i,y+j,z+k)*tqmask(i,j,k)
- \param mask = the correlation kernel.
+ \param tqmask = the correlation kernel.
\param cond = the border condition type (0=zero, 1=dirichlet)
\param weighted_correl = enable local normalization.
**/
template<typename t>
- CImg<T>& correlate(const CImg<t>& mask, const unsigned int cond=1, const bool weighted_correl=false) {
- return get_correlate(mask,cond,weighted_correl).transfer_to(*this);
+ CImg<T>& correlate(const CImg<t>& tqmask, const unsigned int cond=1, const bool weighted_correl=false) {
+ return get_correlate(tqmask,cond,weighted_correl).transfer_to(*this);
}
template<typename t>
- CImg<typename cimg::superset2<T,t,float>::type> get_correlate(const CImg<t>& mask, const unsigned int cond=1,
+ CImg<typename cimg::superset2<T,t,float>::type> get_correlate(const CImg<t>& tqmask, const unsigned int cond=1,
const bool weighted_correl=false) const {
typedef typename cimg::superset2<T,t,float>::type Ttfloat;
if (is_empty()) return *this;
- if (!mask || mask.dim!=1)
- throw CImgArgumentException("CImg<%s>::correlate() : Specified mask (%u,%u,%u,%u,%p) is not scalar.",
- pixel_type(),mask.width,mask.height,mask.depth,mask.dim,mask.data);
+ if (!tqmask || tqmask.dim!=1)
+ throw CImgArgumentException("CImg<%s>::correlate() : Specified tqmask (%u,%u,%u,%u,%p) is not scalar.",
+ pixel_type(),tqmask.width,tqmask.height,tqmask.depth,tqmask.dim,tqmask.data);
CImg<Ttfloat> dest(width,height,depth,dim);
- if (cond && mask.width==mask.height && ((mask.depth==1 && mask.width<=5) || (mask.depth==mask.width && mask.width<=3))) {
- // A special optimization is done for 2x2, 3x3, 4x4, 5x5, 2x2x2 and 3x3x3 mask (with cond=1)
- switch (mask.depth) {
+ if (cond && tqmask.width==tqmask.height && ((tqmask.depth==1 && tqmask.width<=5) || (tqmask.depth==tqmask.width && tqmask.width<=3))) {
+ // A special optimization is done for 2x2, 3x3, 4x4, 5x5, 2x2x2 and 3x3x3 tqmask (with cond=1)
+ switch (tqmask.depth) {
case 3 : {
T I[27] = { 0 };
cimg_forZV(*this,z,v) cimg_for3x3x3(*this,x,y,z,v,I) dest(x,y,z,v) = (Ttfloat)
- (I[ 0]*mask[ 0] + I[ 1]*mask[ 1] + I[ 2]*mask[ 2] +
- I[ 3]*mask[ 3] + I[ 4]*mask[ 4] + I[ 5]*mask[ 5] +
- I[ 6]*mask[ 6] + I[ 7]*mask[ 7] + I[ 8]*mask[ 8] +
- I[ 9]*mask[ 9] + I[10]*mask[10] + I[11]*mask[11] +
- I[12]*mask[12] + I[13]*mask[13] + I[14]*mask[14] +
- I[15]*mask[15] + I[16]*mask[16] + I[17]*mask[17] +
- I[18]*mask[18] + I[19]*mask[19] + I[20]*mask[20] +
- I[21]*mask[21] + I[22]*mask[22] + I[23]*mask[23] +
- I[24]*mask[24] + I[25]*mask[25] + I[26]*mask[26]);
+ (I[ 0]*tqmask[ 0] + I[ 1]*tqmask[ 1] + I[ 2]*tqmask[ 2] +
+ I[ 3]*tqmask[ 3] + I[ 4]*tqmask[ 4] + I[ 5]*tqmask[ 5] +
+ I[ 6]*tqmask[ 6] + I[ 7]*tqmask[ 7] + I[ 8]*tqmask[ 8] +
+ I[ 9]*tqmask[ 9] + I[10]*tqmask[10] + I[11]*tqmask[11] +
+ I[12]*tqmask[12] + I[13]*tqmask[13] + I[14]*tqmask[14] +
+ I[15]*tqmask[15] + I[16]*tqmask[16] + I[17]*tqmask[17] +
+ I[18]*tqmask[18] + I[19]*tqmask[19] + I[20]*tqmask[20] +
+ I[21]*tqmask[21] + I[22]*tqmask[22] + I[23]*tqmask[23] +
+ I[24]*tqmask[24] + I[25]*tqmask[25] + I[26]*tqmask[26]);
if (weighted_correl) cimg_forZV(*this,z,v) cimg_for3x3x3(*this,x,y,z,v,I) {
const double weight = (double)(I[ 0]*I[ 0] + I[ 1]*I[ 1] + I[ 2]*I[ 2] +
I[ 3]*I[ 3] + I[ 4]*I[ 4] + I[ 5]*I[ 5] +
@@ -24563,10 +24563,10 @@ namespace cimg_library {
case 2 : {
T I[8] = { 0 };
cimg_forZV(*this,z,v) cimg_for2x2x2(*this,x,y,z,v,I) dest(x,y,z,v) = (Ttfloat)
- (I[0]*mask[0] + I[1]*mask[1] +
- I[2]*mask[2] + I[3]*mask[3] +
- I[4]*mask[4] + I[5]*mask[5] +
- I[6]*mask[6] + I[7]*mask[7]);
+ (I[0]*tqmask[0] + I[1]*tqmask[1] +
+ I[2]*tqmask[2] + I[3]*tqmask[3] +
+ I[4]*tqmask[4] + I[5]*tqmask[5] +
+ I[6]*tqmask[6] + I[7]*tqmask[7]);
if (weighted_correl) cimg_forZV(*this,z,v) cimg_for2x2x2(*this,x,y,z,v,I) {
const double weight = (double)(I[0]*I[0] + I[1]*I[1] +
I[2]*I[2] + I[3]*I[3] +
@@ -24577,16 +24577,16 @@ namespace cimg_library {
} break;
default :
case 1 :
- switch (mask.width) {
+ switch (tqmask.width) {
case 6 : {
T I[36] = { 0 };
cimg_forZV(*this,z,v) cimg_for6x6(*this,x,y,z,v,I) dest(x,y,z,v) = (Ttfloat)
- (I[ 0]*mask[ 0] + I[ 1]*mask[ 1] + I[ 2]*mask[ 2] + I[ 3]*mask[ 3] + I[ 4]*mask[ 4] + I[ 5]*mask[ 5] +
- I[ 6]*mask[ 6] + I[ 7]*mask[ 7] + I[ 8]*mask[ 8] + I[ 9]*mask[ 9] + I[10]*mask[10] + I[11]*mask[11] +
- I[12]*mask[12] + I[13]*mask[13] + I[14]*mask[14] + I[15]*mask[15] + I[16]*mask[16] + I[17]*mask[17] +
- I[18]*mask[18] + I[19]*mask[19] + I[20]*mask[20] + I[21]*mask[21] + I[22]*mask[22] + I[23]*mask[23] +
- I[24]*mask[24] + I[25]*mask[25] + I[26]*mask[26] + I[27]*mask[27] + I[28]*mask[28] + I[29]*mask[29] +
- I[30]*mask[30] + I[31]*mask[31] + I[32]*mask[32] + I[33]*mask[33] + I[34]*mask[34] + I[35]*mask[35]);
+ (I[ 0]*tqmask[ 0] + I[ 1]*tqmask[ 1] + I[ 2]*tqmask[ 2] + I[ 3]*tqmask[ 3] + I[ 4]*tqmask[ 4] + I[ 5]*tqmask[ 5] +
+ I[ 6]*tqmask[ 6] + I[ 7]*tqmask[ 7] + I[ 8]*tqmask[ 8] + I[ 9]*tqmask[ 9] + I[10]*tqmask[10] + I[11]*tqmask[11] +
+ I[12]*tqmask[12] + I[13]*tqmask[13] + I[14]*tqmask[14] + I[15]*tqmask[15] + I[16]*tqmask[16] + I[17]*tqmask[17] +
+ I[18]*tqmask[18] + I[19]*tqmask[19] + I[20]*tqmask[20] + I[21]*tqmask[21] + I[22]*tqmask[22] + I[23]*tqmask[23] +
+ I[24]*tqmask[24] + I[25]*tqmask[25] + I[26]*tqmask[26] + I[27]*tqmask[27] + I[28]*tqmask[28] + I[29]*tqmask[29] +
+ I[30]*tqmask[30] + I[31]*tqmask[31] + I[32]*tqmask[32] + I[33]*tqmask[33] + I[34]*tqmask[34] + I[35]*tqmask[35]);
if (weighted_correl) cimg_forZV(*this,z,v) cimg_for5x5(*this,x,y,z,v,I) {
const double weight = (double)(I[ 0]*I[ 0] + I[ 1]*I[ 1] + I[ 2]*I[ 2] + I[ 3]*I[ 3] + I[ 4]*I[ 4] + I[ 5]*I[ 5] +
I[ 6]*I[ 6] + I[ 7]*I[ 7] + I[ 8]*I[ 8] + I[ 9]*I[ 9] + I[10]*I[10] + I[11]*I[11] +
@@ -24600,11 +24600,11 @@ namespace cimg_library {
case 5 : {
T I[25] = { 0 };
cimg_forZV(*this,z,v) cimg_for5x5(*this,x,y,z,v,I) dest(x,y,z,v) = (Ttfloat)
- (I[ 0]*mask[ 0] + I[ 1]*mask[ 1] + I[ 2]*mask[ 2] + I[ 3]*mask[ 3] + I[ 4]*mask[ 4] +
- I[ 5]*mask[ 5] + I[ 6]*mask[ 6] + I[ 7]*mask[ 7] + I[ 8]*mask[ 8] + I[ 9]*mask[ 9] +
- I[10]*mask[10] + I[11]*mask[11] + I[12]*mask[12] + I[13]*mask[13] + I[14]*mask[14] +
- I[15]*mask[15] + I[16]*mask[16] + I[17]*mask[17] + I[18]*mask[18] + I[19]*mask[19] +
- I[20]*mask[20] + I[21]*mask[21] + I[22]*mask[22] + I[23]*mask[23] + I[24]*mask[24]);
+ (I[ 0]*tqmask[ 0] + I[ 1]*tqmask[ 1] + I[ 2]*tqmask[ 2] + I[ 3]*tqmask[ 3] + I[ 4]*tqmask[ 4] +
+ I[ 5]*tqmask[ 5] + I[ 6]*tqmask[ 6] + I[ 7]*tqmask[ 7] + I[ 8]*tqmask[ 8] + I[ 9]*tqmask[ 9] +
+ I[10]*tqmask[10] + I[11]*tqmask[11] + I[12]*tqmask[12] + I[13]*tqmask[13] + I[14]*tqmask[14] +
+ I[15]*tqmask[15] + I[16]*tqmask[16] + I[17]*tqmask[17] + I[18]*tqmask[18] + I[19]*tqmask[19] +
+ I[20]*tqmask[20] + I[21]*tqmask[21] + I[22]*tqmask[22] + I[23]*tqmask[23] + I[24]*tqmask[24]);
if (weighted_correl) cimg_forZV(*this,z,v) cimg_for5x5(*this,x,y,z,v,I) {
const double weight = (double)(I[ 0]*I[ 0] + I[ 1]*I[ 1] + I[ 2]*I[ 2] + I[ 3]*I[ 3] + I[ 4]*I[ 4] +
I[ 5]*I[ 5] + I[ 6]*I[ 6] + I[ 7]*I[ 7] + I[ 8]*I[ 8] + I[ 9]*I[ 9] +
@@ -24617,10 +24617,10 @@ namespace cimg_library {
case 4 : {
T I[16] = { 0 };
cimg_forZV(*this,z,v) cimg_for4x4(*this,x,y,z,v,I) dest(x,y,z,v) = (Ttfloat)
- (I[ 0]*mask[ 0] + I[ 1]*mask[ 1] + I[ 2]*mask[ 2] + I[ 3]*mask[ 3] +
- I[ 4]*mask[ 4] + I[ 5]*mask[ 5] + I[ 6]*mask[ 6] + I[ 7]*mask[ 7] +
- I[ 8]*mask[ 8] + I[ 9]*mask[ 9] + I[10]*mask[10] + I[11]*mask[11] +
- I[12]*mask[12] + I[13]*mask[13] + I[14]*mask[14] + I[15]*mask[15]);
+ (I[ 0]*tqmask[ 0] + I[ 1]*tqmask[ 1] + I[ 2]*tqmask[ 2] + I[ 3]*tqmask[ 3] +
+ I[ 4]*tqmask[ 4] + I[ 5]*tqmask[ 5] + I[ 6]*tqmask[ 6] + I[ 7]*tqmask[ 7] +
+ I[ 8]*tqmask[ 8] + I[ 9]*tqmask[ 9] + I[10]*tqmask[10] + I[11]*tqmask[11] +
+ I[12]*tqmask[12] + I[13]*tqmask[13] + I[14]*tqmask[14] + I[15]*tqmask[15]);
if (weighted_correl) cimg_forZV(*this,z,v) cimg_for4x4(*this,x,y,z,v,I) {
const double weight = (double)(I[ 0]*I[ 0] + I[ 1]*I[ 1] + I[ 2]*I[ 2] + I[ 3]*I[ 3] +
I[ 4]*I[ 4] + I[ 5]*I[ 5] + I[ 6]*I[ 6] + I[ 7]*I[ 7] +
@@ -24632,9 +24632,9 @@ namespace cimg_library {
case 3 : {
T I[9] = { 0 };
cimg_forZV(*this,z,v) cimg_for3x3(*this,x,y,z,v,I) dest(x,y,z,v) = (Ttfloat)
- (I[0]*mask[0] + I[1]*mask[1] + I[2]*mask[2] +
- I[3]*mask[3] + I[4]*mask[4] + I[5]*mask[5] +
- I[6]*mask[6] + I[7]*mask[7] + I[8]*mask[8]);
+ (I[0]*tqmask[0] + I[1]*tqmask[1] + I[2]*tqmask[2] +
+ I[3]*tqmask[3] + I[4]*tqmask[4] + I[5]*tqmask[5] +
+ I[6]*tqmask[6] + I[7]*tqmask[7] + I[8]*tqmask[8]);
if (weighted_correl) cimg_forZV(*this,z,v) cimg_for3x3(*this,x,y,z,v,I) {
const double weight = (double)(I[0]*I[0] + I[1]*I[1] + I[2]*I[2] +
I[3]*I[3] + I[4]*I[4] + I[5]*I[5] +
@@ -24645,28 +24645,28 @@ namespace cimg_library {
case 2 : {
T I[4] = { 0 };
cimg_forZV(*this,z,v) cimg_for2x2(*this,x,y,z,v,I) dest(x,y,z,v) = (Ttfloat)
- (I[0]*mask[0] + I[1]*mask[1] +
- I[2]*mask[2] + I[3]*mask[3]);
+ (I[0]*tqmask[0] + I[1]*tqmask[1] +
+ I[2]*tqmask[2] + I[3]*tqmask[3]);
if (weighted_correl) cimg_forZV(*this,z,v) cimg_for2x2(*this,x,y,z,v,I) {
const double weight = (double)(I[0]*I[0] + I[1]*I[1] +
I[2]*I[2] + I[3]*I[3]);
if (weight>0) dest(x,y,z,v)/=(Ttfloat)cimg_std::sqrt(weight);
}
} break;
- case 1 : (dest.assign(*this))*=mask(0); break;
+ case 1 : (dest.assign(*this))*=tqmask(0); break;
}
}
- } else { // Generic version for other masks
+ } else { // Generic version for other tqmasks
const int
- mx2 = mask.dimx()/2, my2 = mask.dimy()/2, mz2 = mask.dimz()/2,
- mx1 = mx2 - 1 + (mask.dimx()%2), my1 = my2 - 1 + (mask.dimy()%2), mz1 = mz2 - 1 + (mask.dimz()%2),
+ mx2 = tqmask.dimx()/2, my2 = tqmask.dimy()/2, mz2 = tqmask.dimz()/2,
+ mx1 = mx2 - 1 + (tqmask.dimx()%2), my1 = my2 - 1 + (tqmask.dimy()%2), mz1 = mz2 - 1 + (tqmask.dimz()%2),
mxe = dimx() - mx2, mye = dimy() - my2, mze = dimz() - mz2;
cimg_forV(*this,v)
if (!weighted_correl) { // Classical correlation
for (int z = mz1; z<mze; ++z) for (int y = my1; y<mye; ++y) for (int x = mx1; x<mxe; ++x) {
Ttfloat val = 0;
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm)
- val+=(*this)(x+xm,y+ym,z+zm,v)*mask(mx1+xm,my1+ym,mz1+zm);
+ val+=(*this)(x+xm,y+ym,z+zm,v)*tqmask(mx1+xm,my1+ym,mz1+zm);
dest(x,y,z,v) = (Ttfloat)val;
}
if (cond)
@@ -24674,7 +24674,7 @@ namespace cimg_library {
for (int x = 0; x<dimx(); (y<my1 || y>=mye || z<mz1 || z>=mze)?++x:((x<mx1-1 || x>=mxe)?++x:(x=mxe))) {
Ttfloat val = 0;
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm)
- val+=_atXYZ(x+xm,y+ym,z+zm,v)*mask(mx1+xm,my1+ym,mz1+zm);
+ val+=_atXYZ(x+xm,y+ym,z+zm,v)*tqmask(mx1+xm,my1+ym,mz1+zm);
dest(x,y,z,v) = (Ttfloat)val;
}
else
@@ -24682,7 +24682,7 @@ namespace cimg_library {
for (int x = 0; x<dimx(); (y<my1 || y>=mye || z<mz1 || z>=mze)?++x:((x<mx1-1 || x>=mxe)?++x:(x=mxe))) {
Ttfloat val = 0;
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm)
- val+=atXYZ(x+xm,y+ym,z+zm,v,0)*mask(mx1+xm,my1+ym,mz1+zm);
+ val+=atXYZ(x+xm,y+ym,z+zm,v,0)*tqmask(mx1+xm,my1+ym,mz1+zm);
dest(x,y,z,v) = (Ttfloat)val;
}
} else { // Weighted correlation
@@ -24690,7 +24690,7 @@ namespace cimg_library {
Ttfloat val = 0, weight = 0;
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
const Ttfloat cval = (Ttfloat)(*this)(x+xm,y+ym,z+zm,v);
- val+=cval*mask(mx1+xm,my1+ym,mz1+zm);
+ val+=cval*tqmask(mx1+xm,my1+ym,mz1+zm);
weight+=cval*cval;
}
dest(x,y,z,v) = (weight>(Ttfloat)0)?(Ttfloat)(val/cimg_std::sqrt((double)weight)):(Ttfloat)0;
@@ -24701,7 +24701,7 @@ namespace cimg_library {
Ttfloat val = 0, weight = 0;
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
const Ttfloat cval = (Ttfloat)_atXYZ(x+xm,y+ym,z+zm,v);
- val+=cval*mask(mx1+xm,my1+ym,mz1+zm);
+ val+=cval*tqmask(mx1+xm,my1+ym,mz1+zm);
weight+=cval*cval;
}
dest(x,y,z,v) = (weight>(Ttfloat)0)?(Ttfloat)(val/cimg_std::sqrt((double)weight)):(Ttfloat)0;
@@ -24712,7 +24712,7 @@ namespace cimg_library {
Ttfloat val = 0, weight = 0;
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
const Ttfloat cval = (Ttfloat)atXYZ(x+xm,y+ym,z+zm,v,0);
- val+=cval*mask(mx1+xm,my1+ym,mz1+zm);
+ val+=cval*tqmask(mx1+xm,my1+ym,mz1+zm);
weight+=cval*cval;
}
dest(x,y,z,v) = (weight>(Ttfloat)0)?(Ttfloat)(val/cimg_std::sqrt((double)weight)):(Ttfloat)0;
@@ -24722,50 +24722,50 @@ namespace cimg_library {
return dest;
}
- //! Compute the convolution of the image by a mask.
+ //! Compute the convolution of the image by a tqmask.
/**
- The result \p res of the convolution of an image \p img by a mask \p mask is defined to be :
+ The result \p res of the convolution of an image \p img by a tqmask \p tqmask is defined to be :
- res(x,y,z) = sum_{i,j,k} img(x-i,y-j,z-k)*mask(i,j,k)
+ res(x,y,z) = sum_{i,j,k} img(x-i,y-j,z-k)*tqmask(i,j,k)
- \param mask = the correlation kernel.
+ \param tqmask = the correlation kernel.
\param cond = the border condition type (0=zero, 1=dirichlet)
\param weighted_convol = enable local normalization.
**/
template<typename t>
- CImg<T>& convolve(const CImg<t>& mask, const unsigned int cond=1, const bool weighted_convol=false) {
- return get_convolve(mask,cond,weighted_convol).transfer_to(*this);
+ CImg<T>& convolve(const CImg<t>& tqmask, const unsigned int cond=1, const bool weighted_convol=false) {
+ return get_convolve(tqmask,cond,weighted_convol).transfer_to(*this);
}
template<typename t>
- CImg<typename cimg::superset2<T,t,float>::type> get_convolve(const CImg<t>& mask, const unsigned int cond=1,
+ CImg<typename cimg::superset2<T,t,float>::type> get_convolve(const CImg<t>& tqmask, const unsigned int cond=1,
const bool weighted_convol=false) const {
typedef typename cimg::superset2<T,t,float>::type Ttfloat;
if (is_empty()) return *this;
- if (!mask || mask.dim!=1)
- throw CImgArgumentException("CImg<%s>::convolve() : Specified mask (%u,%u,%u,%u,%p) is not scalar.",
- pixel_type(),mask.width,mask.height,mask.depth,mask.dim,mask.data);
- return get_correlate(CImg<t>(mask.ptr(),mask.size(),1,1,1,true).get_mirror('x').resize(mask,-1),cond,weighted_convol);
+ if (!tqmask || tqmask.dim!=1)
+ throw CImgArgumentException("CImg<%s>::convolve() : Specified tqmask (%u,%u,%u,%u,%p) is not scalar.",
+ pixel_type(),tqmask.width,tqmask.height,tqmask.depth,tqmask.dim,tqmask.data);
+ return get_correlate(CImg<t>(tqmask.ptr(),tqmask.size(),1,1,1,true).get_mirror('x').resize(tqmask,-1),cond,weighted_convol);
}
//! Return the erosion of the image by a structuring element.
template<typename t>
- CImg<T>& erode(const CImg<t>& mask, const unsigned int cond=1, const bool weighted_erosion=false) {
- return get_erode(mask,cond,weighted_erosion).transfer_to(*this);
+ CImg<T>& erode(const CImg<t>& tqmask, const unsigned int cond=1, const bool weighted_erosion=false) {
+ return get_erode(tqmask,cond,weighted_erosion).transfer_to(*this);
}
template<typename t>
- CImg<typename cimg::superset<T,t>::type> get_erode(const CImg<t>& mask, const unsigned int cond=1,
+ CImg<typename cimg::superset<T,t>::type> get_erode(const CImg<t>& tqmask, const unsigned int cond=1,
const bool weighted_erosion=false) const {
typedef typename cimg::superset<T,t>::type Tt;
if (is_empty()) return *this;
- if (!mask || mask.dim!=1)
- throw CImgArgumentException("CImg<%s>::erode() : Specified mask (%u,%u,%u,%u,%p) is not a scalar image.",
- pixel_type(),mask.width,mask.height,mask.depth,mask.dim,mask.data);
+ if (!tqmask || tqmask.dim!=1)
+ throw CImgArgumentException("CImg<%s>::erode() : Specified tqmask (%u,%u,%u,%u,%p) is not a scalar image.",
+ pixel_type(),tqmask.width,tqmask.height,tqmask.depth,tqmask.dim,tqmask.data);
CImg<Tt> dest(width,height,depth,dim);
const int
- mx2 = mask.dimx()/2, my2 = mask.dimy()/2, mz2 = mask.dimz()/2,
- mx1 = mx2 - 1 + (mask.dimx()%2), my1 = my2 - 1 + (mask.dimy()%2), mz1 = mz2 - 1 + (mask.dimz()%2),
+ mx2 = tqmask.dimx()/2, my2 = tqmask.dimy()/2, mz2 = tqmask.dimz()/2,
+ mx1 = mx2 - 1 + (tqmask.dimx()%2), my1 = my2 - 1 + (tqmask.dimy()%2), mz1 = mz2 - 1 + (tqmask.dimz()%2),
mxe = dimx() - mx2, mye = dimy() - my2, mze = dimz() - mz2;
cimg_forV(*this,v)
if (!weighted_erosion) { // Classical erosion
@@ -24773,7 +24773,7 @@ namespace cimg_library {
Tt min_val = cimg::type<Tt>::max();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
const Tt cval = (Tt)(*this)(x+xm,y+ym,z+zm,v);
- if (mask(mx1+xm,my1+ym,mz1+zm) && cval<min_val) min_val = cval;
+ if (tqmask(mx1+xm,my1+ym,mz1+zm) && cval<min_val) min_val = cval;
}
dest(x,y,z,v) = min_val;
}
@@ -24783,7 +24783,7 @@ namespace cimg_library {
Tt min_val = cimg::type<Tt>::max();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
const T cval = (Tt)_atXYZ(x+xm,y+ym,z+zm,v);
- if (mask(mx1+xm,my1+ym,mz1+zm) && cval<min_val) min_val = cval;
+ if (tqmask(mx1+xm,my1+ym,mz1+zm) && cval<min_val) min_val = cval;
}
dest(x,y,z,v) = min_val;
}
@@ -24793,7 +24793,7 @@ namespace cimg_library {
Tt min_val = cimg::type<Tt>::max();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
const T cval = (Tt)atXYZ(x+xm,y+ym,z+zm,v,0);
- if (mask(mx1+xm,my1+ym,mz1+zm) && cval<min_val) min_val = cval;
+ if (tqmask(mx1+xm,my1+ym,mz1+zm) && cval<min_val) min_val = cval;
}
dest(x,y,z,v) = min_val;
}
@@ -24801,7 +24801,7 @@ namespace cimg_library {
for (int z = mz1; z<mze; ++z) for (int y = my1; y<mye; ++y) for (int x = mx1; x<mxe; ++x) {
Tt min_val = cimg::type<Tt>::max();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
- const t mval = mask(mx1+xm,my1+ym,mz1+zm);
+ const t mval = tqmask(mx1+xm,my1+ym,mz1+zm);
const Tt cval = (Tt)((*this)(x+xm,y+ym,z+zm,v) + mval);
if (mval && cval<min_val) min_val = cval;
}
@@ -24812,7 +24812,7 @@ namespace cimg_library {
for (int x = 0; x<dimx(); (y<my1 || y>=mye || z<mz1 || z>=mze)?++x:((x<mx1-1 || x>=mxe)?++x:(x=mxe))) {
Tt min_val = cimg::type<Tt>::max();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
- const t mval = mask(mx1+xm,my1+ym,mz1+zm);
+ const t mval = tqmask(mx1+xm,my1+ym,mz1+zm);
const Tt cval = (Tt)(_atXYZ(x+xm,y+ym,z+zm,v) + mval);
if (mval && cval<min_val) min_val = cval;
}
@@ -24823,7 +24823,7 @@ namespace cimg_library {
for (int x = 0; x<dimx(); (y<my1 || y>=mye || z<mz1 || z>=mze)?++x:((x<mx1-1 || x>=mxe)?++x:(x=mxe))) {
Tt min_val = cimg::type<Tt>::max();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
- const t mval = mask(mx1+xm,my1+ym,mz1+zm);
+ const t mval = tqmask(mx1+xm,my1+ym,mz1+zm);
const Tt cval = (Tt)(atXYZ(x+xm,y+ym,z+zm,v,0) + mval);
if (mval && cval<min_val) min_val = cval;
}
@@ -24840,32 +24840,32 @@ namespace cimg_library {
}
CImg<T> get_erode(const unsigned int n, const unsigned int cond=1) const {
- static CImg<T> mask;
+ static CImg<T> tqmask;
if (n<2) return *this;
- if (mask.width!=n) mask.assign(n,n,1,1,1);
- const CImg<T> res = get_erode(mask,cond,false);
- if (n>20) mask.assign();
+ if (tqmask.width!=n) tqmask.assign(n,n,1,1,1);
+ const CImg<T> res = get_erode(tqmask,cond,false);
+ if (n>20) tqmask.assign();
return res;
}
//! Dilate the image by a structuring element.
template<typename t>
- CImg<T>& dilate(const CImg<t>& mask, const unsigned int cond=1, const bool weighted_dilatation=false) {
- return get_dilate(mask,cond,weighted_dilatation).transfer_to(*this);
+ CImg<T>& dilate(const CImg<t>& tqmask, const unsigned int cond=1, const bool weighted_dilatation=false) {
+ return get_dilate(tqmask,cond,weighted_dilatation).transfer_to(*this);
}
template<typename t>
- CImg<typename cimg::superset<T,t>::type> get_dilate(const CImg<t>& mask, const unsigned int cond=1,
+ CImg<typename cimg::superset<T,t>::type> get_dilate(const CImg<t>& tqmask, const unsigned int cond=1,
const bool weighted_dilatation=false) const {
typedef typename cimg::superset<T,t>::type Tt;
if (is_empty()) return *this;
- if (!mask || mask.dim!=1)
- throw CImgArgumentException("CImg<%s>::dilate() : Specified mask (%u,%u,%u,%u,%p) is not a scalar image.",
- pixel_type(),mask.width,mask.height,mask.depth,mask.dim,mask.data);
+ if (!tqmask || tqmask.dim!=1)
+ throw CImgArgumentException("CImg<%s>::dilate() : Specified tqmask (%u,%u,%u,%u,%p) is not a scalar image.",
+ pixel_type(),tqmask.width,tqmask.height,tqmask.depth,tqmask.dim,tqmask.data);
CImg<Tt> dest(width,height,depth,dim);
const int
- mx2 = mask.dimx()/2, my2 = mask.dimy()/2, mz2 = mask.dimz()/2,
- mx1 = mx2 - 1 + (mask.dimx()%2), my1 = my2 - 1 + (mask.dimy()%2), mz1 = mz2 - 1 + (mask.dimz()%2),
+ mx2 = tqmask.dimx()/2, my2 = tqmask.dimy()/2, mz2 = tqmask.dimz()/2,
+ mx1 = mx2 - 1 + (tqmask.dimx()%2), my1 = my2 - 1 + (tqmask.dimy()%2), mz1 = mz2 - 1 + (tqmask.dimz()%2),
mxe = dimx() - mx2, mye = dimy() - my2, mze = dimz() - mz2;
cimg_forV(*this,v)
if (!weighted_dilatation) { // Classical dilatation
@@ -24873,7 +24873,7 @@ namespace cimg_library {
Tt max_val = cimg::type<Tt>::min();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
const Tt cval = (Tt)(*this)(x+xm,y+ym,z+zm,v);
- if (mask(mx1+xm,my1+ym,mz1+zm) && cval>max_val) max_val = cval;
+ if (tqmask(mx1+xm,my1+ym,mz1+zm) && cval>max_val) max_val = cval;
}
dest(x,y,z,v) = max_val;
}
@@ -24883,7 +24883,7 @@ namespace cimg_library {
Tt max_val = cimg::type<Tt>::min();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
const T cval = (Tt)_atXYZ(x+xm,y+ym,z+zm,v);
- if (mask(mx1+xm,my1+ym,mz1+zm) && cval>max_val) max_val = cval;
+ if (tqmask(mx1+xm,my1+ym,mz1+zm) && cval>max_val) max_val = cval;
}
dest(x,y,z,v) = max_val;
}
@@ -24893,7 +24893,7 @@ namespace cimg_library {
Tt max_val = cimg::type<Tt>::min();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
const T cval = (Tt)atXYZ(x+xm,y+ym,z+zm,v,0);
- if (mask(mx1+xm,my1+ym,mz1+zm) && cval>max_val) max_val = cval;
+ if (tqmask(mx1+xm,my1+ym,mz1+zm) && cval>max_val) max_val = cval;
}
dest(x,y,z,v) = max_val;
}
@@ -24901,7 +24901,7 @@ namespace cimg_library {
for (int z = mz1; z<mze; ++z) for (int y = my1; y<mye; ++y) for (int x = mx1; x<mxe; ++x) {
Tt max_val = cimg::type<Tt>::min();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
- const t mval = mask(mx1+xm,my1+ym,mz1+zm);
+ const t mval = tqmask(mx1+xm,my1+ym,mz1+zm);
const Tt cval = (Tt)((*this)(x+xm,y+ym,z+zm,v) - mval);
if (mval && cval>max_val) max_val = cval;
}
@@ -24912,7 +24912,7 @@ namespace cimg_library {
for (int x = 0; x<dimx(); (y<my1 || y>=mye || z<mz1 || z>=mze)?++x:((x<mx1-1 || x>=mxe)?++x:(x=mxe))) {
Tt max_val = cimg::type<Tt>::min();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
- const t mval = mask(mx1+xm,my1+ym,mz1+zm);
+ const t mval = tqmask(mx1+xm,my1+ym,mz1+zm);
const Tt cval = (Tt)(_atXYZ(x+xm,y+ym,z+zm,v) - mval);
if (mval && cval>max_val) max_val = cval;
}
@@ -24923,7 +24923,7 @@ namespace cimg_library {
for (int x = 0; x<dimx(); (y<my1 || y>=mye || z<mz1 || z>=mze)?++x:((x<mx1-1 || x>=mxe)?++x:(x=mxe))) {
Tt max_val = cimg::type<Tt>::min();
for (int zm = -mz1; zm<=mz2; ++zm) for (int ym = -my1; ym<=my2; ++ym) for (int xm = -mx1; xm<=mx2; ++xm) {
- const t mval = mask(mx1+xm,my1+ym,mz1+zm);
+ const t mval = tqmask(mx1+xm,my1+ym,mz1+zm);
const Tt cval = (Tt)(atXYZ(x+xm,y+ym,z+zm,v,0) - mval);
if (mval && cval>max_val) max_val = cval;
}
@@ -24940,11 +24940,11 @@ namespace cimg_library {
}
CImg<T> get_dilate(const unsigned int n, const unsigned int cond=1) const {
- static CImg<T> mask;
+ static CImg<T> tqmask;
if (n<2) return *this;
- if (mask.width!=n) mask.assign(n,n,1,1,1);
- const CImg<T> res = get_dilate(mask,cond,false);
- if (n>20) mask.assign();
+ if (tqmask.width!=n) tqmask.assign(n,n,1,1,1);
+ const CImg<T> res = get_dilate(tqmask,cond,false);
+ if (n>20) tqmask.assign();
return res;
}
@@ -25476,12 +25476,12 @@ namespace cimg_library {
//! Blur an image in an anisotropic way.
/**
- \param mask Binary mask.
+ \param tqmask Binary tqmask.
\param amplitude Amplitude of the anisotropic blur.
\param sharpness Contour preservation.
\param anisotropy Smoothing anisotropy.
\param alpha Image pre-blurring (gaussian).
- \param sigma Regularity of the tensor-valued geometry.
+ \param sigma Regularity of the tensor-valued tqgeometry.
\param dl Spatial discretization.
\param da Angular discretization.
\param gauss_prec Precision of the gaussian function.
@@ -25490,7 +25490,7 @@ namespace cimg_library {
\param geom_factor Geometry factor.
**/
template<typename tm>
- CImg<T>& blur_anisotropic(const CImg<tm>& mask, const float amplitude, const float sharpness=0.7f, const float anisotropy=0.3f,
+ CImg<T>& blur_anisotropic(const CImg<tm>& tqmask, const float amplitude, const float sharpness=0.7f, const float anisotropy=0.3f,
const float alpha=0.6f, const float sigma=1.1f, const float dl=0.8f, const float da=30,
const float gauss_prec=2, const unsigned int interpolation_type=0, const bool fast_approx=true,
const float geom_factor=1) {
@@ -25502,7 +25502,7 @@ namespace cimg_library {
"Admissible parameters are in the range : amplitude>0, sharpness>0, anisotropy in [0,1], "
"alpha>0, sigma>0, dl>0, da>0, gauss_prec>0.",
pixel_type(),amplitude,sharpness,anisotropy,alpha,sigma,dl,da,gauss_prec);
- const bool threed = (depth>1), no_mask = mask.is_empty();
+ const bool threed = (depth>1), no_tqmask = tqmask.is_empty();
const float nsharpness = cimg::max(sharpness,1e-5f), power1 = 0.5f*nsharpness, power2 = power1/(1e-7f+1-anisotropy);
CImg<floatT> blurred = CImg<floatT>(*this,false).blur(alpha);
if (geom_factor>0) blurred*=geom_factor;
@@ -25513,7 +25513,7 @@ namespace cimg_library {
CImg<floatT> val(3), vec(3,3), G(blurred.get_structure_tensor());
if (sigma>0) G.blur(sigma);
cimg_forXYZ(*this,x,y,z) {
- if (no_mask || mask(x,y,z)) {
+ if (no_tqmask || tqmask(x,y,z)) {
G.get_tensor_at(x,y,z).symmetric_eigen(val,vec);
const float l1 = val[2], l2 = val[1], l3 = val[0],
ux = vec(0,0), uy = vec(0,1), uz = vec(0,2),
@@ -25537,7 +25537,7 @@ namespace cimg_library {
CImg<floatT> val(2), vec(2,2), G(blurred.get_structure_tensor());
if (sigma>0) G.blur(sigma);
cimg_forXY(*this,x,y) {
- if (no_mask || mask(x,y)) {
+ if (no_tqmask || tqmask(x,y)) {
G.get_tensor_at(x,y).symmetric_eigen(val,vec);
const float l1 = val[1], l2 = val[0],
ux = vec(1,0), uy = vec(1,1),
@@ -25558,11 +25558,11 @@ namespace cimg_library {
}
template<typename tm>
- CImg<T> get_blur_anisotropic(const CImg<tm>& mask, const float amplitude, const float sharpness=0.7f, const float anisotropy=0.3f,
+ CImg<T> get_blur_anisotropic(const CImg<tm>& tqmask, const float amplitude, const float sharpness=0.7f, const float anisotropy=0.3f,
const float alpha=0.6f, const float sigma=1.1f, const float dl=0.8f,
const float da=30, const float gauss_prec=2, const unsigned int interpolation_type=0,
const bool fast_approx=true, const float geom_factor=1) const {
- return (+*this).blur_anisotropic(mask,amplitude,sharpness,anisotropy,alpha,sigma,dl,da,gauss_prec,interpolation_type,fast_approx,geom_factor);
+ return (+*this).blur_anisotropic(tqmask,amplitude,sharpness,anisotropy,alpha,sigma,dl,da,gauss_prec,interpolation_type,fast_approx,geom_factor);
}
//! Blur an image following in an anisotropic way.
@@ -27671,13 +27671,13 @@ namespace cimg_library {
return *this;
}
- //! Simple interface to select a shape from an image.
+ //! Simple interface to select a tqshape from an image.
/**
\param selection Array of 6 values containing the selection result
- \param coords_type Determine shape type to select (0=point, 1=vector, 2=rectangle, 3=circle)
+ \param coords_type Determine tqshape type to select (0=point, 1=vector, 2=rectangle, 3=circle)
\param disp Display window used to make the selection
\param XYZ Initial XYZ position (for volumetric images only)
- \param color Color of the shape selector.
+ \param color Color of the tqshape selector.
**/
CImg<T>& select(CImgDisplay &disp,
const int select_type=2, unsigned int *const XYZ=0,
@@ -27685,21 +27685,21 @@ namespace cimg_library {
return get_select(disp,select_type,XYZ,color).transfer_to(*this);
}
- //! Simple interface to select a shape from an image.
+ //! Simple interface to select a tqshape from an image.
CImg<T>& select(const char *const title,
const int select_type=2, unsigned int *const XYZ=0,
const unsigned char *const color=0) {
return get_select(title,select_type,XYZ,color).transfer_to(*this);
}
- //! Simple interface to select a shape from an image.
+ //! Simple interface to select a tqshape from an image.
CImg<intT> get_select(CImgDisplay &disp,
const int select_type=2, unsigned int *const XYZ=0,
const unsigned char *const color=0) const {
return _get_select(disp,0,select_type,XYZ,color,0,0,0);
}
- //! Simple interface to select a shape from an image.
+ //! Simple interface to select a tqshape from an image.
CImg<intT> get_select(const char *const title,
const int select_type=2, unsigned int *const XYZ=0,
const unsigned char *const color=0) const {
@@ -27737,11 +27737,11 @@ namespace cimg_library {
oX = X, oY = Y, oZ = Z;
unsigned int old_button = 0, key = 0;
- bool shape_selected = false, text_down = false;
+ bool tqshape_selected = false, text_down = false;
CImg<ucharT> visu, visu0;
char text[1024] = { 0 };
- while (!key && !disp.is_closed && !shape_selected) {
+ while (!key && !disp.is_closed && !tqshape_selected) {
// Handle mouse motion and selection
oX = X; oY = Y; oZ = Z;
@@ -27837,10 +27837,10 @@ namespace cimg_library {
}
if (phase) {
- if (!coords_type) shape_selected = phase?true:false;
+ if (!coords_type) tqshape_selected = phase?true:false;
else {
- if (depth>1) shape_selected = (phase==3)?true:false;
- else shape_selected = (phase==2)?true:false;
+ if (depth>1) tqshape_selected = (phase==3)?true:false;
+ else tqshape_selected = (phase==2)?true:false;
}
}
@@ -27986,7 +27986,7 @@ namespace cimg_library {
}
if (phase || (mx>=0 && my>=0)) visu.draw_text(0,text_down?visu.dimy()-11:0,text,foreground_color,background_color,0.7f,11);
disp.display(visu).wait(25);
- } else if (!shape_selected) disp.wait();
+ } else if (!tqshape_selected) disp.wait();
if (disp.is_resized) { disp.resize(false); old_is_resized = true; disp.is_resized = false; visu0.assign(); }
}
@@ -27994,7 +27994,7 @@ namespace cimg_library {
// Return result
CImg<intT> res(1,6,1,1,-1);
if (XYZ) { XYZ[0] = (unsigned int)X0; XYZ[1] = (unsigned int)Y0; XYZ[2] = (unsigned int)Z0; }
- if (shape_selected) {
+ if (tqshape_selected) {
if (coords_type==2) {
if (X0>X1) cimg::swap(X0,X1);
if (Y0>Y1) cimg::swap(Y0,Y1);
@@ -29139,27 +29139,27 @@ namespace cimg_library {
switch (bpp) {
case 1 : { // Monochrome
for (int y=height-1; y>=0; --y) {
- unsigned char mask = 0x80, val = 0;
+ unsigned char tqmask = 0x80, val = 0;
cimg_forX(*this,x) {
- if (mask==0x80) val = *(ptrs++);
- const unsigned char *col = (unsigned char*)(palette+(val&mask?1:0));
+ if (tqmask==0x80) val = *(ptrs++);
+ const unsigned char *col = (unsigned char*)(palette+(val&tqmask?1:0));
(*this)(x,y,2) = (T)*(col++);
(*this)(x,y,1) = (T)*(col++);
(*this)(x,y,0) = (T)*(col++);
- mask = cimg::ror(mask);
+ tqmask = cimg::ror(tqmask);
} ptrs+=align; }
} break;
case 4 : { // 16 colors
for (int y=height-1; y>=0; --y) {
- unsigned char mask = 0xF0, val = 0;
+ unsigned char tqmask = 0xF0, val = 0;
cimg_forX(*this,x) {
- if (mask==0xF0) val = *(ptrs++);
- const unsigned char color = (unsigned char)((mask<16)?(val&mask):((val&mask)>>4));
+ if (tqmask==0xF0) val = *(ptrs++);
+ const unsigned char color = (unsigned char)((tqmask<16)?(val&tqmask):((val&tqmask)>>4));
unsigned char *col = (unsigned char*)(palette+color);
(*this)(x,y,2) = (T)*(col++);
(*this)(x,y,1) = (T)*(col++);
(*this)(x,y,0) = (T)*(col++);
- mask = cimg::ror(mask,4);
+ tqmask = cimg::ror(tqmask,4);
} ptrs+=align; }
} break;
case 8 : { // 256 colors
@@ -29775,7 +29775,7 @@ namespace cimg_library {
unsigned int nb_images = 0;
do ++nb_images; while (TIFFReadDirectory(tif));
if (nfirst_frame>=nb_images || (nlast_frame!=~0U && nlast_frame>=nb_images))
- cimg::warn("CImg<%s>::load_tiff() : File '%s' contains %u image(s), specified frame range is [%u,%u] (step %u).",
+ cimg::warn("CImg<%s>::load_tiff() : File '%s' tqcontains %u image(s), specified frame range is [%u,%u] (step %u).",
pixel_type(),filename,nb_images,nfirst_frame,nlast_frame,nstep_frame);
if (nfirst_frame>=nb_images) return assign();
if (nlast_frame>=nb_images) nlast_frame = nb_images-1;
@@ -33391,49 +33391,49 @@ namespace cimg_library {
//! Return \c true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z,v).
template<typename t>
- bool contains(const T& pixel, t& n, t& x, t&y, t& z, t& v) const {
+ bool tqcontains(const T& pixel, t& n, t& x, t&y, t& z, t& v) const {
if (is_empty()) return false;
- cimglist_for(*this,l) if (data[l].contains(pixel,x,y,z,v)) { n = (t)l; return true; }
+ cimglist_for(*this,l) if (data[l].tqcontains(pixel,x,y,z,v)) { n = (t)l; return true; }
return false;
}
//! Return \c true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y,z).
template<typename t>
- bool contains(const T& pixel, t& n, t& x, t&y, t& z) const {
+ bool tqcontains(const T& pixel, t& n, t& x, t&y, t& z) const {
t v;
- return contains(pixel,n,x,y,z,v);
+ return tqcontains(pixel,n,x,y,z,v);
}
//! Return \c true if one of the image list contains the specified referenced value. If true, set coordinates (n,x,y).
template<typename t>
- bool contains(const T& pixel, t& n, t& x, t&y) const {
+ bool tqcontains(const T& pixel, t& n, t& x, t&y) const {
t z,v;
- return contains(pixel,n,x,y,z,v);
+ return tqcontains(pixel,n,x,y,z,v);
}
//! Return \c true if one of the image list contains the specified referenced value. If true, set coordinates (n,x).
template<typename t>
- bool contains(const T& pixel, t& n, t& x) const {
+ bool tqcontains(const T& pixel, t& n, t& x) const {
t y,z,v;
- return contains(pixel,n,x,y,z,v);
+ return tqcontains(pixel,n,x,y,z,v);
}
//! Return \c true if one of the image list contains the specified referenced value. If true, set coordinates (n).
template<typename t>
- bool contains(const T& pixel, t& n) const {
+ bool tqcontains(const T& pixel, t& n) const {
t x,y,z,v;
- return contains(pixel,n,x,y,z,v);
+ return tqcontains(pixel,n,x,y,z,v);
}
//! Return \c true if one of the image list contains the specified referenced value.
- bool contains(const T& pixel) const {
+ bool tqcontains(const T& pixel) const {
unsigned int n,x,y,z,v;
- return contains(pixel,n,x,y,z,v);
+ return tqcontains(pixel,n,x,y,z,v);
}
//! Return \c true if the list contains the image 'img'. If true, returns the position (n) of the image in the list.
template<typename t>
- bool contains(const CImg<T>& img, t& n) const {
+ bool tqcontains(const CImg<T>& img, t& n) const {
if (is_empty()) return false;
const CImg<T> *const ptr = &img;
cimglist_for(*this,i) if (data+i==ptr) { n = (t)i; return true; }
@@ -33441,9 +33441,9 @@ namespace cimg_library {
}
//! Return \c true if the list contains the image img.
- bool contains(const CImg<T>& img) const {
+ bool tqcontains(const CImg<T>& img) const {
unsigned int n;
- return contains(img,n);
+ return tqcontains(img,n);
}
//@}
@@ -34714,7 +34714,7 @@ namespace cimg_library {
//! Return a single image which is the concatenation of all images of the current CImgList instance.
/**
\param axis : specify the axis for image concatenation. Can be 'x','y','z' or 'v'.
- \param align : specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
+ \param align : specify the tqalignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
\return A CImg<T> image corresponding to the concatenation is returned.
**/
CImg<T> get_append(const char axis, const char align='p') const {
@@ -35025,9 +35025,9 @@ namespace cimg_library {
for (unsigned int y=0; y<h; ++y)
for (unsigned int x=0; x<256*w; ++x) {
m>>=1; if (!m) { m = 0x80000000; val = *(ptr++); }
- CImg<T>& img = res[x/w], &mask = res[x/w+256];
+ CImg<T>& img = res[x/w], &tqmask = res[x/w+256];
unsigned int xm = x%w;
- img(xm,y,0) = img(xm,y,1) = img(xm,y,2) = mask(xm,y,0) = (T)((val&m)?1:0);
+ img(xm,y,0) = img(xm,y,1) = img(xm,y,2) = tqmask(xm,y,0) = (T)((val&m)?1:0);
}
if (variable_size) res.crop_font();
if (paddingx || paddingy) cimglist_for(res,l) res[l].resize(res[l].dimx()+paddingx, res[l].dimy()+paddingy,1,-100,0);
@@ -35041,7 +35041,7 @@ namespace cimg_library {
The function returns immediately.
\param disp : reference to an existing CImgDisplay instance, where the current image list will be displayed.
\param axis : specify the axis for image concatenation. Can be 'x','y','z' or 'v'.
- \param align : specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
+ \param align : specify the tqalignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
\return A reference to the current CImgList instance is returned.
**/
const CImgList<T>& display(CImgDisplay& disp, const char axis='x', const char align='p') const {
@@ -35056,7 +35056,7 @@ namespace cimg_library {
The function returns when a key is pressed or the display window is closed by the user.
\param title : specify the title of the opening display window.
\param axis : specify the axis for image concatenation. Can be 'x','y','z' or 'v'.
- \param align : specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
+ \param align : specify the tqalignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
\return A reference to the current CImgList instance is returned.
**/
const CImgList<T>& display(CImgDisplay &disp,
@@ -35922,7 +35922,7 @@ namespace cimg_library {
unsigned int nb_images = 0;
do ++nb_images; while (TIFFReadDirectory(tif));
if (nfirst_frame>=nb_images || (nlast_frame!=~0U && nlast_frame>=nb_images))
- cimg::warn("CImgList<%s>::load_tiff() : File '%s' contains %u image(s), specified frame range is [%u,%u] (step %u).",
+ cimg::warn("CImgList<%s>::load_tiff() : File '%s' tqcontains %u image(s), specified frame range is [%u,%u] (step %u).",
pixel_type(),filename,nb_images,nfirst_frame,nlast_frame,nstep_frame);
if (nfirst_frame>=nb_images) return assign();
if (nlast_frame>=nb_images) nlast_frame = nb_images-1;