Example #1
0
int					pyramid			(float				*inPtr,
									 int				levels,
									 float				*pyrHdl[],
									 long				nxRange[],
									 long				nyRange[],
									 long				nzRange[],
									 int				nx,
									 int				ny,
									 int				nz,
									 int				zSqueeze,
									 enum	iDegree		interpolation) {

		float				downFilter[maxTapsNumber], upFilter[maxTapsNumber];
		short				downTapsNb, upTapsNb;
		int					l;
		int					error;

		switch (interpolation) {
		  case zero:
			pyr_filters(downFilter, &downTapsNb, upFilter, &upTapsNb, (short)0);
			break;
		  case one:
			pyr_filters(downFilter, &downTapsNb, upFilter, &upTapsNb, (short)1);
			break;
		  case three:
			pyr_filters(downFilter, &downTapsNb, upFilter, &upTapsNb, (short)3);
			break;
		  default:
			message("ERROR - Invalid interpolation degree for pyramid computation");
			return(ERROR);
		}
		levels = pyr_getsize(nx, ny, nz, levels, nxRange, nyRange, nzRange);
		if (!zSqueeze)
		  for (l = 0; (l < levels); l++)
			nzRange[l] = (long)nz;
		for (l = 0; (l < levels); l++) {
		  pyrHdl[l] = (float *)malloc((size_t)nxRange[l] * (size_t)nyRange[l]
			* (size_t)nzRange[l] * sizeof(float));
		  if (pyrHdl[l] == (float *)NULL) {
			message("ERROR - Not enough memory for holding pyramid");
			return(ERROR);
		  }
		}
		copyClip(inPtr, nx, ny, nz, pyrHdl[0], (int)nxRange[0], (int)nyRange[0], (int)nzRange[0]);
		error = !ERROR;
		if (zSqueeze)
		  for (l = 1; (l < levels); l++)
			error = error || reduce3D(pyrHdl[l - 1], nxRange[l - 1], nyRange[l - 1],
			  nzRange[l - 1], pyrHdl[l], nxRange[l], nyRange[l], nzRange[l],
			  downFilter, downTapsNb);
		else
		  for (l = 1; (l < levels); l++)
			error = error || reduce2D(pyrHdl[l - 1], nxRange[l - 1], nyRange[l - 1],
			  nzRange[l - 1], pyrHdl[l], nxRange[l], nyRange[l], nzRange[l],
			  downFilter, downTapsNb);
		return(error);
} /* End of pyramid */
Example #2
0
void TimelineDock::removeSelection(bool withCopy)
{
    if (isTrackLocked(currentTrack())) {
        pulseLockButtonOnTrack(currentTrack());
        return;
    }
    if (selection().isEmpty())
        selectClipUnderPlayhead();
    if (selection().isEmpty() || currentTrack() < 0)
        return;

    if (withCopy)
        copyClip(currentTrack(), selection().first());
    foreach (int index, selection())
        remove(currentTrack(), index);
}