• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PIXEL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: tga_write_row_RLE

static tga_result tga_write_row_RLE(FILE *fp,
    const tga_image *src, const uint8_t *row)
{
    #define WRITE(src, size) \
        if (fwrite(src, size, 1, fp) != 1) return TGAERR_WRITE

    uint16_t pos = 0;
    uint16_t bpp = src->pixel_depth / 8;

    while (pos < src->width)
    {
        packet_type type = rle_packet_type(row, pos, src->width, bpp);
        uint8_t len = rle_packet_len(row, pos, src->width, bpp, type);
        uint8_t packet_header;

        packet_header = len - 1;
        if (type == RLE) packet_header |= BIT(7);

        WRITE(&packet_header, 1);
        if (type == RLE)
        {
            WRITE(PIXEL(pos), bpp);
        }
        else /* type == RAW */
        {
            WRITE(PIXEL(pos), bpp*len);
        }

        pos += len;
    }

    return TGA_NOERR;
    #undef WRITE
}
开发者ID:Borzen,项目名称:SrProject,代码行数:34,代码来源:targa.cpp


示例2: draw_circle

void draw_circle(uint16 cx, uint16 cy, uint16 r) {
  uint16 rSq = r*r;
  uint16 x;
  uint16 y;
  uint16 a;
  uint16 b;
  uint16 c;
  uint16 d;
  uint16 ySq;
  for (y = 0; y < r; y = y + 1) {
    c = cy + y;
    d = cy - y;
    ySq = y*y;
    for (x = 0; x < r; x = x + 1) {
      a = cx + x;
      b = cx - x;
      if (((x*x)+ySq) <= rSq) {
        PIXEL(a, c);
        PIXEL(a, d);
        PIXEL(b, c);
        PIXEL(b, d);
      }
    }
  }
}
开发者ID:rfotino,项目名称:consolite-compiler,代码行数:25,代码来源:circles.c


示例3: debrush_do_draw_string_default_bmf

void debrush_do_draw_string_default_bmf(
        DEBrush *brush,
        int x, int y, const char *str,
        int len, bool needfill,
        DEColourGroup *colours)
{
    GC gc=brush->d->normal_gc;

    if(brush->d->font==NULL)
        return;

    XSetForeground(ioncore_g.dpy, gc, PIXEL(colours->fg));

    if(!needfill){
        if(brush->d->font->fontset!=NULL){
#ifdef CF_DE_USE_XUTF8
            if(ioncore_g.enc_utf8)
                Xutf8DrawString(ioncore_g.dpy, brush->win,
                                brush->d->font->fontset,
                                gc, x, y, str, len);
            else
#endif
                XmbDrawString(ioncore_g.dpy, brush->win,
                              brush->d->font->fontset,
                              gc, x, y, str, len);
        }else if(brush->d->font->fontstruct!=NULL){
            if(ioncore_g.enc_utf8){
                XChar2b *str16; int len16=0;
                toucs(str, len, &str16, &len16);
                XDrawString16(ioncore_g.dpy, brush->win, gc, x, y, str16, len16);
                free(str16);
            }else{
                XDrawString(ioncore_g.dpy, brush->win, gc, x, y, str, len);
            }
        }
    }else{
        XSetBackground(ioncore_g.dpy, gc, PIXEL(colours->bg));
        if(brush->d->font->fontset!=NULL){
#ifdef CF_DE_USE_XUTF8
            if(ioncore_g.enc_utf8)
                Xutf8DrawImageString(ioncore_g.dpy, brush->win,
                                     brush->d->font->fontset,
                                     gc, x, y, str, len);
            else
#endif
                XmbDrawImageString(ioncore_g.dpy, brush->win,
                                   brush->d->font->fontset,
                                   gc, x, y, str, len);
        }else if(brush->d->font->fontstruct!=NULL){
            if(ioncore_g.enc_utf8){
                XChar2b *str16; int len16=0;
                toucs(str, len, &str16, &len16);
                XDrawImageString16(ioncore_g.dpy, brush->win, gc, x, y, str16, len16);
                free(str16);
            }else{
                XDrawImageString(ioncore_g.dpy, brush->win, gc, x, y, str, len);
            }
        }
    }
}
开发者ID:raboof,项目名称:notion,代码行数:60,代码来源:font.c


示例4: Java_java_awt_Toolkit_imgSetRGBPels

	void
		Java_java_awt_Toolkit_imgSetRGBPels ( JNIEnv* env, jclass clazz, Image * img,
		jint x, jint y, jint w, jint h,
		jintArray rgbPels, jint off, jint scan)
	{
		register int    row, col;
		COLORREF		   pix;
		jboolean        isCopy;
		jint            *rgbs = env->GetIntArrayElements( rgbPels, &isCopy);
		jint            *rgb = rgbs + off;
		int             maxCol = x + w;
		int             maxRow = y + h;
		

		for ( row = y; row < maxRow; row++) {
			for ( col = x; col < maxCol; col++) {
				pix = rgb[col + row * scan];
				if ( (pix & 0xff000000) == 0xff000000 ) {					
					PIXEL( img->dc, col, row, pix);
				}
				else {
					if ( !img->mask )
						createMaskImage( X, img);
					PIXEL( img->dcMask, col, row, 0x00ffffff);
					PIXEL( img->dc, col, row, 0);					
				}
			}
		}
		
		env->ReleaseIntArrayElements( rgbPels, rgbs, JNI_ABORT);
	}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:31,代码来源:img.cpp


示例5: RedrawCanvasImage

static void RedrawCanvasImage(Canvas *C,
                              int FromX,
                              int ToX,
                              int FromY,
                              int ToY) {

    CanvasExtension *CE=CExt(C);

    int SwapRedAndBlue = CE->Image->red_mask != ONLY_RED;

    for (int Y=FromY; Y<=ToY; Y++)
        for (int X=FromX; X<=ToX; X++)
            if (TestImage)
                XPutPixel(CE->Image,X,Y,X%(1<<BitPlanes));
            else if (BitPlanes==24) {
                if(SwapRedAndBlue) {
                    unsigned p = (CE->Mask)&PIXEL(C,X,Y);
                    unsigned p1 = (GET_RED(p) << 16) | (GET_GREEN(p) << 8) | GET_BLUE(p);
                    XPutPixel(CE->Image,X,Y,p1);
                } else {
                    XPutPixel(CE->Image,X,Y,(CE->Mask)&PIXEL(C,X,Y));
                }
            } else if (BitPlanes==16) {
                unsigned p = (CE->Mask)&PIXEL(C,X,Y);
                unsigned p_r = GET_RED(p) >> 3;
                unsigned p_g = GET_GREEN(p) >> 2;
                unsigned p_b = GET_BLUE(p) >> 3;
                unsigned short p1 = (p_r << 11) | (p_g << 5) | (p_b);
                XPutPixel(CE->Image,X,Y,p1);
            } else if (BitPlanes==15) {
开发者ID:dmakarov,项目名称:paintbrush,代码行数:30,代码来源:xsupport.cpp


示例6: ntsc_to_rgb

/* Convert NTSC composite signal to RGB, where composite signal contains only four
   non-zero samples beginning at offset */
static void ntsc_to_rgb( ntsc_to_rgb_t const* ntsc, int offset, short* out )
{
	float const* kernel = &ntsc->kernel [ntsc_kernel_size / 2 - offset];
	float f0 = ntsc->composite [offset];
	float f1 = ntsc->composite [offset + 1];
	float f2 = ntsc->composite [offset + 2];
	float f3 = ntsc->composite [offset + 3];
	int x = 0;
	while ( x < composite_size )
	{
		#define PIXEL( get_y ) \
		{\
			float i = kernel [ 0] * f0 + kernel [-2] * f2;\
			float q = kernel [-1] * f1 + kernel [-3] * f3;\
			float y = get_y;\
			float r = y + i * ntsc->to_rgb [0] + q * ntsc->to_rgb [1];\
			float g = y + i * ntsc->to_rgb [2] + q * ntsc->to_rgb [3];\
			float b = y + i * ntsc->to_rgb [4] + q * ntsc->to_rgb [5];\
			kernel++;\
			out [0] = (int) r;\
			out [1] = (int) g;\
			out [2] = (int) b;\
			out += 3;\
		}
		
		PIXEL( i - ntsc->composite [x + 0] )
		PIXEL( q - ntsc->composite [x + 1] )
		PIXEL( ntsc->composite [x + 2] - i )
		PIXEL( ntsc->composite [x + 3] - q )
		x += 4;
		
		#undef PIXEL
	}
}
开发者ID:iPodLinux-Community,项目名称:iAtari800,代码行数:36,代码来源:atari_ntsc.c


示例7: SetColor

void SetColor(byte N,byte R,byte G,byte B)
{
  if(N)
     XPal[N]=PIXEL(R,G,B);
  else
     XPal0=PIXEL(R,G,B);
}
开发者ID:Gillmog,项目名称:fmsx-libretro,代码行数:7,代码来源:libretro.c


示例8: check

/* ------------------------------------------------------------------------- */
static BOOL check(const BYTE* pSrc1,  UINT32 src1Step,
                  const BYTE* pSrc2,  UINT32 src2Step,
                  BYTE* pDst,  UINT32 dstStep,
                  UINT32 width,  UINT32 height)
{
	UINT32 x, y;

	for (y = 0; y < height; ++y)
	{
		for (x = 0; x < width; ++x)
		{
			UINT32 s1 = *PIXEL(pSrc1, src1Step, x, y);
			UINT32 s2 = *PIXEL(pSrc2, src2Step, x, y);
			UINT32 c0 = alpha_add(s1, s2);
			UINT32 c1 = *PIXEL(pDst, dstStep, x, y);

			if (colordist(c0, c1) > TOLERANCE)
			{
				printf("alphaComp-general: [%"PRIu32",%"PRIu32"] 0x%08"PRIx32"+0x%08"PRIx32"=0x%08"PRIx32", got 0x%08"PRIx32"\n",
				       x, y, s1, s2, c0, c1);
				return FALSE;
			}
		}
	}

	return TRUE;
}
开发者ID:Devolutions,项目名称:FreeRDP,代码行数:28,代码来源:TestPrimitivesAlphaComp.c


示例9: convert_scr7

void convert_scr7 (image *img) {
  image *temp;
  int i,j;
  histogram hist[256];

  temp=(image *) malloc (sizeof (image));
  temp->x=img->x;
  temp->y=img->y;
  temp->buffer=(unsigned char *) malloc (img->x*img->y);

  for (i=0; i<256; i++) {
    hist[i].value=0;
    hist[i].index=i;
  }
  
  for (j=0; j<img->y; j++)
    for (i=0; i<img->x; i++)
      hist[ENCODE(img,i,j)].value++;

  qsort (hist,256,sizeof (histogram),sort_histogram);
  
  for (j=0; j<temp->y; j++)
    for (i=0; i<temp->x; i++)
      PIXEL8(temp,i,j)=
        match_color(PIXEL(img,i,j,R),PIXEL(img,i,j,G),PIXEL(img,i,j,B),hist);

  custom_blit (temp);
  show_pal (0,hist);
}
开发者ID:TimofonicJunkRoom,项目名称:Oldies,代码行数:29,代码来源:scr7.c


示例10: _mesh

//********************** MANAGERS **********************
Patch::Patch(BMESHptr mesh) :
   _mesh(mesh),
   _faces(0),
   _creases(nullptr),
   _borders(nullptr),
   _textures(0),
   _cur_tex_i(0),
   _non_tex_i(0),
   _prev_tex(nullptr),
   _pixels(0),
   _stamp(0),
   _mesh_version(0),
   _tri_strips_dirty(1),
   _tex_coord_gen(nullptr),
   _data(nullptr),
   _stencil_id(0),
   _sps_height(5),
   _sps_min_dist(0.35),
   _sps_regularity(20.0),
   _sample_spacing(0),
   _scale(1.0),
   _o(PIXEL(0,0)),
   _u_o(PIXEL(1,0)),
   _v_o(PIXEL(0,1)),
   _dynamic_stamp(UINT_MAX),
   _do_dynamic_stuff(true),
   _do_lod(true),
   _do_rotation(true),
   _lod_t(0),
   _target_scale(1.0),
   _down_lim(0.8),
   _up_lim(1.4),
   _transition_duration(0.4),
   _timed_lod_hi(2.0),
   _timed_lod_lo(1.0),
   _use_timed_lod_transitions(false),
   _transition_has_started(false),
   _saw_periodic_sync(false),
   _use_direction_vec(false),
   _use_weighted_ls(true),
   _use_visibility_test(true),
   _d2d_samples_valid(false)
{
   _textures.set_unique();

   //XXX - By default, APPEARs will look white if no
   //      color is defined, so let's not pollute the
   //      .jot files with yet more gunk...
   //set_color(COLOR::white);

   if (_mesh)
     _mesh->changed(BMESH::RENDERING_CHANGED);

   char tmp[64];
   sprintf(tmp, "%d", _mesh->patches().num());
   set_name(string("patch-") + tmp);
}
开发者ID:QuLogic,项目名称:jot-lib,代码行数:58,代码来源:patch.cpp


示例11: PIXEL

//соседний контурный пиксель
//ВОЗВРАЩАЕТ: false - если нет соседних точек					 
inline bool ucv::NEIGHBOR_PIXEL(	IplImage* src,		//исходное контурное изображение
									CvPoint* pt			//указатель на исходную точку, сюда же будет записана координата соседней точки
									)
{
	//здесь должна быть проверка на принадлежность пикселя контуру

	if(pt->x==0 || pt->y==0 || pt->x == src->width-1 || pt->y == src->height-1)
	{
		return false;
	}
	
	PIXEL(uchar, src, pt->x, pt->y)[0]=254;	//помечаем точку как найденную
	
	//перебираем соседние пиксели
	if(PIXEL(uchar, src, pt->x, pt->y+1)[0]==255){		//32
		pt->y+=1;
		return true;
	}
		
	if(PIXEL(uchar, src, pt->x+1, pt->y)[0]==255){		//23
		pt->x+=1;
		return true;
	}
		
	if(PIXEL(uchar, src, pt->x, pt->y-1)[0]==255){		//12
		pt->y-=1;
		return true;
	}
	
	if(PIXEL(uchar, src, pt->x-1, pt->y)[0]==255){		//21
		pt->x-=1;
		return true;
	}
	
	if(PIXEL(uchar, src, pt->x+1, pt->y+1)[0]==255){		//33
		pt->x+=1;
		pt->y+=1;
		return true;
	}
			
	if(PIXEL(uchar, src, pt->x+1, pt->y-1)[0]==255){		//13
		pt->x+=1;
		pt->y-=1;
		return true;
	}
		
	if(PIXEL(uchar, src, pt->x-1, pt->y+1)[0]==255){		//31
		pt->x-=1;
		pt->y+=1;
		return true;
	}
	
	if(PIXEL(uchar, src, pt->x-1, pt->y-1)[0]==255)	{	//11
		pt->x-=1;
		pt->y-=1;
		return true;
	}
	
	return false;	//нет соседних пикселей
}
开发者ID:ThisIsBrain,项目名称:ucv,代码行数:62,代码来源:contour.cpp


示例12: fread

image *open_pcx (char *name) {
  FILE *f;
  image *img;
  PCXHeader header;
  unsigned char *temp,*ptr,b1,b2;
  int line_size,line,x;

  if ((f=fopen (name,"rb"))==NULL)
    return NULL;

  fread (&header,sizeof (PCXHeader),1,f);

  if (header.Manufacturer!=0xA && header.Version!=0x5 &&
      header.Encoding!=0x1 && header.BitsPerPixel!=0x8 )
  {
    fclose (f);
    return NULL;
  }

  img=(image *) safe_malloc (sizeof (image));
  img->x=header.Xmax-header.Xmin+1;
  img->y=header.Ymax-header.Ymin+1;
  img->buffer=(unsigned char *) safe_malloc (img->x*img->y*3);
  
  line_size=header.NPlanes*header.BytesPerLine;
  temp=(unsigned char *) safe_malloc (line_size);
  
  for (line=0; line<img->y; line++) {
    ptr=temp;
    for (x=0; x<line_size;) {
      b1=fgetc (f);
      if (b1>0xc0) {
        b1-=0xc0;
        b2=fgetc (f);
        memset (ptr,b2,b1);
        ptr+=b1;
        x+=b1;
      }
      else {
        *ptr++=b1;
        x++;
      }
    }
    for (x=0; x<img->x; x++) {
      PIXEL (img,x,line,R)=temp[x];
      PIXEL (img,x,line,G)=temp[x+header.BytesPerLine];
      PIXEL (img,x,line,B)=temp[x+header.BytesPerLine*2];
    }
  }
  
  fclose (f);

  return img;
}
开发者ID:TimofonicJunkRoom,项目名称:Oldies,代码行数:54,代码来源:wise_grp.c


示例13: lifBlit

//
// lifBlit
// blit one LiF into another
//
void lifBlit(lifheader* out, lifheader* in, sdword left, sdword top)
{
    sdword y, x;

    for (y = 0; y < in->height; y++)
    {
        for (x = 0; x < in->width; x++)
        {
            PIXEL(out->data, left + x, top + y, out->width) = PIXEL(in->data, x, y, in->width);
        }
    }
}
开发者ID:videogamepreservation,项目名称:homeworld,代码行数:16,代码来源:lif.cpp


示例14: _FLT

/** interpolateLin: linear (only x) interpolation function, see interpolate */
void _FLT(interpolateLin)(unsigned char *rv, float x, float y,
                          unsigned char* img, int width, int height,
                          unsigned char def)
{
    int x_f = myfloor(x);
    int x_c = x_f+1;
    int y_n = myround(y);
    float v1 = PIXEL(img, x_c, y_n, width, height, def);
    float v2 = PIXEL(img, x_f, y_n, width, height, def);
    float s  = v1*(x - x_f) + v2*(x_c - x);
    *rv = (unsigned char)s;
}
开发者ID:mojaves-forks,项目名称:vid.stab,代码行数:13,代码来源:transformfloat.c


示例15: Seuillage

void Seuillage(IMAGE *image, IMAGE *imres, int seuil)
{
 POINT	*point = NULL, *pointv=NULL, *pointvv=NULL; /* point courant et point voisin */
  short	i,j; /* variables indices ligne et colonne du voisinage */

  if(crea_POINT(point) == NULL) /* creation des points */
  {
     fprintf(stderr,"Erreur d'Allocation Memoire du Point : Median \n");
     exit (0);
  }

  if(crea_POINT(pointv) == NULL)
  {
     fprintf(stderr,"Erreur d'Allocation Memoire du Point Voisin : Median \n");
     exit (0);
  }

if(crea_POINT(pointvv) == NULL)
  {
     fprintf(stderr,"Erreur d'Allocation Memoire du Point Voisin suivant : Median \n");
     exit (0);
  }

/* --- Initialisation des Bords :
   on recopie l'image originale --- */
  for(POINT_X(point) = 0; POINT_X(point) < NCOL(image);
           POINT_X(point)++)
  {
    POINT_Y(point) = 0; /* premiere ligne */
    PIXEL(imres, point) = PIXEL(image, point);

    POINT_Y(point) = NLIG(image) - 1;/* derniere ligne */
    PIXEL(imres, point) = PIXEL(image, point);
  } /*--- fin recopiage 1er et derniere ligne --- */
   for(POINT_Y(point) = 0; POINT_Y(point) < NLIG(image);
           POINT_Y(point)++)
  {
    POINT_X(point) = 0;/* premiere colonne */
    PIXEL(imres, point) = PIXEL(image, point);

    POINT_X(point) = NCOL(image) - 1;/* derniere colonne */
    PIXEL(imres, point) = PIXEL(image, point);

  }

  for(POINT_Y(point) = 0; POINT_Y(point) < NLIG(image); POINT_Y(point)++)
  for(POINT_X(point) = 0; POINT_X(point) < NCOL(image); POINT_X(point)++)
  {

      PIXEL(imres,point) = PIXEL(image,point) < seuil? (short)0 : (short)255;
  }
}
开发者ID:Kisuke,项目名称:traitement_image_TP2,代码行数:52,代码来源:Seuillage.c


示例16: source_init

void source_init(source_t *source)
{
	transform_identity(&source->transform);
	source->filter = filter_nearest;
	
	source->color = PIXEL(0, 0, 0, 0);
	source->texture = NULL;
	source->texture_tile = false;

	source->alpha = PIXEL(255, 0, 0, 0);
	source->mask = NULL;
	source->mask_tile = false;
}
开发者ID:pratikmankawde,项目名称:HelenOS_Nano,代码行数:13,代码来源:source.c


示例17: threshold

int threshold(TrackingWindow *win, int t)
{
	int i, j, xmax, ymax;

	xmax = win->blob_xmax;
	ymax = win->blob_ymax;

	for(i = win->blob_ymin; i < ymax; i++) {
		for(j = win->blob_xmin; j < xmax; j++) {
			PIXEL(win, i, j) = (PIXEL(win, i, j) < t) ? BACKGROUND : FOREGROUND;
		}
	}

	return 0;
}
开发者ID:JoshMarino,项目名称:lims-hsv-system,代码行数:15,代码来源:imgproc.cpp


示例18: compose_over

pixel_t compose_over(pixel_t fg, pixel_t bg)
{
	double mul;
	double mul_cmp;

	double res_a;
	double res_r;
	double res_g;
	double res_b;

	if (ALPHA(bg) == 255) {
		res_a = 1;
		mul = ((double) ALPHA(fg)) / 255.0;
		mul_cmp = 1 - mul;
	} else {
		double fg_a = ((double) ALPHA(fg)) / 255.0;
		double bg_a = ((double) ALPHA(bg)) / 255.0;

		res_a = 1 - (1 - fg_a) * (1 - bg_a);
		mul = fg_a / res_a;
		mul_cmp = 1 - mul;
	}

	res_r = mul * ((double) RED(fg)) + mul_cmp * ((double) RED(bg));
	res_g = mul * ((double) GREEN(fg)) + mul_cmp * ((double) GREEN(bg));
	res_b = mul * ((double) BLUE(fg)) + mul_cmp * ((double) BLUE(bg));

	return PIXEL((unsigned) (res_a * 255),
	    (unsigned) res_r, (unsigned) res_g, (unsigned) res_b);
}
开发者ID:jvesely,项目名称:helenos,代码行数:30,代码来源:compose.c


示例19: RenderTree

void RenderTree(fwk::Texture &image, const VTree &tree, const Camera &camera) {
//		dicom.Blit(image, slice);

    #pragma omp parallel for
    for(int y = 0; y < image.height(); y += 1) {
        for(int x = 0; x < image.width(); x += 1) {
            float tx = float(x) / image.width() - 0.5f;
            float ty = float(y) / image.height() - 0.5f;

            Vec3f eye = camera.pos;
            Vec3f target = eye + camera.front + camera.right * tx + camera.up * ty
                           + Vec3f(0.0001f, 0.0001f, 0.00001f);
            Vec3f dir = Normalize(target - eye);

            u16 value = tree.Trace(eye, dir, 2000);
            int color = (value >> 7) * 4;
            color = Min(color, 255);

#define PIXEL(x, y, col) { image(x, y) = {color, color, color}; }

            PIXEL(x, y, color);
//				   	PIXEL(x + 1, y, color);
//				   	PIXEL(x, y + 1, color);
//				   	PIXEL(x + 1, y + 1, color);

#undef PIXEL
        }
    }
}
开发者ID:nadult,项目名称:Snail,代码行数:29,代码来源:vtree.cpp


示例20: cvPoint

//поиск контуров
void ucv::findContours(	IplImage* src,				//исходное контурное изобрвжение
					 	ContourStorage* contours	//указаетль на хранилеще контуров
					 	)
{
	CvPoint point;	//текущая точка
	ucv::Contour contour;	//текущий контур
	
	//для каждой точки принадлежащей контуру
	for(int x=0; x<src->width; x++){
		for(int y=0; y<src->height; y++){
			if(PIXEL(uchar, src, x, y)[0]==255){	//если нашли начало контура
				
				//начальный размер вектора
				contour.clear();
				//contour.reserve(std::max(src->width, src->height));	
				
				//первая точка контура
				point = cvPoint(x, y);	
				contour.push_back(point);	//set point in vector
				
				//пока не дойдем до конца контура
				while(NEIGHBOR_PIXEL(src, &point)){	//переход на соседний пиксель					
					//set point in vector
					contour.push_back(point);
				}
				
				//если не слишком короткий контур
				if(contour.size()>1){
					//contour.shrink_to_fit();		//сжимаем вектор до минимального значения
					contours->push_back(contour);	//закидываем данный контур в массив контуров
				}
			}
		}
	}
}
开发者ID:ThisIsBrain,项目名称:ucv,代码行数:36,代码来源:contour.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PIXPACK函数代码示例发布时间:2022-05-30
下一篇:
C++ PIO_Set函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap