Alien-FreeImage
view release on metacpan or search on metacpan
src/Source/FreeImage/PluginRAW.cpp view on Meta::CPAN
// load raw data as 8-bit/sample (i.e. RGB 24-bit)
dib = libraw_LoadRawData(RawProcessor, 8);
}
else {
// default: load raw data as linear 16-bit/sample (i.e. RGB 48-bit)
dib = libraw_LoadRawData(RawProcessor, 16);
}
// save ICC profile if present
if(dib && (NULL != RawProcessor->imgdata.color.profile)) {
FreeImage_CreateICCProfile(dib, RawProcessor->imgdata.color.profile, RawProcessor->imgdata.color.profile_length);
}
// try to get JPEG embedded Exif metadata
if(dib && !((flags & RAW_PREVIEW) == RAW_PREVIEW)) {
FIBITMAP *metadata_dib = libraw_LoadEmbeddedPreview(RawProcessor, FIF_LOAD_NOPIXELS);
if(metadata_dib) {
FreeImage_CloneMetadata(dib, metadata_dib);
FreeImage_Unload(metadata_dib);
}
}
// clean-up internal memory allocations
RawProcessor->recycle();
delete RawProcessor;
return dib;
} catch(const char *text) {
if(RawProcessor) {
RawProcessor->recycle();
delete RawProcessor;
}
if(dib) {
FreeImage_Unload(dib);
}
FreeImage_OutputMessageProc(s_format_id, text);
}
return NULL;
}
// ==========================================================
// Init
// ==========================================================
void DLL_CALLCONV
InitRAW(Plugin *plugin, int format_id) {
s_format_id = format_id;
plugin->format_proc = Format;
plugin->description_proc = Description;
plugin->extension_proc = Extension;
plugin->regexpr_proc = RegExpr;
plugin->open_proc = NULL;
plugin->close_proc = NULL;
plugin->pagecount_proc = NULL;
plugin->pagecapability_proc = NULL;
plugin->load_proc = Load;
plugin->save_proc = NULL;
plugin->validate_proc = Validate;
plugin->mime_proc = MimeType;
plugin->supports_export_bpp_proc = SupportsExportDepth;
plugin->supports_export_type_proc = SupportsExportType;
plugin->supports_icc_profiles_proc = SupportsICCProfiles;
plugin->supports_no_pixels_proc = SupportsNoPixels;
}
( run in 0.496 second using v1.01-cache-2.11-cpan-d7f47b0818f )