summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/ui/comm.cc
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/ovision/ui/comm.cc')
-rw-r--r--2005/i/robert/src/ovision/ui/comm.cc44
1 files changed, 23 insertions, 21 deletions
diff --git a/2005/i/robert/src/ovision/ui/comm.cc b/2005/i/robert/src/ovision/ui/comm.cc
index beb4be8..0d692a2 100644
--- a/2005/i/robert/src/ovision/ui/comm.cc
+++ b/2005/i/robert/src/ovision/ui/comm.cc
@@ -38,7 +38,7 @@ Comm::init ()
fclose(file);
live_ = new Live (NBIMG);
- live_->init (fname);
+ live_->init (Image::rgb, fname);
}
/// Destructeur
@@ -111,31 +111,33 @@ Comm::executeUiCmds (const char *buffer)
break;
case 'm': // mélanger couleurs
- int nbColorToMerge, numIndexColor;
-
- // Si on recoit une commande de remise a zero de l'index_
- ss >> nbColorToMerge;
- if (nbColorToMerge == -1)
- {
- for (int i=0; i<live_->oconfig->nnNbColor; i++)
- live_->segm->index_[i] = i;
- }
- // Sinon on mix les couleurs
- else
{
- numIndexColor = live_->segm->index_[nbColorToMerge];
+ int nbColorToMerge, numIndexColor = 0;
- // On inscrit les changements dans l'index_
- int numColorToMerge;
- for (int i=1; i<nbColorToMerge; i++)
+ // Si on recoit une commande de remise a zero de l'index_
+ ss >> nbColorToMerge;
+ if (nbColorToMerge == -1)
{
- ss >> numColorToMerge;
- live_->segm->index_[numColorToMerge] = numIndexColor;
+ for (int i=0; i<live_->oconfig->nnNbColor; i++)
+ live_->segm->index_[i] = i;
}
+ // Sinon on mix les couleurs
+ else
+ {
+ numIndexColor = live_->segm->index_[nbColorToMerge];
+
+ // On inscrit les changements dans l'index_
+ int numColorToMerge;
+ for (int i=1; i<nbColorToMerge; i++)
+ {
+ ss >> numColorToMerge;
+ live_->segm->index_[numColorToMerge] = numIndexColor;
+ }
+ }
+ // On live_->segmente l'image puis on la stocke
+ live_->segmAndGroup();
+ std::cout << nbColorToMerge << " colors merged to " << numIndexColor << std::endl;
}
- // On live_->segmente l'image puis on la stocke
- live_->segmAndGroup();
- std::cout << nbColorToMerge << " colors merged to " << numIndexColor << std::endl;
break;
case 's': // isole une couleur