GLOBAL(void)
jpeg_CreateCompress(j_compress_ptr cinfo, int version, size_t structsize)
{ int i;
/* Guard against version mismatches between library and caller. */
cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ if (version != JPEG_LIB_VERSION)
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); if (structsize != sizeof(struct jpeg_compress_struct))
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
(int)sizeof(struct jpeg_compress_struct), (int)structsize);
/* For debugging purposes, we zero the whole master structure. *Buttheapplicationhasalreadysettheerrpointer,andmayhaveset *client_data,sowehavetosaveandrestorethosefields. *Note:ifapplicationhasn'tsetclient_data,toolslikePurifymay *complainhere.
*/
{ struct jpeg_error_mgr *err = cinfo->err; void *client_data = cinfo->client_data; /* ignore Purify complaint here */
memset(cinfo, 0, sizeof(struct jpeg_compress_struct));
cinfo->err = err;
cinfo->client_data = client_data;
}
cinfo->is_decompressor = FALSE;
/* Initialize a memory manager instance for this object */
jinit_memory_mgr((j_common_ptr)cinfo);
/* Zero out pointers to permanent structures. */
cinfo->progress = NULL;
cinfo->dest = NULL;
cinfo->comp_info = NULL;
for (i = 0; i < NUM_QUANT_TBLS; i++) {
cinfo->quant_tbl_ptrs[i] = NULL; #if JPEG_LIB_VERSION >= 70
cinfo->q_scale_factor[i] = 100; #endif
}
for (i = 0; i < NUM_HUFF_TBLS; i++) {
cinfo->dc_huff_tbl_ptrs[i] = NULL;
cinfo->ac_huff_tbl_ptrs[i] = NULL;
}
#if JPEG_LIB_VERSION >= 80 /* Must do it here for emit_dqt in case jpeg_write_tables is used */
cinfo->block_size = DCTSIZE;
cinfo->natural_order = jpeg_natural_order;
cinfo->lim_Se = DCTSIZE2 - 1; #endif
cinfo->script_space = NULL;
cinfo->input_gamma = 1.0; /* in case application forgets */
/* The master struct is used to store extension parameters, so we allocate it *here.
*/
cinfo->master = (struct jpeg_comp_master *)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT, sizeof(my_comp_master));
memset(cinfo->master, 0, sizeof(my_comp_master));
}
/* *DestructionofaJPEGcompressionobject
*/
GLOBAL(void)
jpeg_destroy_compress(j_compress_ptr cinfo)
{
jpeg_destroy((j_common_ptr)cinfo); /* use common routine */
}
/* (Re)initialize error mgr and destination modules */
(*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo);
(*cinfo->dest->init_destination) (cinfo); /* Initialize the marker writer ... bit of a crock to do it here. */
jinit_marker_writer(cinfo); /* Write them tables! */
(*cinfo->marker->write_tables_only) (cinfo); /* And clean up. */
(*cinfo->dest->term_destination) (cinfo); /* *Inlibraryreleasesupthroughv6a,wecalledjpeg_abort()heretofree *anyworkingmemoryallocatedbythedestinationmanagerandmarker *writer.Someapplicationshadaproblemwiththat:theyallocatedspace *oftheirownfromthelibrarymemorymanager,anddidn'twantittogo *awayduringwrite_tables.Sonowwedonothing.Thiswillcausea *memoryleakifanappcallswrite_tablesrepeatedlywithoutdoingafull *compressioncycleorotherwiseresettingtheJPEGobject.However,that *seemslessbadthanunexpectedlyfreeingmemoryinthenormalcase. *Anappthatpreferstheoldbehaviorcancalljpeg_abortforitselfafter *eachcalltojpeg_write_tables().
*/
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.