void NodeOperation::determineResolution(unsigned int resolution[2],
                                        unsigned int preferredResolution[2])
{
  unsigned int temp[2];
  unsigned int temp2[2];

  for (unsigned int index = 0; index < m_inputs.size(); index++) {
    NodeOperationInput *input = m_inputs[index];
    if (input->isConnected()) {
      if (index == this->m_resolutionInputSocketIndex) {
        input->determineResolution(resolution, preferredResolution);
        temp2[0] = resolution[0];
        temp2[1] = resolution[1];
        break;
      }
    }
  }
  for (unsigned int index = 0; index < m_inputs.size(); index++) {
    NodeOperationInput *input = m_inputs[index];
    if (input->isConnected()) {
      if (index != this->m_resolutionInputSocketIndex) {
        input->determineResolution(temp, temp2);
      }
    }
  }
}
void MixBaseOperation::determineResolution(unsigned int resolution[2],
                                           unsigned int preferredResolution[2])
{
  NodeOperationInput *socket;
  unsigned int tempPreferredResolution[2] = {0, 0};
  unsigned int tempResolution[2];

  socket = this->getInputSocket(1);
  socket->determineResolution(tempResolution, tempPreferredResolution);
  if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
    this->setResolutionInputSocketIndex(1);
  }
  else {
    socket = this->getInputSocket(2);
    socket->determineResolution(tempResolution, tempPreferredResolution);
    if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
      this->setResolutionInputSocketIndex(2);
    }
    else {
      this->setResolutionInputSocketIndex(0);
    }
  }
  NodeOperation::determineResolution(resolution, preferredResolution);
}