Alien-FreeImage
view release on metacpan or search on metacpan
src/Source/LibJPEG/jcarith.c view on Meta::CPAN
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
}
e->c &= 0x7FFFFL;
e->ct += 8;
}
} while (e->a < 0x8000L);
}
/*
* Emit a restart marker & resynchronize predictions.
*/
LOCAL(void)
emit_restart (j_compress_ptr cinfo, int restart_num)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
int ci;
jpeg_component_info * compptr;
finish_pass(cinfo);
src/Source/LibJPEG/jchuff.c view on Meta::CPAN
entropy->EOBRUN = 0;
/* Emit any buffered correction bits */
emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);
entropy->BE = 0;
}
}
/*
* Emit a restart marker & resynchronize predictions.
*/
LOCAL(boolean)
emit_restart_s (working_state * state, int restart_num)
{
int ci;
if (! flush_bits_s(state))
return FALSE;
src/Source/LibJPEG/jdarith.c view on Meta::CPAN
} else {
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
}
}
return sv >> 7;
}
/*
* Check for a restart marker & resynchronize decoder.
*/
LOCAL(void)
process_restart (j_decompress_ptr cinfo)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
int ci;
jpeg_component_info * compptr;
/* Advance past the RSTn marker */
src/Source/LibJPEG/jdhuff.c view on Meta::CPAN
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
/* Throw away any unused bits remaining in bit buffer; */
/* include any full bytes in next_marker's count of discarded bytes */
cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
entropy->bitstate.bits_left = 0;
}
/*
* Check for a restart marker & resynchronize decoder.
* Returns FALSE if must suspend.
*/
LOCAL(boolean)
process_restart (j_decompress_ptr cinfo)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int ci;
finish_pass_huff(cinfo);
src/Source/LibJPEG/usage.txt view on Meta::CPAN
-maxmemory N Set limit for amount of memory to use in processing
large images. Value is in thousands of bytes, or
millions of bytes if "M" is attached to the number.
For example, -max 4m selects 4000000 bytes. If more
space is needed, temporary files will be used.
-verbose Enable debug printout. More -v's give more printout.
or -debug Also, version information is printed at startup.
The -restart option inserts extra markers that allow a JPEG decoder to
resynchronize after a transmission error. Without restart markers, any damage
to a compressed file will usually ruin the image from the point of the error
to the end of the image; with restart markers, the damage is usually confined
to the portion of the image up to the next restart marker. Of course, the
restart markers occupy extra space. We recommend -restart 1 for images that
will be transmitted across unreliable networks such as Usenet.
The -smooth option filters the input to eliminate fine-scale noise. This is
often useful when converting dithered images to JPEG: a moderate smoothing
factor of 10 to 50 gets rid of dithering patterns in the input file, resulting
in a smaller JPEG file and a better-looking image. Too large a smoothing
src/Source/LibPNG/pngpriv.h view on Meta::CPAN
* profile.
*/
PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr,
png_inforp info_ptr), PNG_EMPTY);
/* Synchronize the info 'valid' flags with the colorspace */
PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr,
png_inforp info_ptr), PNG_EMPTY);
/* Copy the png_struct colorspace to the info_struct and call the above to
* synchronize the flags. Checks for NULL info_ptr and does nothing.
*/
#endif
/* Added at libpng version 1.4.0 */
#ifdef PNG_COLORSPACE_SUPPORTED
/* These internal functions are for maintaining the colorspace structure within
* a png_info or png_struct (or, indeed, both).
*/
PNG_INTERNAL_FUNCTION(int,png_colorspace_set_chromaticities,
(png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy,
src/Source/LibTIFF4/tif_luv.c view on Meta::CPAN
}
}
(*sp->tfunc)(sp, op, npixels);
tif->tif_rawcp = (uint8*) bp;
tif->tif_rawcc = cc;
return (1);
}
/*
* Decode a strip of pixels. We break it into rows to
* maintain synchrony with the encode algorithm, which
* is row by row.
*/
static int
LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFScanlineSize(tif);
assert(cc%rowlen == 0);
while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s))
bp += rowlen, cc -= rowlen;
return (cc == 0);
}
/*
* Decode a tile of pixels. We break it into rows to
* maintain synchrony with the encode algorithm, which
* is row by row.
*/
static int
LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFTileRowSize(tif);
assert(cc%rowlen == 0);
while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s))
bp += rowlen, cc -= rowlen;
src/Source/OpenEXR/IlmThread/IlmThreadPool.h view on Meta::CPAN
// class Task, class ThreadPool, class TaskGroup
//
// Class ThreadPool manages a set of worker threads and accepts
// tasks for processing. Tasks added to the thread pool are
// executed concurrently by the worker threads.
//
// Class Task provides an abstract interface for a task which
// a ThreadPool works on. Derived classes need to implement the
// execute() function which performs the actual task.
//
// Class TaskGroup allows synchronization on the completion of a set
// of tasks. Every task that is added to a ThreadPool belongs to a
// single TaskGroup. The destructor of the TaskGroup waits for all
// tasks in the group to finish.
//
// Note: if you plan to use the ThreadPool interface in your own
// applications note that the implementation of the ThreadPool calls
// operator delete on tasks as they complete. If you define a custom
// operator new for your tasks, for instance to use a custom heap,
// then you must also write an appropriate operator delete.
//
src/Source/ZLib/inflate.h view on Meta::CPAN
LENEXT, /* i: waiting for length extra bits */
DIST, /* i: waiting for distance code */
DISTEXT, /* i: waiting for distance extra bits */
MATCH, /* o: waiting for output space to copy string */
LIT, /* o: waiting for output space to write literal */
CHECK, /* i: waiting for 32-bit check value */
LENGTH, /* i: waiting for 32-bit length (gzip) */
DONE, /* finished check, done -- remain here until reset */
BAD, /* got a data error -- remain here until reset */
MEM, /* got an inflate() memory error -- remain here until reset */
SYNC /* looking for synchronization bytes to restart inflate() */
} inflate_mode;
/*
State transitions between above modes -
(most modes can go to BAD or MEM on error -- not shown for clarity)
Process header:
HEAD -> (gzip) or (zlib) or (raw)
(gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
( run in 0.393 second using v1.01-cache-2.11-cpan-0d8aa00de5b )