本文整理汇总了C++中NewMagickWand函数的典型用法代码示例。如果您正苦于以下问题:C++ NewMagickWand函数的具体用法?C++ NewMagickWand怎么用?C++ NewMagickWand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewMagickWand函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc,char **argv) {
MagickWand *magick_wand_background;
MagickWand *magick_wand_foreground;
MagickWandGenesis();
magick_wand_background = NewMagickWand();
magick_wand_foreground = NewMagickWand();
MagickReadImage(magick_wand_background, "magick:logo");
MagickReadImage(magick_wand_foreground, "magick:rose");
MagickSetGravity(magick_wand_background, CenterGravity);
MagickSetGravity(magick_wand_foreground, CenterGravity);
MagickCompositeImage(
magick_wand_background,
magick_wand_foreground,
AtopCompositeOp,
0, 0
);
MagickSetFormat(magick_wand_background, "png");
MagickWriteImage(magick_wand_background, "./output/gravity.png");
MagickWandTerminus();
return 0;
}
开发者ID:Danack,项目名称:imagemagicktest,代码行数:28,代码来源:gravity.c
示例2: main
int main(int argc,char **argv)
{
//creamos la imagen
MagickWand *imagen, *imagen2;
int proporcion = atoi(argv[3]);
//inicializamos la imagen
imagen = NewMagickWand();
imagen2 = NewMagickWand();
//cargamos la imagen
MagickReadImage(imagen,argv[1]);
//imagen2 = CloneMagickWand(imagen);
//llamamos a la funcion de redimension
Resize(imagen,imagen2,proporcion);
//guardamos la imagen en disco
MagickWriteImages(imagen2,argv[2],MagickTrue);
//liberamos memoria destruyendo la imagen
imagen = DestroyMagickWand(imagen2);
//terminamos ejecucion de la libreria
MagickWandTerminus();
return 0;
}
开发者ID:manast001,项目名称:fase2Paralelas,代码行数:30,代码来源:Resize.c
示例3: img_init
bool
img_init (img_t *im)
{
MagickWandGenesis();
if (im) {
im->screen = (void *) NewMagickWand();
im->banner = (void *) NewMagickWand();
return true;
}
return false;
}
开发者ID:imaami,项目名称:kivijalka,代码行数:13,代码来源:img.c
示例4: NewMagickWand
unsigned char *get_transition_image_blob(char *file_buf, int buf_size,
size_t * thumbnail_size, img_transition_info *image_transition_info) {
unsigned char *image_data = NULL;
if (file_buf == NULL)
return NULL;
if (image_transition_info == NULL)
return NULL;
if ((0 == image_transition_info->is_rotate)
&& ('\0' == image_transition_info->transition_str[0])
&& (0 == image_transition_info->is_quality))
return NULL;
MagickBooleanType status;
MagickWand *magick_wand = NULL;
magick_wand = NewMagickWand();
status = MagickReadImageBlob(magick_wand, file_buf, buf_size);
if (status == MagickFalse) {
ThrowWandException(magick_wand);
return NULL;
}
image_data = covert_image(magick_wand, image_transition_info,
thumbnail_size);
magick_wand = DestroyMagickWand(magick_wand);
return image_data;
}
开发者ID:lixy,项目名称:nginx-fastdfs,代码行数:27,代码来源:fdfs_thumbnail.c
示例5: magickUnsharpMaskImage
int magickUnsharpMaskImage(const char *imageFile, const char *outputImage, double radius, double sigma, double amount, double threshold){
MagickBooleanType status;
MagickWand *magick_wand;
/*
Read an image.
*/
MagickWandGenesis();
magick_wand=NewMagickWand();
status=MagickReadImage(magick_wand, (char *)imageFile);
if (status == MagickFalse){
ThrowWandException(magick_wand);
}
/*
Turn the images into a thumbnail sequence.
*/
// MagickResetIterator(magick_wand);
// while (MagickNextImage(magick_wand) != MagickFalse)
MagickUnsharpMaskImage(magick_wand, radius, sigma, amount, threshold);
/*
Write the image then destroy it.
*/
status=MagickWriteImages(magick_wand, (char *)outputImage, MagickTrue);
if (status == MagickFalse)
ThrowWandException(magick_wand);
magick_wand=DestroyMagickWand(magick_wand);
MagickWandTerminus();
return status;
}
开发者ID:amirsalah,项目名称:cs2007,代码行数:30,代码来源:extfuncs.c
示例6: magickCompressImage
int magickCompressImage(const char *imageFile, const char *outputImage, const char *format, int compressionType, double compressionRate){
MagickBooleanType status;
MagickWand *magick_wand;
/*
Read an image.
*/
// printf("compressionRate: %d", compressionRate);
MagickWandGenesis();
magick_wand=NewMagickWand();
status=MagickReadImage(magick_wand, (char *)imageFile);
if (status == MagickFalse){
ThrowWandException(magick_wand);
}
/*
Turn the images into a thumbnail sequence.
*/
// MagickResetIterator(magick_wand);
// while (MagickNextImage(magick_wand) != MagickFalse){
MagickSetFormat(magick_wand, (char *)format);
MagickSetImageCompression(magick_wand, compressionType);
MagickSetImageCompressionQuality(magick_wand, compressionRate);
// }
/*
Write the image then destroy it.
*/
status=MagickWriteImages(magick_wand, (char *)outputImage, MagickTrue);
if (status == MagickFalse)
ThrowWandException(magick_wand);
magick_wand=DestroyMagickWand(magick_wand);
MagickWandTerminus();
return status;
}
开发者ID:amirsalah,项目名称:cs2007,代码行数:35,代码来源:extfuncs.c
示例7: magickChopImage
int magickChopImage(const char *imageFile, const char *outputImage, int width, int height, int xPos, int yPos){
MagickBooleanType status;
MagickWand *magick_wand;
/*
Read an image.
*/
MagickWandGenesis();
magick_wand=NewMagickWand();
status=MagickReadImage(magick_wand, (char *)imageFile);
if (status == MagickFalse){
ThrowWandException(magick_wand);
}
/*
Turn the images into a thumbnail sequence.
*/
MagickResetIterator(magick_wand);
while (MagickNextImage(magick_wand) != MagickFalse)
MagickChopImage(magick_wand, width, height, xPos, yPos);
/*
Write the image then destroy it.
*/
status=MagickWriteImages(magick_wand, (char *)outputImage, MagickTrue);
if (status == MagickFalse)
ThrowWandException(magick_wand);
magick_wand=DestroyMagickWand(magick_wand);
MagickWandTerminus();
return status;
}
开发者ID:amirsalah,项目名称:cs2007,代码行数:30,代码来源:extfuncs.c
示例8: magickRotateImage
int magickRotateImage(const char *imageFile, const char *outputImage, double degree){
MagickBooleanType status;
MagickWand *magick_wand;
PixelWand * bg = malloc(sizeof(PixelWand *));
/*
Read an image.
*/
MagickWandGenesis();
magick_wand=NewMagickWand();
status=MagickReadImage(magick_wand, (char *)imageFile);
if (status == MagickFalse){
ThrowWandException(magick_wand);
}
/*
Turn the images into a thumbnail sequence.
*/
MagickResetIterator(magick_wand);
while (MagickNextImage(magick_wand) != MagickFalse)
MagickRotateImage(magick_wand, bg, degree);
// MagickSetImageCompression(magick_wand, MW_JPEGCompression);
// MagickUnsharpMaskImage( magick_wand, 4.5, 4.0, 4.5, 0.02 );
/*
Write the image then destroy it.
*/
status=MagickWriteImages(magick_wand, (char *)outputImage, MagickTrue);
if (status == MagickFalse)
ThrowWandException(magick_wand);
magick_wand=DestroyMagickWand(magick_wand);
MagickWandTerminus();
return status;
}
开发者ID:amirsalah,项目名称:cs2007,代码行数:32,代码来源:extfuncs.c
示例9: magickResizeImage
int magickResizeImage(const char *imageFile, const char *outputImage, int columns, int rows, int magickFilter, double blur){
MagickBooleanType status;
MagickWand *magick_wand;
/*
Read an image.
*/
MagickWandGenesis();
magick_wand=NewMagickWand();
status=MagickReadImage(magick_wand, (char *)imageFile);
if (status == MagickFalse){
ThrowWandException(magick_wand);
}
/*
Turn the images into a thumbnail sequence.
*/
MagickResetIterator(magick_wand);
while (MagickNextImage(magick_wand) != MagickFalse)
MagickResizeImage(magick_wand, columns, rows, LanczosFilter, blur);
/*
Write the image then destroy it.
*/
status=MagickWriteImages(magick_wand, (char *)outputImage, MagickTrue);
if (status == MagickFalse)
ThrowWandException(magick_wand);
magick_wand=DestroyMagickWand(magick_wand);
MagickWandTerminus();
return status;
}
开发者ID:amirsalah,项目名称:cs2007,代码行数:31,代码来源:extfuncs.c
示例10: magickModulateImage
int magickModulateImage(const char *imageFile, const char *outputImage, double brightness, double saturation, double hue){
MagickBooleanType status;
MagickWand *magick_wand;
/*
Read an image.
*/
MagickWandGenesis();
magick_wand=NewMagickWand();
status=MagickReadImage(magick_wand, (char *)imageFile);
if (status == MagickFalse){
ThrowWandException(magick_wand);
}
/*
Turn the images into a thumbnail sequence.
*/
MagickResetIterator(magick_wand);
while (MagickNextImage(magick_wand) != MagickFalse)
MagickModulateImage(magick_wand, brightness, saturation, hue);
/*
Write the image then destroy it.
*/
status=MagickWriteImages(magick_wand, (char *)outputImage, MagickTrue);
if (status == MagickFalse)
ThrowWandException(magick_wand);
magick_wand=DestroyMagickWand(magick_wand);
MagickWandTerminus();
return status;
}
开发者ID:amirsalah,项目名称:cs2007,代码行数:30,代码来源:extfuncs.c
示例11: print_accumulator
/**
* Helper function to provide a visual interpretation of the accumulator.
*/
void print_accumulator(char* name) {
MagickWand *mw = NULL;
PixelWand **pmw = NULL;
PixelIterator *imw = NULL;
MagickWandGenesis();
unsigned long width, height;
width = _circumference;
height = _dimensions.semi_diagonal;
mw = NewMagickWand();
MagickSetSize(mw, width, height);
MagickReadImage(mw, "xc:black");
imw = NewPixelIterator(mw);
int y, x;
for (y=0; y<height; y++) {
pmw = PixelGetNextIteratorRow(imw, &width);
for (x=0; x< (long) width; x++) {
_CELL_TYPE* cell = &_accumulator[x][height-y-1];
PixelSetRed(pmw[x], 1.0/20.0 * cell->count);
}
PixelSyncIterator(imw);
}
MagickWriteImage(mw, name);
if(mw)
mw = DestroyMagickWand(mw);
MagickWandTerminus();
}
开发者ID:aitazhixin,项目名称:HoughTransform,代码行数:34,代码来源:hough_transform.c
示例12: NewMagickWand
static MagickWand *iac_image_new(const iac_image_read_params_t *params)
{
MagickWand *wand = NULL;
/* Create wand */
wand = NewMagickWand();
if (!wand) {
iac_image_destroy(wand);
return NULL;
}
/* Set width and height of image */
if (MagickSetSize(wand, params->width, params->height) == MagickFalse) {
iac_image_exception(wand);
iac_image_destroy(wand);
return NULL;
}
/* Set format of image */
if (MagickSetFormat(wand, params->format) == MagickFalse) {
iac_image_exception(wand);
iac_image_destroy(wand);
return NULL;
}
/* Set color depth of image */
if (MagickSetDepth(wand, params->depth) == MagickFalse) {
iac_image_exception(wand);
iac_image_destroy(wand);
return NULL;
}
return wand;
}
开发者ID:acinonyx,项目名称:upsat-iac-software,代码行数:34,代码来源:image.c
示例13: barcode_to_png
int barcode_to_png (char *image_name) {
MagickWand *magick_wand;
MagickBooleanType status;
int width, height, pad, half_pad;
/* read a barcode image */
MagickWandGenesis();
magick_wand = NewMagickWand();
MagickSetResolution(magick_wand, 300, 300);
status = MagickReadImage(magick_wand, image_name);
if (status == MagickFalse) ThrowWandException(magick_wand, 1);
/* trim the image, resample it, and pad it by [10% of the long side] per side */
MagickTrimImage(magick_wand, 10);
width = MagickGetImageWidth(magick_wand);
height = MagickGetImageHeight(magick_wand);
pad = determine_padding(width, height);
half_pad = round(pad/2);
MagickExtentImage(magick_wand, width+pad, height+pad, -half_pad, -half_pad);
/* write image (a PNG version and a formatted PS version) */
status=MagickWriteImage(magick_wand, chop_path(image_name, ".png"));
if (status == MagickFalse) ThrowWandException(magick_wand, 2);
status=MagickWriteImage(magick_wand, chop_path(image_name, ".ps"));
if (status == MagickFalse) ThrowWandException(magick_wand, 2);
/* clean up */
magick_wand=DestroyMagickWand(magick_wand);
MagickWandTerminus();
return 0;
}
开发者ID:Inaimathi,项目名称:erl-ps-barcode,代码行数:33,代码来源:wand.c
示例14: main
int main(int argc,char **argv) {
MagickWand *magick_wand;
MagickBooleanType status;
MagickWandGenesis();
magick_wand = NewMagickWand();
MagickSetResourceLimit(MemoryResource, 1000 * 1000);
MagickSetResourceLimit(DiskResource, 1000 * 1000);
status = MagickReadImage(magick_wand, "./images/picture-100M-6000x6000.png");
if (status == MagickFalse) {
printf("Failed to MagickReadImage");
return -1;
}
printf("This shouldn't be reached - the image is larger than the area resource.\n");
MagickSetImageFormat(magick_wand, "png");
status = MagickWriteImages(magick_wand, "./output/resource_output.png", MagickTrue);
if (status == MagickFalse) {
printf("Failed to MagickWriteImages");
return -1;
}
MagickWandTerminus();
return(0);
}
开发者ID:Danack,项目名称:imagemagicktest,代码行数:32,代码来源:resource.c
示例15: ngx_http_circle_gif_init
static ngx_int_t
ngx_http_circle_gif_init(ngx_http_circle_gif_loc_conf_t *cglcf)
{
u_int i;
MagickWand *wand;
PixelWand *bg_wand, *fg_wand;
DrawingWand *dwand;
wand = NewMagickWand();
bg_wand = NewPixelWand();
fg_wand = NewPixelWand();
dwand = NewDrawingWand();
if ((cglcf->circle_templates = malloc((1+radius2index(cglcf->max_radius, cglcf))*sizeof(unsigned char*))) == NULL ||
(cglcf->circle_sizes = malloc((1+radius2index(cglcf->max_radius, cglcf))*sizeof(size_t))) == NULL) {
perror("malloc()");
return NGX_ERROR;
}
for (i=0;i<=radius2index(cglcf->max_radius, cglcf);i++) {
cglcf->circle_templates[i] = ngx_http_circle_gif_template(cglcf->min_radius+i*cglcf->step_radius, &cglcf->circle_sizes[i],
wand, bg_wand, fg_wand, dwand);
}
DestroyMagickWand( wand );
DestroyPixelWand( fg_wand );
DestroyPixelWand( bg_wand );
DestroyDrawingWand( dwand );
return i;
}
开发者ID:WinLinKer,项目名称:nginx_circle_gif,代码行数:27,代码来源:ngx_http_circle_gif_module.c
示例16: main
int main(int argc, char* argv[]) {
MagickWand *mw = NULL;
DrawingWand *dw = NULL;
PixelWand *fill = NULL;
int x,y;
MagickWandGenesis();
mw = NewMagickWand();
MagickReadImage(mw,"logo:");
fill = NewPixelWand();
dw = NewDrawingWand();
PixelSetColor(fill,"green");
DrawSetFillColor(dw,fill);
for (x=200;x<210;x++)
for (y=100;y<110;y++)
DrawPoint(dw,x,y);
MagickDrawImage(mw,dw);
MagickWriteImage(mw,"logo.jpg");
if (dw) dw = DestroyDrawingWand(dw);
if (fill) fill = DestroyPixelWand(fill);
if (mw) mw = DestroyMagickWand(mw);
MagickWandTerminus();
}
开发者ID:ajdecon,项目名称:play,代码行数:29,代码来源:pixel-change.c
示例17: main
int main(int argc,char **argv) {
MagickWand *magick_wand;
MagickBooleanType status;
MagickWandGenesis();
magick_wand = NewMagickWand();
//This is a color image
status = MagickReadImage(magick_wand, "./Biter_500.jpg");
MagickScaleImage(magick_wand, 16, 16);
// MagickQuantizeImage(
// magick_wand,
// //Changing to 255 makes the image change to grayscale
// 255,
// GRAYColorspace,
// 0,
// 0,
// 0
// );
status = MagickWriteImages(magick_wand, "./67258.jpg", MagickTrue);
MagickWandTerminus();
return(0);
}
开发者ID:Danack,项目名称:imagemagicktest,代码行数:27,代码来源:67258.c
示例18: Cimp
GmImp::GmImp()
: Cimp()
{
this->wand = nullptr;
char *im_path = NULL;
InitializeMagick(im_path);
this->wand = NewMagickWand();
}
开发者ID:kitech,项目名称:nullimp,代码行数:8,代码来源:gmimp.cpp
示例19: loadImage
ARUint8* loadImage(char* filename, int* xsize, int* ysize)
{
ARUint8 *dptr;
Image *image;
MagickWand* magick_wand;
magick_wand=NewMagickWand();
if( magick_wand == NULL) {
fprintf(stderr, "bad magickwand\n");
}
MagickBooleanType status=MagickReadImage(magick_wand,filename);
if (status == MagickFalse) {
//fprintf(stderr, "%s can't be read\n", filename);
//exit(1);
//return; //(1);
ThrowWandException(magick_wand);
}
image = GetImageFromMagickWand(magick_wand);
//ContrastImage(image,MagickTrue);
//EnhanceImage(image,&image->exception);
int index;
*xsize = image->columns;
*ysize = image->rows;
dptr = malloc(sizeof(ARUint8) * 3 * image->rows * *xsize);
int y;
index = 0;
for (y=0; y < (long) image->rows; y++)
{
const PixelPacket *p = AcquireImagePixels(image,0,y,*xsize,1,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
int x;
for (x=0; x < (long) *xsize; x++)
{
/// convert to ARUint8 dptr
/// probably a faster way to give the data straight over
/// in BGR format
dptr[index*3+2] = p->red/256;
dptr[index*3+1] = p->green/256;
dptr[index*3] = p->blue/256;
//fprintf(stderr,"%d, %d, %d\t%d\t%d\n", x, y, p->red/256, p->green/256, p->blue/256);
p++;
index++;
}
}
DestroyMagickWand(magick_wand);
return dptr;
}
开发者ID:SebMenozzi,项目名称:binarymillenium,代码行数:58,代码来源:loadimage.c
示例20: main
int main(int argc,char **argv) {
MagickBooleanType status;
PixelWand *pixelWand;
MagickWand *magick_wand_a;
MagickWand *magick_wand_b;
//MagickWand *magick_wand_c;
MagickWandGenesis();
magick_wand_a = NewMagickWand();
status = MagickReadImage(magick_wand_a, "./displaceCompositeA.png");
if (status == MagickFalse) {
ThrowWandException(magick_wand_a);
}
magick_wand_b = NewMagickWand();
status = MagickReadImage(magick_wand_b, "./displaceMask.png");
if (status == MagickFalse) {
ThrowWandException(magick_wand_b);
}
MagickSetImageVirtualPixelMethod(magick_wand_a, TransparentVirtualPixelMethod);
pixelWand = makePixelWand("none");
status = MagickSetImageBackgroundColor(magick_wand_a, pixelWand);
MagickSetOption(magick_wand_a, "compose:args", "300x53.033");
status = MagickCompositeImage(magick_wand_a, magick_wand_b, DisplaceCompositeOp, 0, 0);
if (status == MagickFalse) {
printf("Failed to composite image b");
exit(-1);
}
status = MagickWriteImages(magick_wand_a, "displaceOutputMerged.png", MagickTrue);
MagickWandTerminus();
printf("Finished - please compare displaceOutputMerged.png with the result of:\n\n");
printf("convert displaceCompositeA.png displaceMask.png -virtual-pixel transparent -channel rgba -alpha on -background transparent -define compose:args=300x53.033 -compose displace -composite displaceMerged.png");
return(0);
}
开发者ID:Danack,项目名称:imagemagicktest,代码行数:45,代码来源:displaceComposite2.c
注:本文中的NewMagickWand函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论