当前位置: 首页>>代码示例>>C++>>正文


C++ rowsize函数代码示例

本文整理汇总了C++中rowsize函数的典型用法代码示例。如果您正苦于以下问题:C++ rowsize函数的具体用法?C++ rowsize怎么用?C++ rowsize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rowsize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: lwshedtopo_lreconsdilat

/* ==================================== */
int32_t lwshedtopo_lreconsdilat(
        struct xvimage *g,
        struct xvimage *f,
        int32_t connex) 
/* reconstruction de g sous f */
/* g : image marqueur */
/* f : image masque */
/* connex : 4 ou 8 */
/* resultat dans g */
/* ==================================== */
{
#undef F_NAME
#define F_NAME "lwshedtopo_lreconsdilat"
  uint8_t *F = UCHARDATA(f);
  int32_t rs = rowsize(f);      /* taille ligne */
  int32_t cs = colsize(f);      /* taille colonne */
  int32_t ds = depth(f);        /* nb plans */
  int32_t N = rs * cs * ds;
  int32_t *CM;     // component mapping
  ctree * CT;  // component tree

  if ((rowsize(g) != rs) || (colsize(g) != cs) || (depth(g) != ds))
  {
    fprintf(stderr, "%s: incompatible sizes\n", F_NAME);
    return 0;
  }

  ComponentTree(F, rs, N, connex, &CT, &CM);
  Reconstruction(g, f, CM, CT);

  ComponentTreeFree(CT);
  free(CM);
  return(1);
} /* lwshedtopo_lreconsdilat() */
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:35,代码来源:lwshedtopo.c

示例2: lreconseros

/* ==================================== */
int32_t lreconseros(
        struct xvimage *g,
        struct xvimage *f,
        int32_t connex) 
/* reconstruction de g sur f */
/* g : image marqueur */
/* f : image masque */
/* connex : 4 ou 8 */
/* resultat dans g */
/* ==================================== */
{
#undef F_NAME
#define F_NAME "lreconseros"
  int32_t ret, i;
  int32_t rs = rowsize(f);      /* taille ligne */
  int32_t cs = colsize(f);      /* taille colonne */
  int32_t ds = depth(f);        /* nb plans */
  int32_t N = rs * cs * ds;
  uint8_t *F = UCHARDATA(f);
  uint8_t *G = UCHARDATA(g);
  if ((rowsize(g) != rs) || (colsize(g) != cs) || (depth(g) != ds))
  {
    fprintf(stderr, "%s: incompatible sizes\n", F_NAME);
    return 0;
  }
  for (i = 0; i < N; i++) F[i] = NDG_MAX - F[i];
  for (i = 0; i < N; i++) G[i] = NDG_MAX - G[i];
  ret = lwshedtopo_lreconsdilat(g, f, connex);
  for (i = 0; i < N; i++) G[i] = NDG_MAX - G[i];

  return(ret);
} /* lreconseros() */
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:33,代码来源:lwshedtopo.c

示例3: ldesfilsclairs3d

/* ==================================== */
int32_t ldesfilsclairs3d(struct xvimage * image, struct xvimage * mask, int32_t connexmin)
/* ==================================== */
#undef F_NAME
#define F_NAME "ldesfilsclairs3d"
{
  int32_t x;
  uint8_t *F = UCHARDATA(image);
  uint8_t *M;
  int32_t rs = rowsize(image);     /* taille ligne */
  int32_t cs = colsize(image);     /* taille colonne */
  int32_t ps = rs * cs;            /* taille plan */
  int32_t ds = depth(image);       /* nombre plans */
  int32_t N = ds * ps;             /* taille image */

  mctopo3d_init_topo3d();

  /* ---------------------------------------------------------- */
  /* calcul du resultat */
  /* ---------------------------------------------------------- */
  
  if (mask)
  {
    if ((rowsize(mask) != rs) || (colsize(mask) != cs) || (depth(mask) != ds))
    {
      fprintf(stderr, "%s: tailles image et mask incompatibles\n", F_NAME);
      return 0;
    }
    M = UCHARDATA(mask);
    if (connexmin == 6)
    {
      for (x = 0; x < N; x++) /* init : empile les points candidats */
        if (M[x] && (mctopo3d_filclair6(F, x, rs, ps, N)))
          F[x] = mctopo3d_alpha26m(F, x, rs, ps, N);
    }
    else
    {
      for (x = 0; x < N; x++) /* init : empile les points candidats */
        if (M[x] && (mctopo3d_filclair26(F, x, rs, ps, N)))
          F[x] = mctopo3d_alpha6m(F, x, rs, ps, N);
    }
  }
  else
  {
    if (connexmin == 6)
    {
      for (x = 0; x < N; x++) /* init : empile les points candidats */
        if (mctopo3d_filclair6(F, x, rs, ps, N))
          F[x] = mctopo3d_alpha26m(F, x, rs, ps, N);
    }
    else
    {
      for (x = 0; x < N; x++) /* init : empile les points candidats */
        if (mctopo3d_filclair26(F, x, rs, ps, N))
          F[x] = mctopo3d_alpha6m(F, x, rs, ps, N);
    }
  }

  mctopo3d_termine_topo3d();
  return 1;
} /* ldesfilsclairs3d() */
开发者ID:Johnson13,项目名称:xLearn,代码行数:61,代码来源:lfiltrestopo.c

示例4: ldespuits3d

/* ==================================== */
int32_t ldespuits3d(struct xvimage * image, struct xvimage * mask, int32_t connexmin)
/* ==================================== */
#undef F_NAME
#define F_NAME "ldespuits3d"
{
  int32_t i;
  uint8_t *F = UCHARDATA(image);
  uint8_t *M;
  int32_t rs = rowsize(image);     /* taille ligne */
  int32_t cs = colsize(image);     /* taille colonne */
  int32_t ps = rs * cs;            /* taille plan */
  int32_t ds = depth(image);       /* nombre plans */
  int32_t N = ds * ps;             /* taille image */

  mctopo3d_init_topo3d();

  /* ---------------------------------------------------------- */
  /* calcul du resultat */
  /* ---------------------------------------------------------- */
  
  if (mask)
  {
    if ((rowsize(mask) != rs) || (colsize(mask) != cs) || (depth(mask) != ds))
    {
      fprintf(stderr, "%s: tailles image et mask incompatibles\n", F_NAME);
      return 0;
    }
    M = UCHARDATA(mask);
    if (connexmin == 6)
    {
      for (i = 0; i < N; i++)
        if (M[i] && (mctopo3d_well6(F, i, rs, ps, N)))
          F[i] = mctopo3d_alpha6p(F, i, rs, ps, N);
    }
    else
    {
      for (i = 0; i < N; i++)
        if (M[i] && (mctopo3d_well26(F, i, rs, ps, N)))
          F[i] = mctopo3d_alpha26p(F, i, rs, ps, N);
    }
  }
  else
  {
    if (connexmin == 6)
    {
      for (i = 0; i < N; i++)
        if (mctopo3d_well6(F, i, rs, ps, N))
          F[i] = mctopo3d_alpha6p(F, i, rs, ps, N);      
    }
    else
    {
      for (i = 0; i < N; i++)
        if (mctopo3d_well26(F, i, rs, ps, N))
          F[i] = mctopo3d_alpha26p(F, i, rs, ps, N);      
    }
  }

  mctopo3d_termine_topo3d();
  return 1;
} /* ldespics3d() */
开发者ID:Johnson13,项目名称:xLearn,代码行数:61,代码来源:lfiltrestopo.c

示例5: ldilat_ldilat

/* ==================================== */
int32_t ldilat_ldilat( struct xvimage *f, 
            struct xvimage *m, 
            int32_t xc, 
            int32_t yc)
/* m : masque representant l'element structurant */
/* xc, yc : coordonnees du "centre" de l'element structurant */
/* ==================================== */
{
  int32_t x;                       /* index muet de pixel */
  int32_t y;                       /* index muet (generalement un voisin de x) */
  register int32_t i, j;           /* index muet */
  register int32_t k, l;           /* index muet */
  int32_t rs = rowsize(f);         /* taille ligne */
  int32_t cs = colsize(f);         /* taille colonne */
  int32_t N = rs * cs;             /* taille image */
  int32_t rsm = rowsize(m);        /* taille ligne masque */
  int32_t csm = colsize(m);        /* taille colonne masque */
  uint8_t *M = UCHARDATA(m);
  uint8_t *F = UCHARDATA(f);
  uint8_t *H;                     /* image de travail */
  int32_t sup;
  int32_t t;

  if (depth(f) != 1) 
  {
    fprintf(stderr, "ldilat_ldilat: cette version ne traite pas les images volumiques\n");
    return 0;
  }

  H = (uint8_t *)calloc(1,N*sizeof(char));
  if (H == NULL)
  {   fprintf(stderr,"ldilat_ldilat() : malloc failed for H\n");
      return(0);
  }
  for (x = 0; x < N; x++) H[x] = F[x];

  for (y = 0; y < cs; y++)
  for (x = 0; x < rs; x++)
  {
    sup = NDG_MIN;
    for (j = 0; j < csm; j += 1)
    for (i = 0; i < rsm; i += 1)
    {
      t = (int32_t)M[j * rsm + i];
      if (t)
      {
        l = y + j - yc;
        k = x + i - xc;
        if ((l >= 0) && (l < cs) && (k >= 0) && (k < rs) && ((int32_t)H[l * rs + k] + t > sup))
           sup = (int32_t)H[l * rs + k] + t;
      }
    } 
    F[y * rs + x] = (uint8_t)mcmin(sup, NDG_MAX);
  }

  free(H);
  return 1;
}
开发者ID:Johnson13,项目名称:xLearn,代码行数:59,代码来源:ldilat.c

示例6: lordermaxima

/* ==================================== */
int32_t lordermaxima(struct xvimage *image, struct xvimage *order, int32_t connex, int32_t nblabels)
/* ==================================== */
/*! \fn int32_t lordermaxima(struct xvimage *image, struct xvimage *order, int32_t connex, int32_t nblabels)
    \param image (entrée) : une image
    \param order (entrée/sortie) : labels définissant les maxima (de 1 à nbmaxima, 0 pour les non-maxima)
    \param connex (entrée) : 4 ou 8 (2D), 6, 18 ou 26 (3D) 
    \param nblabels (entrée) : nombre de maxima plus 1
    \return code erreur : 0 si échec, 1 sinon
    \brief ordonne les labels sur les maxima par altitude croissante
*/
#undef F_NAME
#define F_NAME "lordermaxima"
{
  int32_t i;
  int32_t rs = rowsize(image);      /* taille ligne */
  int32_t cs = colsize(image);      /* taille colonne */
  int32_t ds = depth(image);        /* nb plans */
  int32_t ps = rs * cs;             /* taille plan */
  int32_t N = ps * ds;              /* taille image */
  uint8_t *F = UCHARDATA(image);      /* l'image de depart */
  int32_t *O = SLONGDATA(order);      /* l'image de labels */
  int32_t *A; // table de correspondance pour le tri
  int32_t *T; // table avec l'altitude de chaque maximum
  
  if ((rowsize(order) != rs) || (colsize(order) != cs) || (depth(order) != ds))
  {
    fprintf(stderr, "%s: incompatible image sizes\n", F_NAME);
    exit(0);
  }

  A = (int32_t *)malloc(nblabels * sizeof(int32_t));
  T = (int32_t *)malloc(nblabels * sizeof(int32_t));
  if ((A == NULL) || (T == NULL))
  {   fprintf(stderr, "%s() : malloc failed\n", F_NAME);
      return(0);
  }
  for (i = 0; i < nblabels; i++) A[i] = i;

  for (i = 0; i < N; i++) 
    if (O[i])
      T[O[i]] = (int32_t)F[i];

  i_TriRapideStochastique (A, T, 1, nblabels-1);

  for (i = 1; i < nblabels; i++)
    T[A[i]] = i;
  for (i = 0; i < N; i++) 
    if (O[i])
      O[i] = T[O[i]];

  free(A);
  free(T);
  return 1;
} // lordermaxima()
开发者ID:clementfarabet,项目名称:xLearn,代码行数:55,代码来源:ldynamique.c

示例7: StreamGArecursif

int32_t StreamGArecursif(struct xvimage *ga, int32_t x, Lifo *FIFO, int32_t *Label, int32_t *alt, uint8_t *G)
#undef F_NAME
#define F_NAME "LPEGrapheAreteValuee" 
{
  int32_t rs = rowsize(ga);               /* taille ligne */
  int32_t cs = colsize(ga);               /* taille colonne */
  int32_t N = rs * cs;                    /* taille image */
  uint8_t *F = UCHARDATA(ga);
  int32_t labStream,k,u,y;
  Label[x] = IN_PROCESS;
  LifoPush(FIFO, x);
  for(k = 0; k < 4; k++)
    if((u = incidente(x, k, rs, N)) != -1) 
      if(F[u] == G[x]){
	switch(k){
	case 0: y = x+1; break;      /* EST   */ 
	case 1: y = x-rs; break;     /* NORD  */
	case 2: y = x-1; break;      /* OUEST */
	case 3: y = x+rs; break;     /* SUD   */ 
	}
	if(Label[y] == NO_LABEL) {
	  labStream = StreamGArecursif(ga, y, FIFO, Label, alt,G);
	  if( (labStream >= 0) || ( (*alt) < (int32_t)G[x]) )
	    return labStream;
	}
	else if (Label[y] >= 0){
	  //(*alt) = G[y];
	  return Label[y];
	}	  
      }
  (*alt) = (int32_t)G[x];
  return NO_LABEL;
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:33,代码来源:llpeGA.c

示例8: ldespics

/* ==================================== */
int32_t ldespics(struct xvimage * image, struct xvimage * mask, int32_t connexmin)
/* ==================================== */
#undef F_NAME
#define F_NAME "ldespics"
{
  int32_t i;
  uint8_t *F = UCHARDATA(image);
  uint8_t *M;
  int32_t rs = image->row_size;
  int32_t cs = image->col_size;
  int32_t N = rs * cs;

  if (depth(image) != 1) 
  {
    fprintf(stderr, "%s: cette version ne traite pas les images volumiques\n", F_NAME);
    exit(0);
  }

  /* ---------------------------------------------------------- */
  /* calcul du resultat */
  /* ---------------------------------------------------------- */
  
  if (mask)
  {
    if ((rowsize(mask) != rs) || (colsize(mask) != cs) || (depth(mask) != 1))
    {
      fprintf(stderr, "%s: tailles image et mask incompatibles\n", F_NAME);
      exit(0);
    }
    M = UCHARDATA(mask);
    if (connexmin == 8)
    {
      for (i = 0; i < N; i++)
        if (M[i] && (typetopo8(F, i, rs, N) == PEAK))
          F[i] = alpha4m(F, i, rs, N);
    }
    else
    {
      for (i = 0; i < N; i++)
        if (M[i] && (typetopo(F, i, rs, N) == PEAK))
          F[i] = alpha8m(F, i, rs, N);
    }
  }
  else
  {
    if (connexmin == 8)
    {
      for (i = 0; i < N; i++)
        if (typetopo8(F, i, rs, N) == PEAK)
          F[i] = alpha4m(F, i, rs, N);
    }
    else
    {
      for (i = 0; i < N; i++)
        if (typetopo(F, i, rs, N) == PEAK)
          F[i] = alpha8m(F, i, rs, N);
    }
  }
  return 1;
} /* ldespics() */
开发者ID:Johnson13,项目名称:xLearn,代码行数:61,代码来源:lfiltrestopo.c

示例9: SLONGDATA

/* Returns (in the form of a 4-connected GA) the edges that link two
   points with different labels */
struct xvimage *SeparatingEdge(struct xvimage *labels)
#undef F_NAME
#define F_NAME "mSeparatingEdge"
{
  struct xvimage *ga;
  int32_t *lab = SLONGDATA(labels);
  int32_t rs = rowsize(labels);     /* taille ligne */
  int32_t cs = colsize(labels);     /* taille colonne */
  int32_t N = rs * cs;              /* taille image */
  int32_t i,j,u,x,y;

  if( (ga = allocGAimage(NULL, rs, cs, 1, VFF_TYP_GABYTE)) == NULL) {
    fprintf(stderr,"%s: ne peut allouer de GA \n", F_NAME);
      exit(1);
  }
  uint8_t *F = UCHARDATA(ga);      /* le resultat */
  memset(F,0,2*N);
  /* les aretes horizontales */ 
  for(j = 0; j < cs; j++)
    for(i = 0; i < rs -1; i++){
      u = j * rs + i; x = Sommetx(u,N,rs); y = Sommety(u,N,rs);
      if(lab[x] != lab[y])
	F[u] = 255;
    }
  /* puis les aretes verticales */
  for(j = 0; j < cs -1; j++)
    for(i = 0; i < rs; i++){
      u = N + j * rs + i; x = Sommetx(u,N,rs); y = Sommety(u,N,rs);
      if(lab[x] != lab[y])
	F[u] = 255;
    }
  return ga;
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:35,代码来源:llpeGA.c

示例10: ad_exit

/**
 * Description not yet available.
 * \param
 */
 void lmatrix::allocate(int nrl, int nrh, int ncl, const ivector& nch)
 {
   if (nrl !=nch.indexmin() || nrh !=nch.indexmax())
   {
     cerr << "Incompatible array bounds in "
     "lmatrix::allocate(int nrl,int nrh,int ncl, const ivector& nch)\n";
     ad_exit(1);
   }
   if ( (shape = new mat_shape(nrl,nrh,ncl,nch(nch.indexmin())))== 0)
   {
     cerr << " Error allocating memory in lmatrix contructor\n";
     ad_exit(21);
   }
   size_t rs=rowsize();
   if ( (m = new lvector [rs]) == 0)
   {
     cerr << " Error allocating memory in lmatrix contructor\n";
     ad_exit(21);
   }
   m -= rowmin();
   for (int i=rowmin(); i<=rowmax(); i++)
   {
     m[i].allocate(ncl,nch(i));
   }
 }
开发者ID:colemonnahan,项目名称:admb,代码行数:29,代码来源:lmat.cpp

示例11: allocate

/**
 * Description not yet available.
 * \param
 */
 void dmatrix::allocate(int nrl,int nrh,int ncl,int nch)
 {
   if (nrh<nrl)
   {
     allocate();
     return;
   }
   index_min=nrl;
   index_max=nrh;
   if ( (m = new dvector [rowsize()]) == 0)
   {
     cerr << " Error allocating memory in dmatrix contructor\n";
     ad_exit(21);
   }
   if ( (shape = new mat_shapex(m))== 0)
   {
     cerr << " Error allocating memory in dmatrix contructor\n";
     ad_exit(21);
   }
   m -= rowmin();
   for (int i=rowmin(); i<=rowmax(); i++)
   {
     m[i].allocate(ncl,nch);
   }
 }
开发者ID:jimianelli,项目名称:admb,代码行数:29,代码来源:dmat.cpp

示例12: rowsize

// Construit un RAG a partir d'une partition (label) et d'un ga
RAG *construitRAG(struct xvimage *ga, struct xvimage *label, struct xvimage *annexe)
#undef F_NAME
#define F_NAME "construitRAGOpening"
{
  RAG *rag;
  int32_t i,x,y,u;
  int32_t rs = rowsize(label);     /* taille ligne */
  int32_t cs = colsize(label);     /* taille colonne */
  int32_t N = rs * cs;             /* taille image */
  int32_t N_t = 2*N;
  int32_t *LABEL = SLONGDATA(label);              /* l'image de depart */
  int32_t nblabels;

  nblabels = 0;
  for(i = 0; i < N; i++)
    if(LABEL[i] > nblabels) nblabels = LABEL[i];
  nblabels++;
  rag = initRAG(nblabels, 4*N);
  /* Parcourt de toutes les aretes du graphe d'arete F */
  for(u = 0; u < N_t; u ++){
    // si l'arete est bien ds le GA
    if( ( (u < N) && (u%rs < rs-1)) || ((u >= N) && (u < N_t - rs))){
      x = Sommetx(u, N, rs);
      y = Sommety(u, N, rs);
      if(LABEL[x] != LABEL[y]) updateRAGArc(rag, LABEL[x], LABEL[y], UCHARDATA(ga)[u]);
    }
  }
  // Puis calcul les attributs de noeuds du rag
  attributNoeud(rag,label,ga,annexe);  
  return rag;
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:32,代码来源:lhierarchie.c

示例13: attributNoeud

// Calcul les attributs surface et profondeur du RAG
void attributNoeud(RAG *rag, struct xvimage *label, struct xvimage *ga, struct xvimage *annexe)
{
  int32_t i;
  int32_t rs = rowsize(label);                   /* taille ligne      */
  int32_t cs = colsize(label);                   /* taille colonne    */
  int32_t N = rs * cs;                           /* taille image      */
  int32_t *LABEL = SLONGDATA(label);           /* les labels        */
  uint8_t *F;
  int32_t alt;
  int32_t l;

  if (annexe!=NULL)   F = UCHARDATA(annexe);

  for(i = 0; i < rag->g->nsom; i++) {
    /* tout ca peut se calculer au vol lors de la construction de la LPE */
    rag->surface[i] = 0;
    rag->profondeur[i] = 255;
    rag->altitude[i] = 0;
  }
  
  for(i = 0; i < N; i++) {
    alt = altitudePoint(ga, i);
    l = LABEL[i];
    rag->profondeur[l] = mcmin(alt,rag->profondeur[l]);
    rag->surface[l] ++;
    if (annexe!=NULL)
      rag->altitude[l] = F[i];
  }
}
开发者ID:Atcold,项目名称:lua---imgraph,代码行数:30,代码来源:lhierarchie.c

示例14: colsize

void GridTestCase::Size()
{
    // TODO on OSX resizing interactively works, but not automated
#if wxUSE_UIACTIONSIMULATOR && !defined(__WXGTK__) && !defined(__WXOSX__)
    EventCounter colsize(m_grid, wxEVT_GRID_COL_SIZE);
    EventCounter rowsize(m_grid, wxEVT_GRID_ROW_SIZE);

    wxUIActionSimulator sim;

    wxPoint pt = m_grid->ClientToScreen(wxPoint(m_grid->GetRowLabelSize() +
                                        m_grid->GetColSize(0), 5));

    sim.MouseMove(pt);
    wxYield();

    sim.MouseDown();
    wxYield();

    sim.MouseMove(pt.x + 50, pt.y);
    wxYield();

    sim.MouseUp();
    wxYield();

    CPPUNIT_ASSERT_EQUAL(1, colsize.GetCount());

    pt = m_grid->ClientToScreen(wxPoint(5, m_grid->GetColLabelSize() +
                                        m_grid->GetRowSize(0)));

    sim.MouseDragDrop(pt.x, pt.y, pt.x, pt.y + 50);
    wxYield();

    CPPUNIT_ASSERT_EQUAL(1, rowsize.GetCount());
#endif
}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:35,代码来源:gridtest.cpp

示例15: TMVAssert

 void HermBandSVDiv<T>::doRDiv(
     const GenMatrix<T1>& m, MatrixView<T2> x) const
 {
     TMVAssert(m.colsize() == x.colsize());
     TMVAssert(m.rowsize() == rowsize());
     TMVAssert(x.rowsize() == colsize());
     CallSV_RDiv(T(),pimpl->U,pimpl->S,pimpl->U.adjoint(),pimpl->kmax,m,x);
 }
开发者ID:rmjarvis,项目名称:tmv,代码行数:8,代码来源:TMV_SymBandSVD.cpp


注:本文中的rowsize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。