本文整理汇总了C++中AcquireString函数的典型用法代码示例。如果您正苦于以下问题:C++ AcquireString函数的具体用法?C++ AcquireString怎么用?C++ AcquireString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AcquireString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMontageInfo
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% G e t M o n t a g e I n f o %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% GetMontageInfo() initializes montage_info to default values.
%
% The format of the GetMontageInfo method is:
%
% void GetMontageInfo(const ImageInfo *image_info,
% MontageInfo *montage_info)
%
% A description of each parameter follows:
%
% o image_info: a structure of type ImageInfo.
%
% o montage_info: Specifies a pointer to a MontageInfo structure.
%
*/
MagickExport void GetMontageInfo(const ImageInfo *image_info,
MontageInfo *montage_info)
{
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickCoreSignature);
if (image_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
assert(montage_info != (MontageInfo *) NULL);
(void) ResetMagickMemory(montage_info,0,sizeof(*montage_info));
(void) CopyMagickString(montage_info->filename,image_info->filename,
MagickPathExtent);
montage_info->geometry=AcquireString(DefaultTileGeometry);
if (image_info->font != (char *) NULL)
montage_info->font=AcquireString(image_info->font);
montage_info->gravity=CenterGravity;
montage_info->pointsize=image_info->pointsize;
montage_info->fill.alpha=OpaqueAlpha;
montage_info->stroke.alpha=(Quantum) TransparentAlpha;
montage_info->matte_color=image_info->matte_color;
montage_info->background_color=image_info->background_color;
montage_info->border_color=image_info->border_color;
montage_info->debug=IsEventLogging();
montage_info->signature=MagickCoreSignature;
}
示例2: getHandle
/*
* Class: magick_ImageInfo
* Method: setImageOption
* Signature: (Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_magick_ImageInfo_setImageOption
(JNIEnv *env, jobject self, jstring option, jstring value)
{
ImageInfo *info = NULL;
const char *cstr1 = NULL;
const char *cstr2 = NULL;
info = (ImageInfo *) getHandle(env, self, "imageInfoHandle", NULL);
if (info == NULL) {
throwMagickException(env, "Unable to retrieve handle");
return;
}
cstr1 = (*env)->GetStringUTFChars(env, option, 0);
if (cstr1 == NULL) {
throwMagickException(env, "Unable to retrieve Java string chars");
return;
}
cstr2 = (*env)->GetStringUTFChars(env, value, 0);
if (cstr2 == NULL) {
throwMagickException(env, "Unable to retrieve Java string chars");
return;
}
SetImageOption(info, (char *)AcquireString(cstr1), (char *)AcquireString(cstr2));
(*env)->ReleaseStringUTFChars(env, option, cstr1);
(*env)->ReleaseStringUTFChars(env, value, cstr2);
}
示例3: RegisterFAXImage
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e g i s t e r F A X I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% RegisterFAXImage() adds attributes for the FAX image format to
% the list of supported formats. The attributes include the image format
% tag, a method to read and/or write the format, whether the format
% supports the saving of more than one frame to the same file or blob,
% whether the format supports native in-memory I/O, and a brief
% description of the format.
%
% The format of the RegisterFAXImage method is:
%
% RegisterFAXImage(void)
%
*/
ModuleExport void RegisterFAXImage(void)
{
MagickInfo
*entry;
static const char
*Note=
{
"See TIFF format. Note that FAX machines use non-square pixels which\n"
"are 1.5 times wider than they are tall but computer displays use\n"
"square pixels. FAX images may appear to be narrow unless they are\n"
"explicitly resized using a resize specification of \"150x100%\"."
};
entry=SetMagickInfo("FAX");
entry->decoder=(DecoderHandler *) ReadFAXImage;
entry->encoder=(EncoderHandler *) WriteFAXImage;
entry->magick=(MagickHandler *) IsFAX;
entry->description=AcquireString("Group 3 FAX");
entry->note=AcquireString(Note);
entry->module=AcquireString("FAX");
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("G3");
entry->decoder=(DecoderHandler *) ReadFAXImage;
entry->encoder=(EncoderHandler *) WriteFAXImage;
entry->magick=(MagickHandler *) IsFAX;
entry->adjoin=MagickFalse;
entry->description=AcquireString("Group 3 FAX");
entry->module=AcquireString("FAX");
(void) RegisterMagickInfo(entry);
}
示例4: RegisterSTEGANOImage
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e g i s t e r S T E G A N O I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% RegisterSTEGANOImage() adds attributes for the STEGANO image format to
% the list of supported formats. The attributes include the image format
% tag, a method to read and/or write the format, whether the format
% supports the saving of more than one frame to the same file or blob,
% whether the format supports native in-memory I/O, and a brief
% description of the format.
%
% The format of the RegisterSTEGANOImage method is:
%
% RegisterSTEGANOImage(void)
%
*/
ModuleExport void RegisterSTEGANOImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("STEGANO");
entry->decoder=(DecoderHandler *) ReadSTEGANOImage;
entry->description=AcquireString("Steganographic image");
entry->module=AcquireString("STEGANO");
(void) RegisterMagickInfo(entry);
}
示例5: RegisterCIPImage
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e g i s t e r C I P I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% RegisterCIPImage() adds attributes for the CIP IP phone image format to
% the list of supported formats. The attributes include the image format
% tag, a method to read and/or write the format, whether the format
% supports the saving of more than one frame to the same file or blob,
% whether the format supports native in-memory I/O, and a brief
% description of the format.
%
% The format of the RegisterCIPImage method is:
%
% RegisterCIPImage(void)
%
*/
ModuleExport void RegisterCIPImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("CIP");
entry->encoder=(EncoderHandler *) WriteCIPImage;
entry->adjoin=MagickFalse;
entry->description=AcquireString("Cisco IP phone image format");
entry->module=AcquireString("CIP");
(void) RegisterMagickInfo(entry);
}
示例6: RegisterTILEImage
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e g i s t e r T I L E I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% RegisterTILEImage() adds attributes for the TILE image format to
% the list of supported formats. The attributes include the image format
% tag, a method to read and/or write the format, whether the format
% supports the saving of more than one frame to the same file or blob,
% whether the format supports native in-memory I/O, and a brief
% description of the format.
%
% The format of the RegisterTILEImage method is:
%
% RegisterTILEImage(void)
%
*/
ModuleExport void RegisterTILEImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("TILE");
entry->decoder=(DecoderHandler *) ReadTILEImage;
entry->raw=MagickTrue;
entry->endian_support=MagickTrue;
entry->description=AcquireString("Tile image with a texture");
entry->module=AcquireString("TILE");
(void) RegisterMagickInfo(entry);
}
示例7: RegisterMVGImage
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e g i s t e r M V G I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% RegisterMVGImage() adds attributes for the MVG image format
% to the list of supported formats. The attributes include the image format
% tag, a method to read and/or write the format, whether the format
% supports the saving of more than one frame to the same file or blob,
% whether the format supports native in-memory I/O, and a brief
% description of the format.
%
% The format of the RegisterMVGImage method is:
%
% RegisterMVGImage(void)
%
*/
ModuleExport void RegisterMVGImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("MVG");
entry->decoder=(DecoderHandler *) ReadMVGImage;
entry->encoder=(EncoderHandler *) WriteMVGImage;
entry->magick=(MagickHandler *) IsMVG;
entry->adjoin=MagickFalse;
entry->seekable_stream=MagickTrue;
entry->description=AcquireString("Magick Vector Graphics");
entry->module=AcquireString("MVG");
(void) RegisterMagickInfo(entry);
}
示例8: RegisterPLASMAImage
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e g i s t e r P L A S M A I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% RegisterPLASMAImage() adds attributes for the Plasma image format to
% the list of supported formats. The attributes include the image format
% tag, a method to read and/or write the format, whether the format
% supports the saving of more than one frame to the same file or blob,
% whether the format supports native in-memory I/O, and a brief
% description of the format.
%
% The format of the RegisterPLASMAImage method is:
%
% RegisterPLASMAImage(void)
%
*/
ModuleExport void RegisterPLASMAImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("PLASMA");
entry->decoder=(DecoderHandler *) ReadPlasmaImage;
entry->adjoin=MagickFalse;
entry->description=AcquireString("Plasma fractal image");
entry->module=AcquireString("PLASMA");
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("FRACTAL");
entry->decoder=(DecoderHandler *) ReadPlasmaImage;
entry->adjoin=MagickFalse;
entry->description=AcquireString("Plasma fractal image");
entry->module=AcquireString("PLASMA");
(void) RegisterMagickInfo(entry);
}
示例9: setHandleAttribute
/*
* Set a attribute in a generic handle to string.
*
* Input:
* env Java VM environment
* attribVar points to a C string so as to set the value
* jstr Java string for which to set the attrib
*
* Output:
* attribVar points to a new C string with content from jstr
*/
void setHandleAttribute(JNIEnv *env, char **attribVar, jstring jstr)
{
const char *cstr = NULL;
if (*attribVar != NULL) {
// RelinquishMagickMemory((void**)attribVar);
}
cstr = (*env)->GetStringUTFChars(env, jstr, 0);
*attribVar = (char *) AcquireString(cstr);
(*env)->ReleaseStringUTFChars(env, jstr, cstr);
}
示例10: ThrowException
MagickExport void ThrowException(ExceptionInfo *exception,
const ExceptionType severity,const char *reason,const char *description)
{
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
exception->severity=(ExceptionType) severity;
MagickFreeMemory(exception->reason);
if (reason)
exception->reason=
AcquireString(GetLocaleExceptionMessage(severity,reason));
MagickFreeMemory(exception->description);
if (description)
exception->description=
AcquireString(GetLocaleExceptionMessage(severity,description));
exception->error_number=errno;
MagickFreeMemory(exception->module);
MagickFreeMemory(exception->function);
exception->line=0UL;
exception->signature=0UL;
return;
}
示例11: RegisterMPEGImage
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e g i s t e r M P E G I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% RegisterMPEGImage() adds attributes for the MPEG image format to
% the list of supported formats. The attributes include the image format
% tag, a method to read and/or write the format, whether the format
% supports the saving of more than one frame to the same file or blob,
% whether the format supports native in-memory I/O, and a brief
% description of the format.
%
% The format of the RegisterMPEGImage method is:
%
% RegisterMPEGImage(void)
%
*/
ModuleExport void RegisterMPEGImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("MPEG");
entry->decoder=(DecoderHandler *) ReadMPEGImage;
entry->encoder=(EncoderHandler *) WriteMPEGImage;
entry->magick=(MagickHandler *) IsMPEG;
entry->blob_support=MagickFalse;
entry->description=AcquireString("MPEG Video Stream");
entry->module=AcquireString("MPEG");
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("MPG");
entry->decoder=(DecoderHandler *) ReadMPEGImage;
entry->encoder=(EncoderHandler *) WriteMPEGImage;
entry->magick=(MagickHandler *) IsMPEG;
entry->blob_support=MagickFalse;
entry->description=AcquireString("MPEG Video Stream");
entry->module=AcquireString("MPEG");
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("M2V");
entry->decoder=(DecoderHandler *) ReadMPEGImage;
entry->encoder=(EncoderHandler *) WriteMPEGImage;
entry->magick=(MagickHandler *) IsMPEG;
entry->blob_support=MagickFalse;
entry->description=AcquireString("MPEG Video Stream");
entry->module=AcquireString("MPEG");
(void) RegisterMagickInfo(entry);
}
示例12: RegisterRGBImage
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e g i s t e r R G B I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% RegisterRGBImage() adds attributes for the RGB image format to
% the list of supported formats. The attributes include the image format
% tag, a method to read and/or write the format, whether the format
% supports the saving of more than one frame to the same file or blob,
% whether the format supports native in-memory I/O, and a brief
% description of the format.
%
% The format of the RegisterRGBImage method is:
%
% RegisterRGBImage(void)
%
*/
ModuleExport void RegisterRGBImage(void)
{
MagickInfo
*entry;
entry=SetMagickInfo("RGB");
entry->decoder=(DecoderHandler *) ReadRGBImage;
entry->encoder=(EncoderHandler *) WriteRGBImage;
entry->raw=MagickTrue;
entry->endian_support=MagickTrue;
entry->description=AcquireString("Raw red, green, and blue samples");
entry->module=AcquireString("RGB");
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("RGBA");
entry->decoder=(DecoderHandler *) ReadRGBImage;
entry->encoder=(EncoderHandler *) WriteRGBImage;
entry->raw=MagickTrue;
entry->endian_support=MagickTrue;
entry->description=AcquireString("Raw red, green, blue, and alpha samples");
entry->module=AcquireString("RGB");
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("RGBO");
entry->decoder=(DecoderHandler *) ReadRGBImage;
entry->encoder=(EncoderHandler *) WriteRGBImage;
entry->raw=MagickTrue;
entry->endian_support=MagickTrue;
entry->description=AcquireString("Raw red, green, blue, and opacity samples");
entry->module=AcquireString("RGB");
(void) RegisterMagickInfo(entry);
}
示例13: ThrowLoggedException
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% T h r o w L o g g e d E x c e p t i o n %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ThrowLoggedException() throws an exception with the specified severity code,
% reason, optional description, source filename, function name, and line
% number. If logging is enabled, the exception is also logged.
%
% The format of the ThrowLoggedException method is:
%
% void ThrowLoggedException(ExceptionInfo *exception,
% const ExceptionType severity,const char *reason,
% const char *description,const char *module,
% const char *function,const unsigned long line
%
% A description of each parameter follows:
%
% o exception: The exception.
%
% o severity: The severity of the exception.
%
% o reason: The reason of the exception.
%
% o description: The exception description.
%
% o filename: The source module filename.
%
% o function: The function name.
%
% o line: The line number of the source module.
%
%
*/
MagickExport void ThrowLoggedException(ExceptionInfo *exception,
const ExceptionType severity,const char *reason,const char *description,
const char *module,const char *function,const unsigned long line)
{
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
exception->severity=(ExceptionType) severity;
MagickFreeMemory(exception->reason);
if (reason)
exception->reason=
AcquireString(GetLocaleExceptionMessage(severity,reason));
MagickFreeMemory(exception->description);
if (description)
exception->description=
AcquireString(GetLocaleExceptionMessage(severity,description));
exception->error_number=errno;
MagickFreeMemory(exception->module);
if (module)
exception->module=AcquireString(module);
MagickFreeMemory(exception->function);
if (function)
exception->function=AcquireString(function);
exception->line=line;
if (exception->reason)
{
if (exception->description)
(void) LogMagickEvent(severity,module,function,line,"%.1024s (%.1024s)",
exception->reason,exception->description );
else
(void) LogMagickEvent(severity,module,function,line,"%.1024s",
exception->reason);
}
else
{
(void) LogMagickEvent(severity,module,function,line,
"exception contains no reason!");
}
return;
}
示例14: CopyException
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% C o p y E x c e p t i o n %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% CopyException() copies exception data from one ExceptionInfo structure
% to another.
%
% The format of the CopyException method is:
%
% void CopyException(ExceptionInfo *copy, const ExceptionInfo *original)
%
% A description of each parameter follows:
%
% o copy: The exception to copy to.
%
% o original: The exception to copy from.
%
*/
MagickExport void CopyException(ExceptionInfo *copy, const ExceptionInfo *original)
{
assert(copy != (ExceptionInfo *) NULL);
assert(copy->signature == MagickSignature);
assert(original != (ExceptionInfo *) NULL);
assert(original->signature == MagickSignature);
copy->severity=original->severity;
MagickFreeMemory(copy->reason);
if (original->reason)
copy->reason=AcquireString(original->reason);
MagickFreeMemory(copy->description);
if (original->description)
copy->description=AcquireString(original->description);
copy->error_number=original->error_number;
MagickFreeMemory(copy->module);
if (original->module)
copy->module=AcquireString(original->module);
MagickFreeMemory(copy->function);
if (original->function)
copy->function=AcquireString(original->function);
copy->line=original->line;
return;
}
示例15: HHVM_METHOD
static bool HHVM_METHOD(ImagickDraw, setResolution,
double x, double y) {
auto wand = getDrawingWandResource(Object{this_});
std::ostringstream density;
density << x << "x" << y;
auto drawInfo = PeekDrawingWand(wand->getWand());
drawInfo->density = AcquireString(density.str().c_str());
auto drawWand = DrawAllocateWand(drawInfo, nullptr);
if (drawWand == nullptr) {
IMAGICKDRAW_THROW("Failed to allocate new DrawingWand structure");
}
setWandResource(s_ImagickDraw, Object{this_}, drawWand);
return true;
}