您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetExceptionInfo函数代码示例

51自学网 2021-06-01 21:07:29
  C++
这篇教程C++ GetExceptionInfo函数代码示例写得很实用,希望能帮到您。

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

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

示例1: initGraphicsMagick

void ScImgDataLoader_GMagick::loadEmbeddedProfile(const QString& fn, int /*page*/){	initGraphicsMagick();	m_embeddedProfile.resize(0);	m_profileComponents = 0;	if (!QFile::exists(fn)) return;	ExceptionInfo exception;	GetExceptionInfo(&exception);	ImageInfo *image_info = CloneImageInfo(0);	strcpy(image_info->filename, fn.toUtf8().data());	image_info->units = PixelsPerInchResolution;	Image *image = ReadImage(image_info, &exception);	if (exception.severity != UndefinedException)		CatchException(&exception);	if (!image) {		qCritical() << "Failed to read image" << fn;		return;	}	size_t length = 0;	const unsigned char *src = GetImageProfile(image, "ICM", &length);	char *dest = m_embeddedProfile.data();	if (image->colorspace == CMYKColorspace) {		m_profileComponents = 4;	} else if (image->colorspace == RGBColorspace) {		m_profileComponents = 3;	}	m_embeddedProfile.resize(length);	memcpy(dest, src, length);}
开发者ID:Sheikha443,项目名称:scribus,代码行数:33,


示例2: exmagick_init_handle

staticERL_NIF_TERM exmagick_init_handle (ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]){  ERL_NIF_TERM result;  EXM_INIT;  ErlNifResourceType *type = (ErlNifResourceType *) enif_priv_data(env);  exm_resource_t *resource = enif_alloc_resource(type, sizeof(exm_resource_t));  if (resource == NULL)  { EXM_FAIL(ehandler, "enif_alloc_resource"); }  /* initializes exception to default values (badly named function) */  GetExceptionInfo(&resource->e_info);  resource->image  = NULL;  resource->i_info = CloneImageInfo(0);  if (resource->i_info == NULL)  { EXM_FAIL(ehandler, "CloneImageInfo"); }  result = enif_make_resource(env, (void *) resource);  enif_release_resource(resource);  return(enif_make_tuple2(env, enif_make_atom(env, "ok"), result));ehandler:  if (resource != NULL)  {    if (resource->i_info != NULL)    { DestroyImageInfo(resource->i_info); }    enif_release_resource(resource);  }  return(enif_make_tuple2(env, enif_make_atom(env, "error"), exmagick_make_utf8str(env, errmsg)));}
开发者ID:Xerpa,项目名称:exmagick,代码行数:32,


示例3: Info_format_eq

/*    Method:     Info#format=    Purpose:    Set the image encoding format*/VALUEInfo_format_eq(VALUE self, VALUE magick){    Info *info;    const MagickInfo *m;    char *mgk;    ExceptionInfo exception;    Data_Get_Struct(self, Info, info);    GetExceptionInfo(&exception);    mgk = StringValuePtr(magick);    m = GetMagickInfo(mgk, &exception);    CHECK_EXCEPTION()    (void) DestroyExceptionInfo(&exception);    if (!m)    {        rb_raise(rb_eArgError, "unknown format: %s", mgk);    }    strncpy(info->magick, m->name, MaxTextExtent-1);    return self;}
开发者ID:AzkaarAli,项目名称:leihs,代码行数:29,


示例4: gm_auto_orient_image

/* auto orient image */ngx_int_t gm_auto_orient_image(ngx_http_request_t *r, void *option, Image **image){    ExceptionInfo                      exception;    Image                             *orient_image = NULL;    dd("starting auto orient");    GetExceptionInfo(&exception);    orient_image=AutoOrientImage(*image,(*image)->orientation, &exception);    if (orient_image == (Image *) NULL) {        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,                "gm filter: auto orient image failed, "                "severity: /"%O/" "                "reason: /"%s/", description: /"%s/"",                exception.severity, exception.reason, exception.description);        DestroyExceptionInfo(&exception);        return NGX_ERROR;    }    DestroyImage(*image);    *image = orient_image;    DestroyExceptionInfo(&exception);    return NGX_OK;}
开发者ID:believe3301,项目名称:ngx-gm-filter,代码行数:31,


示例5: appendImageBytesToRaw

void    appendImageBytesToRaw(int fd, char * file) {    Image *img = get_image_from_path(file);    unsigned char   *pixel_map = NULL;    size_t pixel_map_size = img->columns * img->rows * sizeof(*pixel_map);    pixel_map = malloc(pixel_map_size);    unsigned int    x = 0;    unsigned int    y = 0;    int             width = (int)img->columns;    int             height = (int)img->rows;    PixelPacket     *px;    ExceptionInfo	exception;    GetExceptionInfo(&exception);    px = GetImagePixels(img, 0, 0, img->columns, img->rows);    while (y < height) {        x = 0;        while (x < width) {            pixel_map[(width * y) + x] = (char)px[(width * y) + x].green;            x++;        }        y++;    }    write(fd, pixel_map, pixel_map_size);    free(pixel_map);    DestroyImage(img);}
开发者ID:chongbingbao,项目名称:TissueReconstruction,代码行数:30,


示例6: NewMagickWand

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   N e w M a g i c k W a n d                                                 %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  NewMagickWand() returns a wand required for all other methods in the API.%%  The format of the NewMagickWand method is:%%      MagickWand *NewMagickWand(void)%*/WandExport MagickWand *NewMagickWand(void){  const char    *quantum;  MagickWand    *wand;  unsigned long    depth;  depth=QuantumDepth;  quantum=GetMagickQuantumDepth(&depth);  if (depth != QuantumDepth)    ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);  wand=(MagickWand *) AcquireMagickMemory(sizeof(*wand));  if (wand == (MagickWand *) NULL)    ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",      strerror(errno));  (void) ResetMagickMemory(wand,0,sizeof(*wand));  wand->id=AcquireWandId();  (void) FormatMagickString(wand->name,MaxTextExtent,"%s-%lu",MagickWandId,    wand->id);  GetExceptionInfo(&wand->exception);  wand->image_info=CloneImageInfo((ImageInfo *) NULL);  wand->quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL);  wand->images=NewImageList();  wand->debug=IsEventLogging();  if (wand->debug != MagickFalse)    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);  wand->signature=MagickSignature;  return(wand);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:51,


示例7: main

int main ( int argc, char **argv ){  Image *canvas = (Image *)NULL;  char outfile[MaxTextExtent];  int rows, columns = 0;  char size[MaxTextExtent];  ImageInfo *image_info;  ExceptionInfo exception;  if ( argc != 2 )    {      (void) printf ( "Usage: %s filename/n", argv[0] );      exit( 1 );    }  outfile[MaxTextExtent-1]='/0';  (void) strncpy( outfile, argv[1], MaxTextExtent-1 );  if (LocaleNCompare("drawtest",argv[0],7) == 0)    InitializeMagick((char *) NULL);  else    InitializeMagick(*argv);  /*   * Create canvas image   */  columns=596;  rows=842;  image_info=CloneImageInfo((ImageInfo*)NULL);  GetExceptionInfo( &exception );  FormatString(size, "%dx%d", columns, rows);  (void) CloneString(&image_info->size, size);  (void) strcpy( image_info->filename, "xc:white");  canvas = ReadImage ( image_info, &exception );  if (exception.severity != UndefinedException)    CatchException(&exception);  if ( canvas == (Image *)NULL )    {      (void) printf ( "Failed to read canvas image %s/n", image_info->filename );      exit(1);    }  /*   * Scribble on image   */  ScribbleImage( canvas );  /*   * Save image to file   */  canvas->filename[MaxTextExtent-1]='/0';  (void) strncpy( canvas->filename, outfile, MaxTextExtent-1);  (void) WriteImage ( image_info, canvas );  DestroyExceptionInfo( &exception );  DestroyImage( canvas );  DestroyImageInfo( image_info );  DestroyMagick();  return 0;}
开发者ID:CliffsDover,项目名称:graphicsmagick,代码行数:60,


示例8: throw

Image::Image( uint32 width, uint32 height,              const char* map,               StorageType storage,              const void* pixels ) throw (GSystem::Exception):   m_image( NULL ) {   // initialize exception   ExceptionInfo exception;   GetExceptionInfo( &exception );   m_image = ConstituteImage( width, height, map, storage,                              pixels, &exception );   if ( m_image == NULL ) {      MC2String exceptionString = "Reason: ";      exceptionString += exception.reason;      exceptionString += "Description: ";      exceptionString += exception.description;      DestroyExceptionInfo( &exception );      throw GSystem::Exception( "[ImageMagick]" + exceptionString );   }   DestroyExceptionInfo( &exception );   GetQuantizeInfo(&m_quantizeInfo);}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:26,


示例9: ImageList_fx

/*    Method:     ImageList#fx(expression[, channel...])*/VALUEImageList_fx(int argc, VALUE *argv, VALUE self){    Image *images, *new_image;    char *expression;    ChannelType channels;    ExceptionInfo exception;    channels = extract_channels(&argc, argv);    // There must be exactly 1 remaining argument.    if (argc == 0)    {        rb_raise(rb_eArgError, "wrong number of arguments (0 for 1 or more)");    }    else if (argc > 1)    {        raise_ChannelType_error(argv[argc-1]);    }    expression = StringValuePtr(argv[0]);    images = images_from_imagelist(self);    GetExceptionInfo(&exception);    new_image = FxImageChannel(images, channels, expression, &exception);    rm_split(images);    rm_check_exception(&exception, new_image, DestroyOnError);    (void) DestroyExceptionInfo(&exception);    rm_ensure_result(new_image);    return rm_image_new(new_image);}
开发者ID:Des,项目名称:your_app_name,代码行数:37,


示例10: GetImageInfo

pair< unsigned char*, int >Image::getBuffer() {   size_t size = 0;   ::ImageInfo info;   GetImageInfo( &info );   ExceptionInfo exception;   GetExceptionInfo( &exception );   unsigned char* blob = ImageToBlob( &info, m_image, &size,                                      &exception );   if ( blob == NULL ) {      MC2String exceptionString = "Reason: ";      exceptionString += exception.reason;      exceptionString += "Description: ";      exceptionString += exception.description;      DestroyExceptionInfo( &exception );      throw GSystem::Exception( "[ImageMagick]" + exceptionString );   }   DestroyExceptionInfo( &exception );   return make_pair( blob, size );}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:25,


示例11: ImageList_morph

/*    Method:     ImageList#morph(number_images)    Purpose:    requires a minimum of two images. The first image is                transformed into the second by a number of intervening images                as specified by "number_images".    Returns:    a new Image with the images array set to the morph sequence.                @scenes = 0*/VALUEImageList_morph(VALUE self, VALUE nimages){    Image *images, *new_images;    ExceptionInfo exception;    long number_images;    // Use a signed long so we can test for a negative argument.    number_images = NUM2LONG(nimages);    if (number_images <= 0)    {        rb_raise(rb_eArgError, "number of intervening images must be > 0");    }    GetExceptionInfo(&exception);    images = images_from_imagelist(self);    new_images = MorphImages(images, (unsigned long)number_images, &exception);    rm_split(images);    rm_check_exception(&exception, new_images, DestroyOnError);    (void) DestroyExceptionInfo(&exception);    rm_ensure_result(new_images);    return rm_imagelist_from_images(new_images);}
开发者ID:Des,项目名称:your_app_name,代码行数:34,


示例12: set_color_option

/*    Static:     set_color_option    Purpose:    Set a color name as the value of the specified option    Note:       Call QueryColorDatabase to validate color name*/static VALUE set_color_option(VALUE self, const char *option, VALUE color){    Info *info;    char *name;    PixelPacket pp;    ExceptionInfo exception;    MagickBooleanType okay;    Data_Get_Struct(self, Info, info);    if (NIL_P(color))    {        (void) RemoveImageOption(info, option);    }    else    {        GetExceptionInfo(&exception);        name = StringValuePtr(color);        okay = QueryColorDatabase(name, &pp, &exception);        (void) DestroyExceptionInfo(&exception);        if (!okay)        {            rb_raise(rb_eArgError, "invalid color name `%s'", name);        }        (void) RemoveImageOption(info, option);        (void) SetImageOption(info, option, name);    }    return self;}
开发者ID:AzkaarAli,项目名称:leihs,代码行数:36,


示例13: GetExceptionInfo

Image		*get_image_from_path(char *path){    ImageInfo	*image_info;    Image		*img = NULL;    ExceptionInfo	exception;        GetExceptionInfo(&exception);    if ((image_info = CloneImageInfo((ImageInfo *)NULL)) == NULL) {        CatchException(&exception);        DestroyImageInfo(image_info);        DestroyImage(img);        return (NULL);    }        strcpy(image_info->filename, path);        if ((img = ReadImage(image_info, &exception)) == NULL)    {        CatchException(&exception);        DestroyImageInfo(image_info);        DestroyImage(img);        return (NULL);    }    DestroyImageInfo(image_info);    return (img);}
开发者ID:adamlin,项目名称:TissueReconstruction,代码行数:26,


示例14: malloc

Image       *get_threshold_image(Image *img, c_threshold *c){    Image       *threshold_img;    int         size_x, size_y;    int         i = 0;    int         j = 0;    char        *string_img = malloc(img->rows * img->columns * sizeof(*string_img));    char        *temp_string_img;    PixelPacket	*px;    ExceptionInfo	exception;        GetExceptionInfo(&exception);    px = GetImagePixels(img, 0, 0, img->columns, img->rows);    size_x = (int)img->columns;    size_y = (int)img->rows;        while (i < size_y) {        j=0;        while (j < size_x) {            string_img[(size_x * i) + j] = (char)px[(size_x * i) + j].green;            j++;        }        i++;    }    temp_string_img = otsu_th(size_x, size_y, string_img, c);        threshold_img = ConstituteImage(size_x, size_y, "I", CharPixel, temp_string_img, &exception);    free(temp_string_img);    free(string_img);    DestroyImage(img);    SyncImagePixels(threshold_img);    return (threshold_img);}
开发者ID:adamlin,项目名称:TissueReconstruction,代码行数:35,


示例15: CloneMagickWand

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%                                                                             %%                                                                             %%                                                                             %%   C l o n e M a g i c k W a n d                                             %%                                                                             %%                                                                             %%                                                                             %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  CloneMagickWand() makes an exact copy of the specified wand.%%  The format of the CloneMagickWand method is:%%      MagickWand *CloneMagickWand(const MagickWand *wand)%%  A description of each parameter follows:%%    o wand: The magick wand.%%*/WandExport MagickWand *CloneMagickWand(const MagickWand *wand){  MagickWand    *clone_wand;  assert(wand != (MagickWand *) NULL);  assert(wand->signature == MagickSignature);  if (wand->debug != MagickFalse)    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);  clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));  if (clone_wand == (MagickWand *) NULL)    ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",      strerror(errno));  (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));  clone_wand->id=AcquireWandId();  (void) FormatMagickString(clone_wand->name,MaxTextExtent,"MagickWand-%lu",    clone_wand->id);  GetExceptionInfo(&clone_wand->exception);  InheritException(&clone_wand->exception,&wand->exception);  clone_wand->image_info=CloneImageInfo(wand->image_info);  clone_wand->quantize_info=CloneQuantizeInfo(wand->quantize_info);  clone_wand->images=CloneImageList(wand->images,&clone_wand->exception);  clone_wand->debug=IsEventLogging();  if (clone_wand->debug != MagickFalse)    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);  clone_wand->signature=MagickSignature;  return(clone_wand);}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:51,


示例16: GetExceptionInfo

Image   *crop_masked_final_image(Image *org_img, Image *mask_img){    unsigned int    x = 0;    unsigned int    y = 0;    int             width = (int)org_img->columns;    int             height = (int)org_img->rows;    PixelPacket     *px;    PixelPacket     *mask_px;    ExceptionInfo	exception;        GetExceptionInfo(&exception);        px = GetImagePixels(org_img, 0, 0, org_img->columns, org_img->rows);    mask_px = GetImagePixels(mask_img, 0, 0, mask_img->columns, mask_img->rows);        while (y < height) {        x = 0;        while (x < width) {            if (mask_px[(width * y) + x].red == WHITE) {                px[(width * y) + x].green = px[(width * y) + x].blue = px[(width * y) + x].red = BLACK;            }            x++;        }        y++;    }    DestroyImage(mask_img);    return (org_img);}
开发者ID:adamlin,项目名称:TissueReconstruction,代码行数:28,


示例17: CheckStatus

void CheckStatus(int status){    if (status)    {        std::runtime_error error(GetExceptionInfo());        throw error;    }}
开发者ID:KnIfER,项目名称:armagetron,代码行数:8,


示例18: install_input_magick_readers

intinstall_input_magick_readers(void){#if (MagickLibVersion < 0x0534)#define AT_MAGICK_SET_INFO(X) X = GetMagickInfo(NULL)#else  /* (MagickLibVersion < 0x0534) */#define AT_MAGICK_SET_INFO(X)			/  do {						/    X = GetMagickInfo(NULL, &exception);	/    if (X && !X->next)				/      X = GetMagickInfo("*", &exception);	/  } while (0)#endif	/* (MagickLibVersion < 0x0534) */#if (MagickLibVersion < 0x0537)#define AT_MAGICK_SUFFIX_FIELD_NAME tag#else  /* (MagickLibVersion < 0x0537) */#define AT_MAGICK_SUFFIX_FIELD_NAME name#endif	/* (MagickLibVersion < 0x0537) */#if (MagickLibVersion < 0x0538)#define AT_MAGICK_INITIALIZER()     MagickIncarnate("")#else  /* (MagickLibVersion < 0x0538) */#define AT_MAGICK_INITIALIZER()           MagickCoreGenesis("",MagickFalse);#endif	/* (MagickLibVersion < 0x0538) */#if (MagickLibVersion < 0x0540)#define AT_MAGICK_INFO_TYPE_MODIFIER     const#else  /* (MagickLibVersion < 0x0540) */#define AT_MAGICK_INFO_TYPE_MODIFIER #endif	/* (MagickLibVersion < 0x0540)*/  {    ExceptionInfo exception;    AT_MAGICK_INFO_TYPE_MODIFIER const MagickInfo *info, *magickinfo;    AT_MAGICK_INITIALIZER() ;    GetExceptionInfo(&exception);    AT_MAGICK_SET_INFO(info);    magickinfo = info;    while (info)      {	if (info->AT_MAGICK_SUFFIX_FIELD_NAME && info->description)	  at_input_add_handler_full(info->AT_MAGICK_SUFFIX_FIELD_NAME,				    info->description,				    input_magick_reader,				    0,				    info->AT_MAGICK_SUFFIX_FIELD_NAME,				    NULL);	info = info->next ;      }  }  return 0;}
开发者ID:cappelaere,项目名称:autotrace,代码行数:58,


示例19: GetCyanSample

bool ScImgDataLoader_GMagick::readCMYK(Image *input, RawImage *output, int width, int height){	/* Mapping:		red:     cyan		green:   magenta		blue:    yellow		opacity: black		index:   alpha	*/	//Copied from GraphicsMagick header and modified	#define GetCyanSample(p) (p.red)	#define GetMagentaSample(p) (p.green)	#define GetYellowSample(p) (p.blue)	#define GetCMYKBlackSample(p) (p.opacity)	#define GetAlphaSample(p) (p)	bool hasAlpha = input->matte;	if (!output->create(width, height, hasAlpha ? 5 : 4)) return false;	ExceptionInfo exception;	GetExceptionInfo(&exception);	const PixelPacket *pixels = AcquireImagePixels(input, 0, 0, width, height, &exception);	if (exception.severity != UndefinedException)		CatchException(&exception);	if (!pixels) {		qCritical() << QObject::tr("Could not get pixel data!");		return false;	}    const IndexPacket *alpha = 0;    if (hasAlpha) {        alpha = AccessImmutableIndexes(input);        if (!alpha) {            qCritical() << QObject::tr("Could not get alpha channel data!");            return false;        }    }	unsigned char *buffer = output->bits();	if (!buffer) {	   qCritical() << QObject::tr("Could not allocate output buffer!");	   return false;    }	int i;	for (i = 0; i < width*height; i++) {		*buffer++ = ScaleQuantumToChar(GetCyanSample(pixels[i]));		*buffer++ = ScaleQuantumToChar(GetMagentaSample(pixels[i]));		*buffer++ = ScaleQuantumToChar(GetYellowSample(pixels[i]));		*buffer++ = ScaleQuantumToChar(GetCMYKBlackSample(pixels[i]));		if (hasAlpha) {			*buffer++ = 255 - ScaleQuantumToChar(GetAlphaSample(alpha[i]));		}	}	return true;}
开发者ID:Sheikha443,项目名称:scribus,代码行数:57,


示例20: ImageList_composite_layers

/*    Method:     ImageList#composite_layers    Purpose:    Equivalent to convert's -layers composite option    Notes:      see mogrify.c*/VALUEImageList_composite_layers(int argc, VALUE *argv, VALUE self){#if defined(HAVE_COMPOSITELAYERS)    volatile VALUE source_images;    Image *dest, *source, *new_images;    RectangleInfo geometry;    CompositeOperator operator = OverCompositeOp;    ExceptionInfo exception;    switch (argc)    {        case 2:            VALUE_TO_ENUM(argv[1], operator, CompositeOperator);        case 1:            source_images = argv[0];            break;        default:            rb_raise(rb_eArgError, "wrong number of arguments (expected 1 or 2, got %d)", argc);            break;    }    // Convert ImageLists to image sequences.    dest = images_from_imagelist(self);    new_images = clone_imagelist(dest);    rm_split(dest);    source = images_from_imagelist(source_images);    SetGeometry(new_images,&geometry);    (void) ParseAbsoluteGeometry(new_images->geometry, &geometry);    geometry.width  = source->page.width != 0 ? source->page.width : source->columns;    geometry.height = source->page.height != 0 ? source->page.height : source->rows;    GravityAdjustGeometry(new_images->page.width  != 0 ? new_images->page.width  : new_images->columns                        , new_images->page.height != 0 ? new_images->page.height : new_images->rows                        , new_images->gravity, &geometry);    GetExceptionInfo(&exception);    CompositeLayers(new_images, operator, source, geometry.x, geometry.y, &exception);    rm_split(source);    rm_check_exception(&exception, new_images, DestroyOnError);    (void) DestroyExceptionInfo(&exception);    return rm_imagelist_from_images(new_images);#else    self = self;    argc = argc;    argv = argv;    rm_not_implemented();    return (VALUE)0;#endif}
开发者ID:Flagship8787,项目名称:Suwaru-Rails,代码行数:61,


示例21: lib_writeImages

/*----------------------------------------------------------------------- */SEXPlib_writeImages (SEXP x, SEXP files, SEXP quality) {    int nz, nfiles, i;    Image * images, * image;    ImageInfo *image_info;    ExceptionInfo exception;    /* basic checks */    validImage(x,0);    images = sexp2Magick (x);    nz = GetImageListLength(images);     nfiles = LENGTH (files);    if ( nfiles != 1 && nfiles != nz)        error ( "number of files must be 1, or equal to the size of the image stack" );        if ( images == NULL || GetImageListLength (images) < 1 )        error ( "cannot write an empty image" );    GetExceptionInfo (&exception);    image_info = CloneImageInfo ( (ImageInfo *)NULL );    /* set attributes in image_info*/    image_info->compression = images->compression;    image_info->quality = (unsigned int) INTEGER (quality)[0];    if ( nfiles == 1 ) {    /* save into a single file, TIFF, GIF, or automatically add file suffixes */        strcpy (image_info->filename, CHAR(STRING_ELT(files, 0)) );        /* we want to overwrite the feature imported from SEXP image */        strcpy (images->filename, image_info->filename);        WriteImages(image_info, images, CHAR(STRING_ELT(files, 0)), &exception);        CatchException (&exception);    }    else {    /* save each frame into a separate file */        for ( i = 0; i < nz; i++ ) {            image = GetImageFromList (images, i);            if ( image == NULL || GetImageListLength (image) < 1 ) {                warning ( "cannot write an empty image, skipping" );                continue;            }            strcpy (image_info->filename, CHAR(STRING_ELT(files, i)));            /* we want to overwrite the feature imported from SEXP image */            strcpy (image->filename, image_info->filename);            WriteImage (image_info, image);            CatchException (&image->exception);            // WriteImages(image_info, image, CHAR(STRING_ELT(files, i)), &exception);            // CatchException (&exception);        }    }    image_info = DestroyImageInfo (image_info);    images = DestroyImageList (images);    DestroyExceptionInfo(&exception);    return R_NilValue;}
开发者ID:kevin-keraudren,项目名称:cell-segmentation,代码行数:57,


示例22: malloc

Image   *get_blur_maked(Image *img, c_image *c){    Image           *maked_img;    static  unsigned short    color = 0;    unsigned int    x = 0;    unsigned int    y = 0;    unsigned char   *pixel_map = malloc(img->columns * img->rows * sizeof(*pixel_map));        c->label_map = malloc(img->columns * img->rows * sizeof(*c->label_map));        int             width = (int)img->columns;    int             height = (int)img->rows;        PixelPacket     *px;    ExceptionInfo	exception;        GetExceptionInfo(&exception);        px = GetImagePixels(img, 0, 0, img->columns, img->rows);        while (y < height) {        x = 0;        while (x < width) {            pixel_map[(width * y) + x] = (char)px[(width * y) + x].green;            x++;        }        y++;    }    y = 0;        while (y < height){        x = 0;        while (x < width){            if (pixel_map[(width * y) + x] != WHITE){                c->label_map[(width * y) + x] = 1;                pixel_map[(width * y) + x] = get_neighborpixcel(pixel_map, x, y, width, height, color, c);            }            else{                c->label_map[(width * y) + x] = 0;            }            if(color >= 255){                color = 0;            }            x++;        }        y++;     }    maked_img = ConstituteImage(width, height, "I", CharPixel, pixel_map, &exception);        free(c->label_map);    free(pixel_map);    DestroyImage(img);    SyncImagePixels(maked_img);        return (maked_img);}
开发者ID:adamlin,项目名称:TissueReconstruction,代码行数:56,


示例23: InitializeMagick

struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int factor){	Image *mimg;	Image *resized;	ExceptionInfo exception;	MagickBooleanType ret;	int new_width = img->width * factor;	int new_height = img->height * factor;	struct fp_img *newimg;	/* It is possible to implement resizing using a simple algorithm, however	 * we use ImageMagick because it applies some kind of smoothing to the	 * result, which improves matching performances in my experiments. */	if (!IsMagickInstantiated())		InitializeMagick(NULL);		GetExceptionInfo(&exception);	mimg = ConstituteImage(img->width, img->height, "I", CharPixel, img->data,		&exception);	GetExceptionInfo(&exception);	resized = ResizeImage(mimg, new_width, new_height, 0, 1.0, &exception);	newimg = fpi_img_new(new_width * new_height);	newimg->width = new_width;	newimg->height = new_height;	newimg->flags = img->flags;	GetExceptionInfo(&exception);	ret = ExportImagePixels(resized, 0, 0, new_width, new_height, "I",		CharPixel, newimg->data, &exception);	if (ret != MagickTrue) {		fp_err("export failed");		return NULL;	}	DestroyImage(mimg);	DestroyImage(resized);	return newimg;}
开发者ID:TheDudeWithThreeHands,项目名称:libfprint,代码行数:42,


示例24: GetExceptionInfo

Image		*get_blue_channe_image(Image *img){  unsigned int	i = 0;  unsigned int	j = 0;  PixelPacket	*px_original;  PixelPacket	*px_new;  Image		*new_img;  ExceptionInfo	exception;  ImageInfo	*new_img_info;  GetExceptionInfo(&exception);  if ((new_img_info = CloneImageInfo((ImageInfo *)NULL)) == NULL) {    CatchException(&exception);    DestroyImageInfo(new_img_info);    return (NULL);  }  new_img_info->colorspace = RGBColorspace;  new_img = AllocateImage(new_img_info);  new_img->rows = img->rows;  new_img->columns = img->columns;  if ((px_original = GetImagePixelsEx(img, 0, 0, img->columns, img->rows, &exception)) == NULL)    {      DestroyImage(new_img);      CatchException(&exception);      return (NULL);    }  if ((px_new = SetImagePixelsEx(new_img, 0, 0, new_img->columns, new_img->rows, &exception)) == NULL)    {      DestroyImage(new_img);      CatchException(&exception);      return (NULL);    }  while (i < img->rows)    {      j = 0;      while (j < img->columns)	{	  px_new[(new_img->columns * i) + j].red = 0;	  px_new[(new_img->columns * i) + j].blue = px_original[(img->columns * i) + j].blue;	  px_new[(new_img->columns * i) + j].green = 0;	  j++;	}      i++;    }  SyncImagePixels(new_img);  DestroyImageInfo(new_img_info);  return (new_img);}
开发者ID:NIF-au,项目名称:DigitalControlServer,代码行数:54,



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


C++ GetExceptionInformation函数代码示例
C++ GetExStyle函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。