view release on metacpan or search on metacpan
src/Source/LibJPEG/wrtarga.c
src/Source/LibJXR/common/include/guiddef.h
src/Source/LibJXR/common/include/wmsal.h
src/Source/LibJXR/common/include/wmspecstring.h
src/Source/LibJXR/common/include/wmspecstrings_adt.h
src/Source/LibJXR/common/include/wmspecstrings_strict.h
src/Source/LibJXR/common/include/wmspecstrings_undef.h
src/Source/LibJXR/image/decode/decode.c
src/Source/LibJXR/image/decode/decode.h
src/Source/LibJXR/image/decode/JXRTranscode.c
src/Source/LibJXR/image/decode/postprocess.c
src/Source/LibJXR/image/decode/segdec.c
src/Source/LibJXR/image/decode/strdec.c
src/Source/LibJXR/image/decode/strdec_x86.c
src/Source/LibJXR/image/decode/strInvTransform.c
src/Source/LibJXR/image/decode/strPredQuantDec.c
src/Source/LibJXR/image/encode/encode.c
src/Source/LibJXR/image/encode/encode.h
src/Source/LibJXR/image/encode/segenc.c
src/Source/LibJXR/image/encode/strenc.c
src/Source/LibJXR/image/encode/strenc_x86.c
src/Source/LibRawLite/DEVELOPER-NOTES
src/Source/LibRawLite/internal/aahd_demosaic.cpp
src/Source/LibRawLite/internal/dcb_demosaicing.c
src/Source/LibRawLite/internal/dcraw_common.cpp
src/Source/LibRawLite/internal/dcraw_fileio.cpp
src/Source/LibRawLite/internal/defines.h
src/Source/LibRawLite/internal/demosaic_packs.cpp
src/Source/LibRawLite/internal/dht_demosaic.cpp
src/Source/LibRawLite/internal/libraw_internal_funcs.h
src/Source/LibRawLite/internal/libraw_x3f.cpp
src/Source/LibRawLite/internal/preprocess.pl
src/Source/LibRawLite/internal/var_defines.h
src/Source/LibRawLite/internal/wf_filtering.cpp
src/Source/LibRawLite/libraw/libraw.h
src/Source/LibRawLite/libraw/libraw_alloc.h
src/Source/LibRawLite/libraw/libraw_const.h
src/Source/LibRawLite/libraw/libraw_datastream.h
src/Source/LibRawLite/libraw/libraw_internal.h
src/Source/LibRawLite/libraw/libraw_types.h
src/Source/LibRawLite/libraw/libraw_version.h
src/Source/LibRawLite/LibRawLite.2005.vcproj
src/Source/LibWebP/src/dec/dec.quant.c
src/Source/LibWebP/src/dec/dec.tree.c
src/Source/LibWebP/src/dec/dec.vp8.c
src/Source/LibWebP/src/dec/dec.vp8l.c
src/Source/LibWebP/src/dec/dec.webp.c
src/Source/LibWebP/src/dec/decode_vp8.h
src/Source/LibWebP/src/dec/vp8i.h
src/Source/LibWebP/src/dec/vp8li.h
src/Source/LibWebP/src/dec/webpi.h
src/Source/LibWebP/src/demux/demux.demux.c
src/Source/LibWebP/src/dsp/dsp.alpha_processing.c
src/Source/LibWebP/src/dsp/dsp.alpha_processing_mips_dsp_r2.c
src/Source/LibWebP/src/dsp/dsp.alpha_processing_sse2.c
src/Source/LibWebP/src/dsp/dsp.argb.c
src/Source/LibWebP/src/dsp/dsp.argb_mips_dsp_r2.c
src/Source/LibWebP/src/dsp/dsp.argb_sse2.c
src/Source/LibWebP/src/dsp/dsp.cost.c
src/Source/LibWebP/src/dsp/dsp.cost_mips32.c
src/Source/LibWebP/src/dsp/dsp.cost_mips_dsp_r2.c
src/Source/LibWebP/src/dsp/dsp.cost_sse2.c
src/Source/LibWebP/src/dsp/dsp.cpu.c
src/Source/LibWebP/src/dsp/dsp.dec.c
src/Source/LibWebP/src/dsp/dsp.dec_clip_tables.c
src/Makefile.srcs view on Meta::CPAN
VER_MAJOR = 3
VER_MINOR = 17.0
SRCS = ./Source/FreeImage/BitmapAccess.cpp ./Source/FreeImage/ColorLookup.cpp ./Source/FreeImage/FreeImage.cpp ./Source/FreeImage/FreeImageC.c ./Source/FreeImage/FreeImageIO.cpp ./Source/FreeImage/GetType.cpp ./Source/FreeImage/MemoryIO.cpp ./Source/...
INCLS = ./Examples/OpenGL/TextureManager/TextureManager.h ./Examples/Plugin/PluginCradle.h ./Examples/Generic/FIIO_Mem.h ./Source/MapIntrospector.h ./Source/FreeImage - Copie.h ./Source/CacheFile.h ./Source/LibTIFF/tiffconf.vc.h ./Source/LibTIFF/tif_...
INCLUDE = -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/Open...
src/README.linux view on Meta::CPAN
for RedHat 7.3 or 9.
Please let me know how this works for you under other Linux distributions or any other *nix.
Herve Drolon
FreeImage Project Manager
Installation
------------
Note: You will need to have root privileges in order to install the library in the /usr/lib directory.
The installation process is as simple as this :
1) Enter the FreeImage directory
2) Build the distribution :
make
make install
3) Clean all files produced during the build process
make clean
Compiling FreeImagePlus
-----------------------
FreeImagePlus is a C++ wrapper for FreeImage.
To compile FreeImage as a C++ library, follow these steps :
1) Enter the FreeImage directory
2) Build the distribution :
make -f Makefile.fip
make -f Makefile.fip install
3) Clean all files produced during the build process
make -f Makefile.fip clean
src/README.minGW view on Meta::CPAN
2. MinGW GNU Binutils Version 2.19.1
3. MinGW GNU Make Version 3.81-20080326-3
4. MinGW Runtime Version 3.15.2
5. MinGW API for MS-Windows Version 3.13
6. GnuWin32 Package CoreUtils Version 5.3.0 (only for building)
7. GnuWin32 Package Sed Version 4.2 (only for creating the GCC
import library)*
* Sed is only needed to create a GCC-native import library from
the MSVC import library FreeImage.lib. However, since MinGW now
supports linking against MSVC lib files, this process seems to
be obsolete. See section 1.
Basically, no version dependent capabilities are used so, this
should also work with older versions of the tools mentioned above.
Similarly, the GnuWin32 packages (which I just prefer over MSYS)
could likely be replaced by a properly installed MSYS environment.
Furthermore, the following preconditions should be met:
1. The folders 'bin' under both the MinGW and the GnuWin32
src/README.minGW view on Meta::CPAN
libjpeg, libpng, libtiff, libmng and zlib and others) installed on
your system in order to compile and use the library. FreeImage uses
its own versions of these libraries. This way, you can be sure that
FreeImage will always use the latest and properly tested versions
of of these third party libraries.
In order to build the FreeImage library under Windows with MinGW
(GCC), ensure that all the prerequisites mentioned above are met.
The MinGW makefile aims to build a Windows DLL, that differs as
least as possible from the precompiled library that comes with the
FreeImage distribution. Thus, the build process also includes the
DLL version resource as well as the __stdcall attribute for all the
exported functions, including the MSVC-like function decorations
_FuncName@nn.
When building the FreeImage DLL, of course, an import library is
generated, too. However, this input library is not in GCC's native
format, but in MSVC lib format, which makes it usable from both
MinGW and Microsoft Visual Studio with no further processing.
The MinGW makefile can also be used to build a static library.
However, due to the different function export attributes needed
for both the dynamic and the shared library (DLL), this requires
a separate invocation of make, which in turn needs to rebuild every
source file after switching from dynamic to static and vice versa.
So, a 'make clean' is required each time, the library type is
changed.
The type of library to build is specified by a variable named
src/README.minGW view on Meta::CPAN
added to the PATH environment variable (see Prerequisites).
3.) Create the FreeImage dynamic link library (DLL):
C:\>make
4.) Install the FreeImage dynamic link library (DLL):
C:\>make install
5.) Clean all files produced by the recent build process:
C:\>make clean
6.) Create a static FreeImage library:
C:\>set FREEIMAGE_LIBRARY_TYPE=STATIC
C:\>make
You should be able to link progams with the -lFreeImage option
after the shared library is compiled and installed. You can also
src/README.osx view on Meta::CPAN
internal third party libraries and the OS libraries. This feature is available with gcc 4 or greater.
Ryan Rubley
Building the Library
--------------------
Makefile detects the environment by calling 'uname'. Assuming this reports 'Darwin' on your system, Makefile will automatically
defer commands to Makefile.osx. If this doesn't work, type 'make -f Makefile.osx' in place of just 'make'
The build process is as simple as this:
1) Enter the FreeImage directory
2) Build the distribution:
make
3) The libraries and header will be in the Dist directory when the build is finished
To install FreeImage in the /usr/local/lib and /usr/local/include directories (not recommended):
make install
To clean all files produced during the build process:
make clean
Additional notes
----------------
Building on Mac OS X Leopard :
Install the xcode dev tools from the Leopard disk.
When installing the dev tools make sure to have installed 10.3.9 SDK (it's not selected by default).
src/README.solaris view on Meta::CPAN
Release Notes
--------------
Hey folks,
I just went through the process of building and using the freeimage library
on Solaris 9. Things don't work out of the box so I thought I would share my
experiences in case someone else wants to do the same.
I'm using Solaris 9, and I have installed all the development libraries, make,
and the gcc 3.3.2 found on sunfreeware.com.
You have to use the make from sunfreeware because the Solaris 9 make program
chokes hard on FreeImages makefiles.
First thing I had to do was modify the main FreeImage makefile:
src/README.solaris view on Meta::CPAN
I hope this helps someone!
---
ogtharox at users.sourceforge.net
Installation
------------
Note: You will need to have root privileges in order to install the library in the /usr/local/lib directory.
The installation process is as simple as this :
1) Enter the FreeImage directory
2) Build the distribution :
make -f Makefile.solaris
make -f Makefile.solaris install
3) Clean all files produced during the build process
make -f Makefile.solaris clean
Release Notes for Solaris/Sparc
--------------------------------
Under Solaris/Sparc, you will need to modify the following line :
COMPILERFLAGS = -O3
modified into
COMPILERFLAGS = -O3 -DBYTE_ORDER=BIG_ENDIAN -D__BIG_ENDIAN__
src/Source/FreeImage.h view on Meta::CPAN
DLL_API BOOL DLL_CALLCONV FreeImage_AdjustContrast(FIBITMAP *dib, double percentage);
DLL_API BOOL DLL_CALLCONV FreeImage_Invert(FIBITMAP *dib);
DLL_API BOOL DLL_CALLCONV FreeImage_GetHistogram(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel FI_DEFAULT(FICC_BLACK));
DLL_API int DLL_CALLCONV FreeImage_GetAdjustColorsLookupTable(BYTE *LUT, double brightness, double contrast, double gamma, BOOL invert);
DLL_API BOOL DLL_CALLCONV FreeImage_AdjustColors(FIBITMAP *dib, double brightness, double contrast, double gamma, BOOL invert FI_DEFAULT(FALSE));
DLL_API unsigned DLL_CALLCONV FreeImage_ApplyColorMapping(FIBITMAP *dib, RGBQUAD *srccolors, RGBQUAD *dstcolors, unsigned count, BOOL ignore_alpha, BOOL swap);
DLL_API unsigned DLL_CALLCONV FreeImage_SwapColors(FIBITMAP *dib, RGBQUAD *color_a, RGBQUAD *color_b, BOOL ignore_alpha);
DLL_API unsigned DLL_CALLCONV FreeImage_ApplyPaletteIndexMapping(FIBITMAP *dib, BYTE *srcindices, BYTE *dstindices, unsigned count, BOOL swap);
DLL_API unsigned DLL_CALLCONV FreeImage_SwapPaletteIndices(FIBITMAP *dib, BYTE *index_a, BYTE *index_b);
// channel processing routines
DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetChannel(FIBITMAP *dib, FREE_IMAGE_COLOR_CHANNEL channel);
DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
DLL_API BOOL DLL_CALLCONV FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel);
// copy / paste / composite routines
DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Copy(FIBITMAP *dib, int left, int top, int right, int bottom);
DLL_API BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha);
DLL_API FIBITMAP *DLL_CALLCONV FreeImage_CreateView(FIBITMAP *dib, unsigned left, unsigned top, unsigned right, unsigned bottom);
src/Source/FreeImage/BitmapAccess.cpp view on Meta::CPAN
bih->biHeight = height;
bih->biPlanes = 1;
bih->biCompression = need_masks ? BI_BITFIELDS : BI_RGB;
bih->biBitCount = (WORD)bpp;
bih->biClrUsed = CalculateUsedPaletteEntries(bpp);
bih->biClrImportant = bih->biClrUsed;
bih->biXPelsPerMeter = 2835; // 72 dpi
bih->biYPelsPerMeter = 2835; // 72 dpi
if(bpp == 8) {
// build a default greyscale palette (very useful for image processing)
RGBQUAD *pal = FreeImage_GetPalette(bitmap);
for(int i = 0; i < 256; i++) {
pal[i].rgbRed = (BYTE)i;
pal[i].rgbGreen = (BYTE)i;
pal[i].rgbBlue = (BYTE)i;
}
}
// just setting the masks (only if needed) just like the palette.
if (need_masks) {
src/Source/FreeImage/Conversion4.cpp view on Meta::CPAN
const int height = FreeImage_GetHeight(dib);
FIBITMAP *new_dib = FreeImage_Allocate(width, height, 4);
if(new_dib == NULL) {
return NULL;
}
// copy metadata from src to dst
FreeImage_CloneMetadata(new_dib, dib);
// Build a greyscale palette (*always* needed for image processing)
RGBQUAD *new_pal = FreeImage_GetPalette(new_dib);
for(int i = 0; i < 16; i++) {
new_pal[i].rgbRed = (BYTE)((i << 4) + i);
new_pal[i].rgbGreen = (BYTE)((i << 4) + i);
new_pal[i].rgbBlue = (BYTE)((i << 4) + i);
}
switch(bpp) {
src/Source/FreeImage/LFPQuantizer.cpp view on Meta::CPAN
unsigned last_color = -1;
int last_index = 0;
if (FreeImage_GetBPP(dib) == 24) {
// Getting the source pixel as an unsigned int is much faster than
// working with FI_RGBA_xxx and shifting. However, this may fail
// for the very last pixel, since its rgbReserved member (alpha)
// may actually point to an address beyond the bitmap's memory. So,
// we do not process the last scanline in the first loop.
// Process all but the last scanline.
for (unsigned y = 0; y < height - 1; ++y) {
BYTE *dst_line = dst_bits + y * dst_pitch;
const BYTE *src_line = src_bits + y * src_pitch;
for (unsigned x = 0; x < width; ++x) {
const unsigned color = *((unsigned *) src_line) & 0x00FFFFFF;
if (color != last_color) {
last_color = color;
last_index = GetIndexForColor(color);
src/Source/FreeImage/NNQuantizer.cpp view on Meta::CPAN
// and/or sell copies of the Software, and to permit persons who receive
// copies from any such party to do so, with the only requirement being
// that this copyright notice remain intact.
///////////////////////////////////////////////////////////////////////
// History
// -------
// January 2001: Adaptation of the Neural-Net Quantization Algorithm
// for the FreeImage 2 library
// Author: Hervé Drolon (drolon@infonie.fr)
// March 2004: Adaptation for the FreeImage 3 library (port to big endian processors)
// Author: Hervé Drolon (drolon@infonie.fr)
// April 2004: Algorithm rewritten as a C++ class.
// Fixed a bug in the algorithm with handling of 4-byte boundary alignment.
// Author: Hervé Drolon (drolon@infonie.fr)
///////////////////////////////////////////////////////////////////////
#include "Quantizers.h"
#include "FreeImage.h"
#include "Utilities.h"
src/Source/FreeImage/PSDParser.cpp view on Meta::CPAN
break;
case 3: // ZIP with prediction, no specification
break;
default: // Unknown format
break;
}
// --- Further process the bitmap ---
if((mode == PSDP_CMYK || mode == PSDP_MULTICHANNEL)) {
// CMYK values are "inverted", invert them back
if(mode == PSDP_MULTICHANNEL) {
invertColor(bitmap);
} else {
FreeImage_Invert(bitmap);
}
src/Source/FreeImage/PluginJXR.cpp view on Meta::CPAN
// free the local buffer
PKFreeAligned((void **) &pb);
// free the pixel format converter
PKFormatConverter_Release(&pConverter);
}
// FreeImage DIB are upside-down relative to usual graphic conventions
FreeImage_FlipVertical(dib);
// post-processing ...
// -------------------
// swap RGB as needed
#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR
if(IsEqualGUID(out_guid_format, GUID_PKPixelFormat24bppRGB) || IsEqualGUID(out_guid_format, GUID_PKPixelFormat32bppRGB)) {
SwapRedBlue32(dib);
}
#elif FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB
if(IsEqualGUID(out_guid_format, GUID_PKPixelFormat24bppBGR) || IsEqualGUID(out_guid_format, GUID_PKPixelFormat32bppBGR)) {
src/Source/FreeImage/PluginJXR.cpp view on Meta::CPAN
static void
SetEncoderParameters(CWMIStrCodecParam *wmiSCP, const PKPixelInfo *pixelInfo, int flags, BOOL bHasAlpha) {
float fltImageQuality = 1.0F;
// all values have been set to zero by the API
// update default values for some attributes
wmiSCP->cfColorFormat = YUV_444; // color format
wmiSCP->bdBitDepth = BD_LONG; // internal bit depth
wmiSCP->bfBitstreamFormat = SPATIAL; // compressed image data in spatial order
wmiSCP->bProgressiveMode = FALSE; // sequential mode
wmiSCP->olOverlap = OL_ONE; // single level overlap processing
wmiSCP->cNumOfSliceMinus1H = 0; // # of horizontal slices
wmiSCP->cNumOfSliceMinus1V = 0; // # of vertical slices
wmiSCP->sbSubband = SB_ALL; // keep all subbands
wmiSCP->uAlphaMode = 0; // 0:no alpha 1: alpha only else: something + alpha
wmiSCP->uiDefaultQPIndex = 1; // quantization for grey or rgb layer(s), 1: lossless
wmiSCP->uiDefaultQPIndexAlpha = 1; // quantization for alpha layer, 1: lossless
// process the flags
// -----------------
// progressive mode
if((flags & JXR_PROGRESSIVE) == JXR_PROGRESSIVE) {
// turn on progressive mode (instead of sequential mode)
wmiSCP->bProgressiveMode = TRUE;
}
// quality in [0.01 - 1.0), 1.0 means lossless - default is 0.80
int quality = flags & 0x7F;
src/Source/FreeImage/PluginPCX.cpp view on Meta::CPAN
static const char * DLL_CALLCONV
Extension() {
return "pcx";
}
/*!
Returns an (optional) regular expression to help
software identifying a bitmap type. The
expression can be applied to the first few bytes (header) of
the bitmap. FreeImage is not capable of processing regular expression itself,
but FreeImageQt, the FreeImage Trolltech support library, can. If RegExpr
returns NULL, FreeImageQt will automatically bypass Trolltech's regular
expression support and use its internal functions to find the bitmap type.
*/
static const char * DLL_CALLCONV
RegExpr() {
return NULL;
}
src/Source/FreeImage/PluginPCX.cpp view on Meta::CPAN
try {
// check PCX identifier
long start_pos = io->tell_proc(handle);
BOOL validated = pcx_validate(io, handle);
io->seek_proc(handle, start_pos, SEEK_SET);
if(!validated) {
throw FI_MSG_ERROR_MAGIC_NUMBER;
}
// process the header
PCXHEADER header;
if(io->read_proc(&header, sizeof(PCXHEADER), 1, handle) != 1) {
throw FI_MSG_ERROR_PARSING;
}
#ifdef FREEIMAGE_BIGENDIAN
SwapHeader(&header);
#endif
src/Source/FreeImage/PluginRAS.cpp view on Meta::CPAN
rle = FALSE;
isRGB = FALSE;
switch(header.type) {
case RT_OLD:
case RT_STANDARD:
case RT_FORMAT_TIFF: // I don't even know what these format are...
case RT_FORMAT_IFF: //The TIFF and IFF format types indicate that the raster
//file was originally converted from either of these file formats.
//so lets at least try to process them as RT_STANDARD
break;
case RT_BYTE_ENCODED:
rle = TRUE;
break;
case RT_FORMAT_RGB:
isRGB = TRUE;
break;
src/Source/FreeImage/PluginRAW.cpp view on Meta::CPAN
}
void * make_jas_stream() {
return NULL;
}
};
// ----------------------------------------------------------
/**
Convert a processed raw data array to a FIBITMAP
@param RawProcessor LibRaw handle containing the processed raw image
@return Returns the converted dib if successfull, returns NULL otherwise
*/
static FIBITMAP *
libraw_ConvertProcessedRawToDib(LibRaw *RawProcessor) {
FIBITMAP *dib = NULL;
int width, height, colors, bpp;
try {
int bgr = 0; // pixel copy order: RGB if (bgr == 0) and BGR otherwise
src/Source/FreeImage/PluginRAW.cpp view on Meta::CPAN
bgr = 1; // only useful for FIT_BITMAP types
#endif
// allocate output dib
dib = FreeImage_AllocateT(FIT_BITMAP, width, height, 24);
if(!dib) {
throw FI_MSG_ERROR_DIB_MEMORY;
}
}
// copy post-processed bitmap data into FIBITMAP buffer
if(RawProcessor->copy_mem_image(FreeImage_GetBits(dib), FreeImage_GetPitch(dib), bgr) != LIBRAW_SUCCESS) {
throw "LibRaw : failed to copy data into dib";
}
// flip vertically
FreeImage_FlipVertical(dib);
return dib;
} catch(const char *text) {
FreeImage_Unload(dib);
FreeImage_OutputMessageProc(s_format_id, text);
return NULL;
}
}
/**
Convert a processed raw image to a FIBITMAP
@param image Processed raw image
@return Returns the converted dib if successfull, returns NULL otherwise
@see libraw_LoadEmbeddedPreview
*/
static FIBITMAP *
libraw_ConvertProcessedImageToDib(libraw_processed_image_t *image) {
FIBITMAP *dib = NULL;
try {
unsigned width = image->width;
unsigned height = image->height;
unsigned bpp = image->bits;
if(bpp == 16) {
// allocate output dib
dib = FreeImage_AllocateT(FIT_RGB16, width, height);
if(!dib) {
src/Source/FreeImage/PluginRAW.cpp view on Meta::CPAN
/**
Get the embedded JPEG preview image from RAW picture with included Exif Data.
@param RawProcessor Libraw handle
@param flags JPEG load flags
@return Returns the loaded dib if successfull, returns NULL otherwise
*/
static FIBITMAP *
libraw_LoadEmbeddedPreview(LibRaw *RawProcessor, int flags) {
FIBITMAP *dib = NULL;
libraw_processed_image_t *thumb_image = NULL;
try {
// unpack data
if(RawProcessor->unpack_thumb() != LIBRAW_SUCCESS) {
// run silently "LibRaw : failed to run unpack_thumb"
return NULL;
}
// retrieve thumb image
int error_code = 0;
src/Source/FreeImage/PluginRAW.cpp view on Meta::CPAN
FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeFromMemory(hmem, 0);
if(fif == FIF_JPEG) {
// rotate according to Exif orientation
flags |= JPEG_EXIFROTATE;
}
// load an image from the memory stream
dib = FreeImage_LoadFromMemory(fif, hmem, flags);
// close the stream
FreeImage_CloseMemory(hmem);
} else if((flags & FIF_LOAD_NOPIXELS) != FIF_LOAD_NOPIXELS) {
// convert processed data to output dib
dib = libraw_ConvertProcessedImageToDib(thumb_image);
}
} else {
throw "LibRaw : failed to run dcraw_make_mem_thumb";
}
// clean-up and return
RawProcessor->dcraw_clear_mem(thumb_image);
return dib;
src/Source/FreeImage/PluginRAW.cpp view on Meta::CPAN
// (-q 3) Adaptive homogeneity-directed demosaicing algorithm (AHD)
RawProcessor->imgdata.params.user_qual = 3;
// -----------------------
// unpack data
if(RawProcessor->unpack() != LIBRAW_SUCCESS) {
throw "LibRaw : failed to unpack data";
}
// process data (... most consuming task ...)
if(RawProcessor->dcraw_process() != LIBRAW_SUCCESS) {
throw "LibRaw : failed to process data";
}
// retrieve processed image
dib = libraw_ConvertProcessedRawToDib(RawProcessor);
return dib;
} catch(const char *text) {
FreeImage_OutputMessageProc(s_format_id, text);
return NULL;
}
}
/**
Load the Bayer matrix (unprocessed raw data) as a FIT_UINT16 image.
Note that some formats don't have a Bayer matrix (e.g. Foveon, Canon sRAW, demosaiced DNG files).
@param RawProcessor Libraw handle
@return Returns the loaded dib if successfull, returns NULL otherwise
*/
static FIBITMAP *
libraw_LoadUnprocessedData(LibRaw *RawProcessor) {
FIBITMAP *dib = NULL;
try {
// unpack data
if(RawProcessor->unpack() != LIBRAW_SUCCESS) {
throw "LibRaw : failed to unpack data";
}
// check for a supported Bayer format
if(!(RawProcessor->imgdata.idata.filters || RawProcessor->imgdata.idata.colors == 1)) {
src/Source/FreeImage/PluginRAW.cpp view on Meta::CPAN
throw FI_MSG_ERROR_DIB_MEMORY;
}
// retrieve the raw image
for(unsigned y = 0; y < height; y++) {
WORD *dst_bits = (WORD*)FreeImage_GetScanLine(dib, height - 1 - y);
memcpy(dst_bits, src_bits, line_size);
src_bits += width;
}
// store metadata needed for post-processing
{
char value[512];
const libraw_image_sizes_t *sizes = &RawProcessor->imgdata.sizes;
// image output width & height
{
sprintf(value, "%d", sizes->iwidth);
FreeImage_SetMetadataKeyValue(FIMD_COMMENTS, dib, "Raw.Output.Width", value);
src/Source/FreeImage/PluginRAW.cpp view on Meta::CPAN
// open the datastream
if(RawProcessor->open_datastream(&datastream) != LIBRAW_SUCCESS) {
throw "LibRaw : failed to open input stream (unknown format)";
}
if(header_only) {
// header only mode
dib = FreeImage_AllocateHeaderT(header_only, FIT_RGB16, RawProcessor->imgdata.sizes.width, RawProcessor->imgdata.sizes.height);
}
else if((flags & RAW_UNPROCESSED) == RAW_UNPROCESSED) {
// load raw data without post-processing (i.e. as a Bayer matrix)
dib = libraw_LoadUnprocessedData(RawProcessor);
}
else if((flags & RAW_PREVIEW) == RAW_PREVIEW) {
// try to get the embedded JPEG
dib = libraw_LoadEmbeddedPreview(RawProcessor, 0);
if(!dib) {
// no JPEG preview: try to load as 8-bit/sample (i.e. RGB 24-bit)
dib = libraw_LoadRawData(RawProcessor, 8);
}
}
else if((flags & RAW_DISPLAY) == RAW_DISPLAY) {
src/Source/FreeImage/PluginTARGA.cpp view on Meta::CPAN
const BOOL header_only = (flags & FIF_LOAD_NOPIXELS) == FIF_LOAD_NOPIXELS;
// remember the start offset
long start_offset = io->tell_proc(handle);
// remember end-of-file (used for RLE cache)
io->seek_proc(handle, 0, SEEK_END);
long eof = io->tell_proc(handle);
io->seek_proc(handle, start_offset, SEEK_SET);
// read and process the bitmap's footer
TargaThumbnail thumbnail;
if(isTARGA20(io, handle)) {
TGAFOOTER footer;
const long footer_offset = start_offset + eof - sizeof(footer);
io->seek_proc(handle, footer_offset, SEEK_SET);
io->read_proc(&footer, sizeof(tagTGAFOOTER), 1, handle);
#ifdef FREEIMAGE_BIGENDIAN
src/Source/FreeImage/PluginTARGA.cpp view on Meta::CPAN
DWORD postage_stamp_offset = extensionarea.postage_stamp_offset;
BOOL hasThumbnail = (postage_stamp_offset > 0) && (postage_stamp_offset < (DWORD)footer_offset);
if(hasThumbnail) {
io->seek_proc(handle, postage_stamp_offset, SEEK_SET);
thumbnail.read(io, handle, footer_offset - postage_stamp_offset);
}
}
}
// read and process the bitmap's header
TGAHEADER header;
io->seek_proc(handle, start_offset, SEEK_SET);
io->read_proc(&header, sizeof(tagTGAHEADER), 1, handle);
#ifdef FREEIMAGE_BIGENDIAN
SwapHeader(&header);
#endif
src/Source/FreeImage/WuQuantizer.cpp view on Meta::CPAN
//
// Free to distribute, comments and suggestions are appreciated.
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// History
// -------
// July 2000: C++ Implementation of Wu's Color Quantizer
// and adaptation for the FreeImage 2 Library
// Author: Hervé Drolon (drolon@infonie.fr)
// March 2004: Adaptation for the FreeImage 3 library (port to big endian processors)
// Author: Hervé Drolon (drolon@infonie.fr)
///////////////////////////////////////////////////////////////////////
#include "Quantizers.h"
#include "FreeImage.h"
#include "Utilities.h"
///////////////////////////////////////////////////////////////////////
// Size of a 3D array : 33 x 33 x 33
src/Source/FreeImageLib/FreeImageLib.2005.vcproj view on Meta::CPAN
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\;..\ZLib;..\DeprecationManager;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\image\sys;..\LibJXR\jxrgluelib"
PreprocessorDefinitions="WIN32;_DEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/FreeImageLib.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1043"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="Debug\FreeImaged.lib"
SuppressStartupBanner="true"
src/Source/FreeImageLib/FreeImageLib.2005.vcproj view on Meta::CPAN
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\;..\ZLib;..\DeprecationManager;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\image\sys;..\LibJXR\jxrgluelib"
PreprocessorDefinitions="WIN32;NDEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL"
StringPooling="true"
RuntimeLibrary="0"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/FreeImageLib.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="Release\FreeImage.lib"
SuppressStartupBanner="true"
src/Source/FreeImageLib/FreeImageLib.2005.vcproj view on Meta::CPAN
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\;..\ZLib;..\DeprecationManager;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread"
PreprocessorDefinitions="WIN32;_DEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/FreeImageLib.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1043"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="Debug\FreeImaged.lib"
SuppressStartupBanner="true"
src/Source/FreeImageLib/FreeImageLib.2005.vcproj view on Meta::CPAN
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\;..\ZLib;..\DeprecationManager;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread"
PreprocessorDefinitions="WIN32;NDEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL"
StringPooling="true"
RuntimeLibrary="0"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/FreeImageLib.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="Release\FreeImage.lib"
SuppressStartupBanner="true"
src/Source/FreeImageLib/FreeImageLib.2008.vcproj view on Meta::CPAN
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\;..\ZLib;..\DeprecationManager;..\OpenEXR;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\jxrgluelib;..\LibJXR\image\sys"
PreprocessorDefinitions="WIN32;_DEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/FreeImageLib.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1043"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="Debug\FreeImaged.lib"
SuppressStartupBanner="true"
src/Source/FreeImageLib/FreeImageLib.2008.vcproj view on Meta::CPAN
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\;..\ZLib;..\DeprecationManager;..\OpenEXR;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\jxrgluelib;..\LibJXR\image\sys"
PreprocessorDefinitions="WIN32;_DEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
OpenMP="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/FreeImageLib.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1043"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="Debug\FreeImaged.lib"
SuppressStartupBanner="true"
src/Source/FreeImageLib/FreeImageLib.2008.vcproj view on Meta::CPAN
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="..\;..\ZLib;..\DeprecationManager;..\OpenEXR;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\jxrgluelib;..\LibJXR\image\sys"
PreprocessorDefinitions="WIN32;NDEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL"
StringPooling="true"
RuntimeLibrary="0"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/FreeImageLib.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="Release\FreeImage.lib"
SuppressStartupBanner="true"
src/Source/FreeImageLib/FreeImageLib.2008.vcproj view on Meta::CPAN
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\;..\ZLib;..\DeprecationManager;..\OpenEXR;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\jxrgluelib;..\LibJXR\image\sys"
PreprocessorDefinitions="WIN32;NDEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL"
StringPooling="true"
RuntimeLibrary="0"
BufferSecurityCheck="false"
OpenMP="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/FreeImageLib.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="Release\FreeImage.lib"
SuppressStartupBanner="true"
src/Source/FreeImageLib/FreeImageLib.2013.vcxproj view on Meta::CPAN
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>.\$(Platform)\$(Configuration)\</OutDir>
<IntDir>.\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..;..\ZLib;..\DeprecationManager;..\OpenEXR;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\jxrgluelib;..\LibJXR\image\sys;%(AdditionalIncludeDirectories)</Additiona...
<PreprocessorDefinitions>WIN32;_DEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0413</Culture>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
<PostBuildEvent>
<Command>mkdir ..\..\Dist\x32
src/Source/FreeImageLib/FreeImageLib.2013.vcxproj view on Meta::CPAN
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..;..\ZLib;..\DeprecationManager;..\OpenEXR;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\jxrgluelib;..\LibJXR\image\sys;%(AdditionalIncludeDirectories)</Additiona...
<PreprocessorDefinitions>WIN32;_DEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<OpenMPSupport>true</OpenMPSupport>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0413</Culture>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
<PostBuildEvent>
<Command>mkdir ..\..\Dist\x64
src/Source/FreeImageLib/FreeImageLib.2013.vcxproj view on Meta::CPAN
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<WholeProgramOptimization>true</WholeProgramOptimization>
<AdditionalIncludeDirectories>..;..\ZLib;..\DeprecationManager;..\OpenEXR;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\jxrgluelib;..\LibJXR\image\sys;%(AdditionalIncludeDirectories)</Additiona...
<PreprocessorDefinitions>WIN32;NDEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>Default</CompileAs>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
<PostBuildEvent>
src/Source/FreeImageLib/FreeImageLib.2013.vcxproj view on Meta::CPAN
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..;..\ZLib;..\DeprecationManager;..\OpenEXR;..\OpenEXR\Half;..\OpenEXR\Iex;..\OpenEXR\IlmImf;..\OpenEXR\Imath;..\OpenEXR\IlmThread;..\LibJXR\jxrgluelib;..\LibJXR\image\sys;%(AdditionalIncludeDirectories)</Additiona...
<PreprocessorDefinitions>WIN32;NDEBUG;OPJ_STATIC;FREEIMAGE_LIB;_CRT_SECURE_NO_DEPRECATE;LIBRAW_NODLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<OpenMPSupport>true</OpenMPSupport>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>Default</CompileAs>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
<PostBuildEvent>
src/Source/FreeImageToolkit/BSplineRotate.cpp view on Meta::CPAN
Image = Image + (y * Width);
for(x = 0L; x < Width; x++) {
*Image++ = (double)Line[x];
}
}
/**
SamplesToCoefficients.<br>
Implement the algorithm that converts the image samples into B-spline coefficients.
This efficient procedure essentially relies on the three papers cited above;
data are processed in-place.
Even though this algorithm is robust with respect to quantization,
we advocate the use of a floating-point format for the data.
@param Image Input / Output image (in-place processing)
@param Width Width of the image
@param Height Height of the image
@param spline_degree Degree of the spline model
@return Returns true if success, false otherwise
*/
static bool
SamplesToCoefficients(double *Image, long Width, long Height, long spline_degree) {
double *Line;
double Pole[2];
long NbPoles;
src/Source/FreeImageToolkit/BSplineRotate.cpp view on Meta::CPAN
Pole[1] = sqrt(135.0 / 2.0 + sqrt(17745.0 / 4.0)) - sqrt(105.0 / 4.0)
- 13.0 / 2.0;
break;
default:
// Invalid spline degree
return false;
}
// convert the image samples into interpolation coefficients
// in-place separable process, along x
Line = (double *)malloc(Width * sizeof(double));
if (Line == NULL) {
// Row allocation failed
return false;
}
for (y = 0L; y < Height; y++) {
GetRow(Image, y, Line, Width);
ConvertToInterpolationCoefficients(Line, Width, Pole, NbPoles, DBL_EPSILON);
PutRow(Image, y, Line, Width);
}
free(Line);
// in-place separable process, along y
Line = (double *)malloc(Height * sizeof(double));
if (Line == NULL) {
// Column allocation failed
return false;
}
for (x = 0L; x < Width; x++) {
GetColumn(Image, Width, x, Line, Height);
ConvertToInterpolationCoefficients(Line, Height, Pole, NbPoles, DBL_EPSILON);
PutColumn(Image, Width, x, Line, Height);
}
src/Source/FreeImageToolkit/BSplineRotate.cpp view on Meta::CPAN
dst = FreeImage_Allocate(width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
} else {
dst = FreeImage_Allocate(width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
}
if(!dst) throw(1);
// allocate a temporary 8-bit dib (no need to build a palette)
src8 = FreeImage_Allocate(width, height, 8);
if(!src8) throw(1);
// process each channel separately
// -------------------------------
nb_channels = (bpp / 8);
for(channel = 0; channel < nb_channels; channel++) {
// extract channel from source dib
for(y = 0; y < height; y++) {
src_bits = FreeImage_GetScanLine(dib, y);
dst_bits = FreeImage_GetScanLine(src8, y);
for(x = 0; x < width; x++) {
dst_bits[x] = src_bits[channel];
src_bits += nb_channels;
}
}
// process channel
dst8 = Rotate8Bit(src8, angle, x_shift, y_shift, x_origin, y_origin, ROTATE_CUBIC, use_mask);
if(!dst8) throw(1);
// insert channel to destination dib
for(y = 0; y < height; y++) {
src_bits = FreeImage_GetScanLine(dst8, y);
dst_bits = FreeImage_GetScanLine(dst, y);
for(x = 0; x < width; x++) {
dst_bits[channel] = src_bits[x];
dst_bits += nb_channels;
src/Source/FreeImageToolkit/Background.cpp view on Meta::CPAN
/** @brief Looks up a specified color in a FIBITMAP's palette and returns the color's
palette index or -1 if the color was not found.
Unlike with FreeImage_GetColorType, which returns either FIC_MINISBLACK or
FIC_MINISWHITE for a greyscale image with a linear ramp palette, the return
value of this function does not depend on the palette's order, but only on the
palette's individual colors.
@param dib The image, whose palette should be searched through.
@param color The color to be searched in the palette.
@param options Options that affect the color search process.
@param color_type A pointer, that optionally specifies the image's color type as
returned by FreeImage_GetColorType. If invalid or NULL, this function determines the
color type with FreeImage_GetColorType.
@return Returns the specified color's palette index, the color's rgbReserved member
if option FI_COLOR_ALPHA_IS_INDEX was specified or -1, if the color was not found
in the image's palette or if the specified image is non-palletized.
*/
static int
GetPaletteIndex(FIBITMAP *dib, const RGBQUAD *color, int options, FREE_IMAGE_COLOR_TYPE *color_type) {
src/Source/FreeImageToolkit/Background.cpp view on Meta::CPAN
return TRUE;
}
/** @brief Fills a FIT_BITMAP image with the specified color.
This function does the dirty work for FreeImage_FillBackground for FIT_BITMAP
images.
@param dib The image to be filled.
@param color The color, the specified image should be filled with.
@param options Options that affect the color search process for palletized images.
@return Returns TRUE on success, FALSE otherwise. This function fails if any of
the dib and color is NULL or the provided image is not a FIT_BITMAP image.
*/
static BOOL
FillBackgroundBitmap(FIBITMAP *dib, const RGBQUAD *color, int options) {
if ((!dib) || (FreeImage_GetImageType(dib) != FIT_BITMAP)) {
return FALSE;;
}
src/Source/FreeImageToolkit/Background.cpp view on Meta::CPAN
from the image's bottom-left pixel. So, currently using alpha enabled colors, assumes the
image to be unicolor before the fill operation. However, the RGBQUAD's rgbReserved member is
only taken into account, if option FI_COLOR_IS_RGBA_COLOR has been specified.
For 16-bit images, the red-, green- and blue components of the specified color are
transparently translated into either the 16-bit 555 or 565 representation. This depends
on the image's actual red- green- and blue masks.
Special attention must be payed for palletized images. Generally, the RGB color specified
is looked up in the image's palette. The found palette index is then used to fill the image.
There are some option flags, that affect this lookup process:
no option specified (0x00) Uses the color, that is nearest to the specified color.
This is the default behavior and should always find a
color in the palette. However, the visual result may
far from what was expected and mainly depends on the
image's palette.
FI_COLOR_FIND_EQUAL_COLOR (0x02) Searches the image's palette for the specified color
but only uses the returned palette index, if the specified
color exactly matches the palette entry. Of course,
src/Source/FreeImageToolkit/Background.cpp view on Meta::CPAN
However, for 4-bit images, only the low nibble of the
rgbReserved member are used and for 1-bit images, only
the least significant bit (LSB) is used.
This function fails if any of dib and color is NULL.
@param dib The image to be filled.
@param color A pointer to the color value to be used for filling the image. The
memory pointed to by this pointer is always assumed to be at least as large as the
image's color value, but never smaller than the size of an RGBQUAD structure.
@param options Options that affect the color search process for palletized images.
@return Returns TRUE on success, FALSE otherwise. This function fails if any of
dib and color is NULL.
*/
BOOL DLL_CALLCONV
FreeImage_FillBackground(FIBITMAP *dib, const void *color, int options) {
if (!FreeImage_HasPixels(dib)) {
return FALSE;
}
src/Source/FreeImageToolkit/Background.cpp view on Meta::CPAN
pixels are all initialized with zeros so, the image will be filled with the color of the
first palette entry.
@param type Specifies the image type of the new image.
@param width The desired width in pixels of the new image.
@param height The desired height in pixels of the new image.
@param bpp The desired bit depth of the new image.
@param color A pointer to the color value to be used for filling the image. The
memory pointed to by this pointer is always assumed to be at least as large as the
image's color value but never smaller than the size of an RGBQUAD structure.
@param options Options that affect the color search process for palletized images.
@param red_mask Specifies the bits used to store the red components of a pixel.
@param green_mask Specifies the bits used to store the green components of a pixel.
@param blue_mask Specifies the bits used to store the blue components of a pixel.
@return Returns a pointer to a newly allocated image on success, NULL otherwise.
*/
FIBITMAP * DLL_CALLCONV
FreeImage_AllocateExT(FREE_IMAGE_TYPE type, int width, int height, int bpp, const void *color, int options, const RGBQUAD *palette, unsigned red_mask, unsigned green_mask, unsigned blue_mask) {
FIBITMAP *bitmap = FreeImage_AllocateT(type, width, height, bpp, red_mask, green_mask, blue_mask);
src/Source/FreeImageToolkit/Background.cpp view on Meta::CPAN
parameter palette is initially set for the new image, if a palletized image of type
FIT_BITMAP is created. However, in the latter case, this function returns an image, whose
pixels are all initialized with zeros so, the image will be filled with the color of the
first palette entry.
@param width The desired width in pixels of the new image.
@param height The desired height in pixels of the new image.
@param bpp The desired bit depth of the new image.
@param color A pointer to an RGBQUAD structure, that provides the color to be used for
filling the image.
@param options Options that affect the color search process for palletized images.
@param red_mask Specifies the bits used to store the red components of a pixel.
@param green_mask Specifies the bits used to store the green components of a pixel.
@param blue_mask Specifies the bits used to store the blue components of a pixel.
@return Returns a pointer to a newly allocated image on success, NULL otherwise.
*/
FIBITMAP * DLL_CALLCONV
FreeImage_AllocateEx(int width, int height, int bpp, const RGBQUAD *color, int options, const RGBQUAD *palette, unsigned red_mask, unsigned green_mask, unsigned blue_mask) {
return FreeImage_AllocateExT(FIT_BITMAP, width, height, bpp, ((void *)color), options, palette, red_mask, green_mask, blue_mask);
}
src/Source/FreeImageToolkit/Background.cpp view on Meta::CPAN
@param dib The image to be enlarged or shrunken.
@param left The number of pixels, the image should be enlarged on its left side. Negative
values shrink the image on its left side.
@param top The number of pixels, the image should be enlarged on its top side. Negative
values shrink the image on its top side.
@param right The number of pixels, the image should be enlarged on its right side. Negative
values shrink the image on its right side.
@param bottom The number of pixels, the image should be enlarged on its bottom side. Negative
values shrink the image on its bottom side.
@param color The color, the enlarged sides of the image should be filled with.
@param options Options that affect the color search process for palletized images.
@return Returns a pointer to a newly allocated enlarged or shrunken image on success,
NULL otherwise. This function fails if either the input image is NULL or the pointer to the
color is NULL, while at least on of left, top, right and bottom is greater than zero. This
function also returns NULL, if the new image's size will be negative in either x- or
y-direction.
*/
FIBITMAP * DLL_CALLCONV
FreeImage_EnlargeCanvas(FIBITMAP *src, int left, int top, int right, int bottom, const void *color, int options) {
if(!FreeImage_HasPixels(src)) return NULL;
src/Source/FreeImageToolkit/Channels.cpp view on Meta::CPAN
// ==========================================================
// Channel processing support
//
// Design and implementation by
// - Hervé Drolon (drolon@infonie.fr)
//
// This file is part of FreeImage 3
//
// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED
src/Source/FreeImageToolkit/Channels.cpp view on Meta::CPAN
// THIS DISCLAIMER.
//
// Use at your own risk!
// ==========================================================
#include "FreeImage.h"
#include "Utilities.h"
/** @brief Retrieves the red, green, blue or alpha channel of a BGR[A] image.
@param src Input image to be processed.
@param channel Color channel to extract
@return Returns the extracted channel if successful, returns NULL otherwise.
*/
FIBITMAP * DLL_CALLCONV
FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
if(!FreeImage_HasPixels(src)) return NULL;
FREE_IMAGE_TYPE image_type = FreeImage_GetImageType(src);
unsigned bpp = FreeImage_GetBPP(src);
src/Source/FreeImageToolkit/Channels.cpp view on Meta::CPAN
}
}
return TRUE;
}
return FALSE;
}
/** @brief Retrieves the real part, imaginary part, magnitude or phase of a complex image.
@param src Input image to be processed.
@param channel Channel to extract
@return Returns the extracted channel if successful, returns NULL otherwise.
*/
FIBITMAP * DLL_CALLCONV
FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) {
unsigned x, y;
double mag, phase;
FICOMPLEX *src_bits = NULL;
double *dst_bits = NULL;
FIBITMAP *dst = NULL;
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
#define GET_LO_NIBBLE(byte) ((byte) & 0x0F)
#define SET_LO_NIBBLE(byte, n) byte &= 0xF0, byte |= ((n) & 0x0F)
#define GET_NIBBLE(cn, byte) ((cn) ? (GET_HI_NIBBLE(byte)) : (GET_LO_NIBBLE(byte)))
#define SET_NIBBLE(cn, byte, n) if (cn) SET_HI_NIBBLE(byte, n); else SET_LO_NIBBLE(byte, n)
// ----------------------------------------------------------
/** @brief Inverts each pixel data.
@param src Input image to be processed.
@return Returns TRUE if successful, FALSE otherwise.
*/
BOOL DLL_CALLCONV
FreeImage_Invert(FIBITMAP *src) {
if (!FreeImage_HasPixels(src)) return FALSE;
unsigned i, x, y, k;
const unsigned width = FreeImage_GetWidth(src);
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
}
/** @brief Perfoms an histogram transformation on a 8, 24 or 32-bit image
according to the values of a lookup table (LUT).
The transformation is done as follows.<br>
Image 8-bit : if the image has a color palette, the LUT is applied to this palette,
otherwise, it is applied to the grey values.<br>
Image 24-bit & 32-bit : if channel == FICC_RGB, the same LUT is applied to each color
plane (R,G, and B). Otherwise, the LUT is applied to the specified channel only.
@param src Input image to be processed.
@param LUT Lookup table. <b>The size of 'LUT' is assumed to be 256.</b>
@param channel The color channel to be processed (only used with 24 & 32-bit DIB).
@return Returns TRUE if successful, FALSE otherwise.
@see FREE_IMAGE_COLOR_CHANNEL
*/
BOOL DLL_CALLCONV
FreeImage_AdjustCurve(FIBITMAP *src, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel) {
unsigned x, y;
BYTE *bits = NULL;
if(!FreeImage_HasPixels(src) || !LUT || (FreeImage_GetImageType(src) != FIT_BITMAP))
return FALSE;
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
}
break;
}
}
return TRUE;
}
/** @brief Performs gamma correction on a 8, 24 or 32-bit image.
@param src Input image to be processed.
@param gamma Gamma value to use. A value of 1.0 leaves the image alone,
less than one darkens it, and greater than one lightens it.
@return Returns TRUE if successful, FALSE otherwise.
*/
BOOL DLL_CALLCONV
FreeImage_AdjustGamma(FIBITMAP *src, double gamma) {
BYTE LUT[256]; // Lookup table
if(!FreeImage_HasPixels(src) || (gamma <= 0))
return FALSE;
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
color = 255;
LUT[i] = (BYTE)floor(color + 0.5);
}
// Apply the gamma correction
return FreeImage_AdjustCurve(src, LUT, FICC_RGB);
}
/** @brief Adjusts the brightness of a 8, 24 or 32-bit image by a certain amount.
@param src Input image to be processed.
@param percentage Where -100 <= percentage <= 100<br>
A value 0 means no change, less than 0 will make the image darker
and greater than 0 will make the image brighter.
@return Returns TRUE if successful, FALSE otherwise.
*/
BOOL DLL_CALLCONV
FreeImage_AdjustBrightness(FIBITMAP *src, double percentage) {
BYTE LUT[256]; // Lookup table
double value;
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
for(int i = 0; i < 256; i++) {
value = i * scale;
value = MAX(0.0, MIN(value, 255.0));
LUT[i] = (BYTE)floor(value + 0.5);
}
return FreeImage_AdjustCurve(src, LUT, FICC_RGB);
}
/** @brief Adjusts the contrast of a 8, 24 or 32-bit image by a certain amount.
@param src Input image to be processed.
@param percentage Where -100 <= percentage <= 100<br>
A value 0 means no change, less than 0 will decrease the contrast
and greater than 0 will increase the contrast of the image.
@return Returns TRUE if successful, FALSE otherwise.
*/
BOOL DLL_CALLCONV
FreeImage_AdjustContrast(FIBITMAP *src, double percentage) {
BYTE LUT[256]; // Lookup table
double value;
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
LUT[i] = (BYTE)floor(value + 0.5);
}
return FreeImage_AdjustCurve(src, LUT, FICC_RGB);
}
/** @brief Computes image histogram
For 24-bit and 32-bit images, histogram can be computed from red, green, blue and
black channels. For 8-bit images, histogram is computed from the black channel. Other
bit depth is not supported (nothing is done).
@param src Input image to be processed.
@param histo Histogram array to fill. <b>The size of 'histo' is assumed to be 256.</b>
@param channel Color channel to use
@return Returns TRUE if succesful, returns FALSE if the image bit depth isn't supported.
*/
BOOL DLL_CALLCONV
FreeImage_GetHistogram(FIBITMAP *src, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel) {
BYTE pixel;
BYTE *bits = NULL;
unsigned x, y;
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
/** @brief Creates a lookup table to be used with FreeImage_AdjustCurve() which
may adjust brightness and contrast, correct gamma and invert the image with a
single call to FreeImage_AdjustCurve().
This function creates a lookup table to be used with FreeImage_AdjustCurve()
which may adjust brightness and contrast, correct gamma and invert the image
with a single call to FreeImage_AdjustCurve(). If more than one of these image
display properties need to be adjusted, using a combined lookup table should be
preferred over calling each adjustment function separately. That's particularly
true for huge images or if performance is an issue. Then, the expensive process
of iterating over all pixels of an image is performed only once and not up to
four times.
Furthermore, the lookup table created does not depend on the order, in which
each single adjustment operation is performed. Due to rounding and byte casting
issues, it actually matters in which order individual adjustment operations
are performed. Both of the following snippets most likely produce different
results:
// snippet 1: contrast, brightness
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
// snippet 2: brightness, contrast
FreeImage_AdjustBrightness(dib, 50.0);
FreeImage_AdjustContrast(dib, 15.0);
Better and even faster would be snippet 3:
// snippet 3:
FreeImage_AdjustColors(dib, 50.0, 15.0, 1.0, FALSE);
@param dib Input/output image to be processed.
@param brightness Percentage brightness value where -100 <= brightness <= 100<br>
A value of 0 means no change, less than 0 will make the image darker and greater
than 0 will make the image brighter.
@param contrast Percentage contrast value where -100 <= contrast <= 100<br>
A value of 0 means no change, less than 0 will decrease the contrast
and greater than 0 will increase the contrast of the image.
@param gamma Gamma value to be used for gamma correction. A value of 1.0 leaves
the image alone, less than one darkens it, and greater than one lightens it.<br>
This parameter must not be zero or smaller than zero. If so, it will be ignored
and no gamma correction will be performed on the image.
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
Both arrays <i>srccolors</i> and <i>dstcolors</i> are assumed not to hold less
than <i>count</i> colors.<br>
For 16-bit images, all colors specified are transparently converted to their
proper 16-bit representation (either in RGB555 or RGB565 format, which is
determined by the image's red- green- and blue-mask).<br>
<b>Note, that this behaviour is different from what FreeImage_ApplyPaletteIndexMapping()
does, which modifies the actual image data on palletized images.</b>
@param dib Input/output image to be processed.
@param srccolors Array of colors to be used as the mapping source.
@param dstcolors Array of colors to be used as the mapping destination.
@param count The number of colors to be mapped. This is the size of both
<i>srccolors</i> and <i>dstcolors</i>.
@param ignore_alpha If TRUE, 32-bit images and colors are treated as 24-bit.
@param swap If TRUE, source and destination colors are swapped, that is,
each destination color is also mapped to the corresponding source color.
@return Returns the total number of pixels changed.
*/
unsigned DLL_CALLCONV
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
on a palletized or high color image. For high color images, the actual image
data will be modified whereas, for palletized images only the palette will be
changed.<br>
<b>Note, that this behaviour is different from what FreeImage_SwapPaletteIndices()
does, which modifies the actual image data on palletized images.</b><br>
This is just a thin wrapper for FreeImage_ApplyColorMapping() and resolves to:<br>
<i>return FreeImage_ApplyColorMapping(dib, color_a, color_b, 1, ignore_alpha, TRUE);</i>
@param dib Input/output image to be processed.
@param color_a On of the two colors to be swapped.
@param color_b The other of the two colors to be swapped.
@param ignore_alpha If TRUE, 32-bit images and colors are treated as 24-bit.
@return Returns the total number of pixels changed.
*/
unsigned DLL_CALLCONV
FreeImage_SwapColors(FIBITMAP *dib, RGBQUAD *color_a, RGBQUAD *color_b, BOOL ignore_alpha) {
return FreeImage_ApplyColorMapping(dib, color_a, color_b, 1, ignore_alpha, TRUE);
}
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
The function returns the number of pixels changed or zero, if no pixels were
changed.
Both arrays <i>srcindices</i> and <i>dstindices</i> are assumed not to hold less
than <i>count</i> indices.<br>
<b>Note, that this behaviour is different from what FreeImage_ApplyColorMapping()
does, which modifies the actual image data on palletized images.</b>
@param dib Input/output image to be processed.
@param srcindices Array of palette indices to be used as the mapping source.
@param dstindices Array of palette indices to be used as the mapping destination.
@param count The number of palette indices to be mapped. This is the size of both
<i>srcindices</i> and <i>dstindices</i>.
@param swap If TRUE, source and destination palette indices are swapped, that is,
each destination index is also mapped to the corresponding source index.
@return Returns the total number of pixels changed.
*/
unsigned DLL_CALLCONV
FreeImage_ApplyPaletteIndexMapping(FIBITMAP *dib, BYTE *srcindices, BYTE *dstindices, unsigned count, BOOL swap) {
src/Source/FreeImageToolkit/Colors.cpp view on Meta::CPAN
This function swaps the two specified palette indices <i>index_a</i> and
<i>index_b</i> on a palletized image. Therefore, not the palette, but the
actual image data will be modified.<br>
<b>Note, that this behaviour is different from what FreeImage_SwapColors() does
on palletized images, which only swaps the colors in the palette.</b><br>
This is just a thin wrapper for FreeImage_ApplyColorMapping() and resolves to:<br>
<i>return FreeImage_ApplyPaletteIndexMapping(dib, index_a, index_b, 1, TRUE);</i>
@param dib Input/output image to be processed.
@param index_a On of the two palette indices to be swapped.
@param index_b The other of the two palette indices to be swapped.
@return Returns the total number of pixels changed.
*/
unsigned DLL_CALLCONV
FreeImage_SwapPaletteIndices(FIBITMAP *dib, BYTE *index_a, BYTE *index_b) {
return FreeImage_ApplyPaletteIndexMapping(dib, index_a, index_b, 1, TRUE);
}
src/Source/FreeImageToolkit/Flip.cpp view on Meta::CPAN
// THIS DISCLAIMER.
//
// Use at your own risk!
// ==========================================================
#include "FreeImage.h"
#include "Utilities.h"
/**
Flip the image horizontally along the vertical axis.
@param src Input image to be processed.
@return Returns TRUE if successful, FALSE otherwise.
*/
BOOL DLL_CALLCONV
FreeImage_FlipHorizontal(FIBITMAP *src) {
if (!FreeImage_HasPixels(src)) return FALSE;
unsigned line = FreeImage_GetLine(src);
unsigned width = FreeImage_GetWidth(src);
unsigned height = FreeImage_GetHeight(src);
src/Source/FreeImageToolkit/Flip.cpp view on Meta::CPAN
}
FreeImage_Aligned_Free(new_bits);
return TRUE;
}
/**
Flip the image vertically along the horizontal axis.
@param src Input image to be processed.
@return Returns TRUE if successful, FALSE otherwise.
*/
BOOL DLL_CALLCONV
FreeImage_FlipVertical(FIBITMAP *src) {
BYTE *From, *Mid;
if (!FreeImage_HasPixels(src)) return FALSE;
// swap the buffer
src/Source/FreeImageToolkit/JPEGTransform.cpp view on Meta::CPAN
jpeg_copy_critical_parameters(&srcinfo, &dstinfo);
// Adjust destination parameters if required by transform options;
// also find out which set of coefficient arrays will hold the output
dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo, src_coef_arrays, &transfoptions);
// Note: we assume that jpeg_read_coefficients consumed all input
// until JPEG_REACHED_EOI, and that jpeg_finish_decompress will
// only consume more while (! cinfo->inputctl->eoi_reached).
// We cannot call jpeg_finish_decompress here since we still need the
// virtual arrays allocated from the source object for processing.
if(src_handle == dst_handle) {
dst_io->seek_proc(dst_handle, stream_start, SEEK_SET);
}
// Specify data destination for compression
jpeg_freeimage_dst(&dstinfo, dst_handle, dst_io);
// Start compressor (note no image data is actually written here)
jpeg_write_coefficients(&dstinfo, dst_coef_arrays);
src/Source/LibJPEG/LibJPEG.2005.vcproj view on Meta::CPAN
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/LibJPEG.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Debug\LibJPEG.lib"
SuppressStartupBanner="true"
/>
src/Source/LibJPEG/LibJPEG.2005.vcproj view on Meta::CPAN
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/LibJPEG.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Release\LibJPEG.lib"
SuppressStartupBanner="true"
/>
src/Source/LibJPEG/LibJPEG.2005.vcproj view on Meta::CPAN
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/LibJPEG.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Debug\LibJPEG.lib"
SuppressStartupBanner="true"
/>
src/Source/LibJPEG/LibJPEG.2005.vcproj view on Meta::CPAN
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/LibJPEG.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Release\LibJPEG.lib"
SuppressStartupBanner="true"
/>
src/Source/LibJPEG/LibJPEG.2008.vcproj view on Meta::CPAN
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/LibJPEG.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Debug\LibJPEG.lib"
SuppressStartupBanner="true"
/>
src/Source/LibJPEG/LibJPEG.2008.vcproj view on Meta::CPAN
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/LibJPEG.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Release\LibJPEG.lib"
SuppressStartupBanner="true"
/>
src/Source/LibJPEG/LibJPEG.2008.vcproj view on Meta::CPAN
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/LibJPEG.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Debug\LibJPEG.lib"
SuppressStartupBanner="true"
/>
src/Source/LibJPEG/LibJPEG.2008.vcproj view on Meta::CPAN
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\zlib"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/LibJPEG.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\Release\LibJPEG.lib"
SuppressStartupBanner="true"
/>
src/Source/LibJPEG/LibJPEG.2013.vcxproj view on Meta::CPAN
<OutDir>.\$(Platform)\$(Configuration)\</OutDir>
<IntDir>.\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>.\$(Platform)\$(Configuration)\</OutDir>
<IntDir>.\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>Default</CompileAs>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>Default</CompileAs>
<UseUnicodeForAssemblerListing>false</UseUnicodeForAssemblerListing>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="jaricom.c" />
<ClCompile Include="jcapimin.c" />