/** Print plugins export capabilities */ void PrintExportFormats(iostream& ios) { int count = FreeImage_GetFIFCount(); if(count) ios << "FORMAT;DESCRIPTION;EXTENSIONS;BITDEPTH;ICC PROFILES\n"; for(int i = 0; i < count; i++) { FREE_IMAGE_FORMAT fif = (FREE_IMAGE_FORMAT)i; if(FreeImage_FIFSupportsWriting(fif)) { const char * format = FreeImage_GetFormatFromFIF(fif); const char * description = FreeImage_GetFIFDescription(fif); const char * ext = FreeImage_GetFIFExtensionList(fif); const char * icc = "*"; ios << format << ";" << description << ";" << ext << ";"; if(FreeImage_FIFSupportsExportBPP(fif, 1)) ios << "1 "; if(FreeImage_FIFSupportsExportBPP(fif, 4)) ios << "4 "; if(FreeImage_FIFSupportsExportBPP(fif, 8)) ios << "8 "; if(FreeImage_FIFSupportsExportBPP(fif, 16)) ios << "16 "; if(FreeImage_FIFSupportsExportBPP(fif, 24)) ios << "24 "; if(FreeImage_FIFSupportsExportBPP(fif, 32)) ios << "32 "; if(FreeImage_FIFSupportsICCProfiles(fif)) { ios << ";" << icc; } else { ios << "; "; } ios << "\n"; } } }
void copy_icc_profile(VALUE self, FIBITMAP *from, FIBITMAP *to) { FREE_IMAGE_FORMAT fif = FIX2INT(rb_iv_get(self, "@file_type")); if (fif != FIF_PNG && FreeImage_FIFSupportsICCProfiles(fif)) { FIICCPROFILE *profile = FreeImage_GetICCProfile(from); if (profile && profile->data) { FreeImage_CreateICCProfile(to, profile->data, profile->size); } } }
/** Print plugins import capabilities */ void PrintImportFormats(iostream& ios) { int count = FreeImage_GetFIFCount(); if(count) ios << "FORMAT;DESCRIPTION;EXTENSIONS;ICC PROFILES\n"; for(int i = 0; i < count; i++) { FREE_IMAGE_FORMAT fif = (FREE_IMAGE_FORMAT)i; if(FreeImage_FIFSupportsReading(fif)) { const char * format = FreeImage_GetFormatFromFIF(fif); const char * description = FreeImage_GetFIFDescription(fif); const char * ext = FreeImage_GetFIFExtensionList(fif); const char * icc = "*"; if(FreeImage_FIFSupportsICCProfiles(fif)) { ios << format << ";" << description << ";" << ext << ";" << icc << "\n"; } else { ios << format << ";" << description << ";" << ext << "; \n"; } } } }