コード例 #1
0
void Coeff3DTriLin4x4 ( int *theDim, /* dimensions of this buffer */
                        float* resBuf, /* result buffer */
                        int *resDim,  /* dimensions of this buffer */
                        double* mat,   /* transformation matrix */
                        int index
                        )
{
  char *proc = "Coeff3DTriLin4x4";
  size_t first = 0;
  size_t last;
  int i;
  typeChunks chunks;
  _LinearCoefficientParam p;
  
  /* preparing parallelism
   */
  first = 0;
  last = (size_t)resDim[2] * (size_t)resDim[1] * (size_t)resDim[0] - 1;
  initChunks( &chunks );
  if ( buildChunks( &chunks, first, last, proc ) != 1 ) {
    if ( _verbose_ )
      fprintf( stderr, "%s: unable to compute chunks\n", proc );
    return;
  }
  
  p.theDim = theDim;
  p.resBuf = resBuf;
  p.resDim = resDim;
  p.mat = mat;
  p.index = index;
  if ( index < 0 ) index = 0;
  if ( index > 7 ) index = 7;

  
  for ( i=0; i<chunks.n_allocated_chunks; i++ ) 
    chunks.data[i].parameters = (void*)(&p);
  
  /* processing
   */
  if ( processChunks( &_Coeff3DTriLin4x4, &chunks, proc ) != 1 ) {
    if ( _verbose_ )
      fprintf( stderr, "%s: unable to resample image\n", proc );
    freeChunks( &chunks );
    return;
  }
  
  freeChunks( &chunks );
}
コード例 #2
0
ファイル: bmpToPNG.cpp プロジェクト: boundarydevices/bdScript
static void flush_png_data( png_structp png_ptr )
{
   chunk_t *ch = get_png_chunk(png_ptr);
   if( ch ){
      freeChunks(ch);
      png_init_io(png_ptr,0);
   }
}
コード例 #3
0
ファイル: splitcsv.c プロジェクト: Goon83/scidb
inline void closeOutputFiles() {
    int i = 0;
    for (i = 0; i < _numOutputFiles; i++) {
        closeFile(_outputFiles[i]);
    }
    if (_outputFiles != NULL) {
        free(_outputFiles);
        _outputFiles = NULL;
    }
    freeChunks();
}
コード例 #4
0
ファイル: sash.c プロジェクト: AmerNasser/SashExtension
/*
 * Parse and execute one null-terminated command line string.
 * This breaks the command line up into words, checks to see if the
 * command is an alias, and expands wildcards.
 */
static void
command(const char * cmd)
{
	const char *	endCmd;
	const Alias *	alias;
	char		newCommand[CMD_LEN];
	char		cmdName[CMD_LEN];
	
	/*
	 * Rest the interrupt flag and free any memory chunks that
	 * were allocated by the previous command.
	 */
	intFlag = FALSE;
	
	freeChunks();
	
	/*
	 * Skip leading blanks.
	 */
	while (isBlank(*cmd))
		cmd++;
	
	/*
	 * If the command is empty or is a comment then ignore it.
	 */
	if ((*cmd == '\0') || (*cmd == '#'))
		return;
	
	/*
	 * Look for the end of the command name and then copy the
	 * command name to a buffer so we can null terminate it.
	 */
	endCmd = cmd;
	
	while (*endCmd && !isBlank(*endCmd))
		endCmd++;
	
	memcpy(cmdName, cmd, endCmd - cmd);
	
	cmdName[endCmd - cmd] = '\0';
	
	/*
	 * Search for the command name in the alias table.
	 * If it is found, then replace the command name with
	 * the alias value, and append the current command
	 * line arguments to that.
	 */
	alias = findAlias(cmdName);
	
	if (alias)
	{
		strcpy(newCommand, alias->value);
		strcat(newCommand, endCmd);
		
		cmd = newCommand;
	}
	
	/*
	 * Now look for the command in the builtin table, and execute
	 * the command if found.
	 */
	if (tryBuiltIn(cmd))
		return;
	
	/*
	 * The command is not a built-in, so run the program along
	 * the PATH list.
	 */
	runCmd(cmd);
}