/* * Class: magick_MontageInfo * Method: init * Signature: (Lmagick/ImageInfo;)V */ JNIEXPORT void JNICALL Java_magick_MontageInfo_init (JNIEnv *env, jobject self, jobject imageInfo) { ImageInfo *info; MontageInfo *montageInfo; /* Obtain the ImageInfo */ info = (ImageInfo*) getHandle(env, imageInfo, "imageInfoHandle", NULL); if (info == NULL) { throwMagickException(env, "Unable to obtain ImageInfo handle"); return; } /* Initialise the MontageInfo handle, allocating memory if required */ montageInfo = (MontageInfo*) getHandle(env, self, "montageInfoHandle", NULL); if (montageInfo == NULL) { montageInfo = (MontageInfo*) AcquireMemory(sizeof(MontageInfo)); if (montageInfo == NULL) { throwMagickException(env, "Unable to allocate " "memory for MontageInfo"); return; } } GetMontageInfo(info, montageInfo); setHandle(env, self, "montageInfoHandle", (void*) montageInfo, NULL); }
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % % C l o n e M o n t a g e I n f o % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % CloneMontageInfo() makes a copy of the given montage info structure. If % NULL is specified, a new image info structure is created initialized to % default values. % % The format of the CloneMontageInfo method is: % % MontageInfo *CloneMontageInfo(const ImageInfo *image_info, % const MontageInfo *montage_info) % % A description of each parameter follows: % % o image_info: the image info. % % o montage_info: the montage info. % */ MagickExport MontageInfo *CloneMontageInfo(const ImageInfo *image_info, const MontageInfo *montage_info) { MontageInfo *clone_info; clone_info=(MontageInfo *) AcquireMagickMemory(sizeof(*clone_info)); if (clone_info == (MontageInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetMontageInfo(image_info,clone_info); if (montage_info == (MontageInfo *) NULL) return(clone_info); if (montage_info->geometry != (char *) NULL) clone_info->geometry=AcquireString(montage_info->geometry); if (montage_info->tile != (char *) NULL) clone_info->tile=AcquireString(montage_info->tile); if (montage_info->title != (char *) NULL) clone_info->title=AcquireString(montage_info->title); if (montage_info->frame != (char *) NULL) clone_info->frame=AcquireString(montage_info->frame); if (montage_info->texture != (char *) NULL) clone_info->texture=AcquireString(montage_info->texture); if (montage_info->font != (char *) NULL) clone_info->font=AcquireString(montage_info->font); clone_info->pointsize=montage_info->pointsize; clone_info->border_width=montage_info->border_width; clone_info->shadow=montage_info->shadow; clone_info->fill=montage_info->fill; clone_info->stroke=montage_info->stroke; clone_info->background_color=montage_info->background_color; clone_info->border_color=montage_info->border_color; clone_info->matte_color=montage_info->matte_color; clone_info->gravity=montage_info->gravity; (void) CopyMagickString(clone_info->filename,montage_info->filename, MagickPathExtent); clone_info->debug=IsEventLogging(); return(clone_info); }