freeimage

Typedef and enum with same name?

你。 提交于 2019-12-07 03:19:22
问题 In the library FreeImagePlus, in FreeImage.h, there is a funny #define which seems to create a typedef and an enum with the same name: #define FI_ENUM(x) typedef int x; enum x This is expanded by the preprocessor to code like: typedef int FREE_IMAGE_FILTER; enum FREE_IMAGE_FILTER { FILTER_BOX = 0, FILTER_BICUBIC = 1, [...] What does this do? Is it even legal to have a typedef and an enum with the same name? And isn't an enum compatible to int anyway? Why does FreeImage do this? 回答1: Names of

FreeImage: Get pixel color

╄→гoц情女王★ 提交于 2019-12-06 15:33:47
问题 I'm writing a little application that reads color of each pixel in image and writes it to file. First I did it in Python, buit it's too slow on big images. Then I discovered FreeImage library, which I could use, but I can't understand how to use GetPixelColor method. Could you please provide an example on how to get color, for example, of pixel[50:50]? Here is information about GetPixelColor: http://freeimage.sourceforge.net/fnet/html/13E6BB72.htm. Thank you very much! 回答1: With FreeImagePlus

TIFF with JPEG-compression much larger than original JPEG

点点圈 提交于 2019-12-06 13:37:06
I am trying to convert JPEGs to TIFFs with JPEG-compression using FreeImage.Net and C#. This works fine, however, for low-quality JPGES the TIFF-files are a lot larger than the original. I assume the TIFF-size does not depend on the original JPEG-Quality, because the output-images were always about the same size. For example (converting a screenshot): 2065kb JPEG (quality: 100%) --> 1282kb TIFF 379kb JPEG (quality: 50%) --> 1200kb TIFF This increase in size is not acceptable for our company, because our clients and we are dealing with quite a lot of documents. Interestingly enough, I get about

How to compile FreeImage on Mac OS X 10.8?

孤街浪徒 提交于 2019-12-06 02:29:50
When trying to build FreeImage 3.1.5.4 on Mac OS X 10.8 with make make the following error g++-4.0: No such file or directory occurs. There is something wrong with the makefile regarding the compiler configuration. How to fix this? The makefile.osx of FreeImage 3.1.5.4 is outdated for OS X versions > 10.6. See the bottom of this post for a modified version. In addition to address the issue described at FreeImage issue tracker you need to add a line to Source/OpenEXR/IlmImf/ImfAutoArray.h : #include <cstring> Makefile for OS X 10.8: # -*- Makefile -*- # Mac OSX makefile for FreeImage # This

Typedef and enum with same name?

本小妞迷上赌 提交于 2019-12-05 09:36:23
In the library FreeImagePlus , in FreeImage.h , there is a funny #define which seems to create a typedef and an enum with the same name: #define FI_ENUM(x) typedef int x; enum x This is expanded by the preprocessor to code like: typedef int FREE_IMAGE_FILTER; enum FREE_IMAGE_FILTER { FILTER_BOX = 0, FILTER_BICUBIC = 1, [...] What does this do? Is it even legal to have a typedef and an enum with the same name? And isn't an enum compatible to int anyway? Why does FreeImage do this? Names of structures, unions and enumerations lives in their own namespace. That's why you can declare a struct /

FreeImage: Get pixel color

风流意气都作罢 提交于 2019-12-04 21:48:33
I'm writing a little application that reads color of each pixel in image and writes it to file. First I did it in Python, buit it's too slow on big images. Then I discovered FreeImage library, which I could use, but I can't understand how to use GetPixelColor method. Could you please provide an example on how to get color, for example, of pixel[50:50]? Here is information about GetPixelColor: http://freeimage.sourceforge.net/fnet/html/13E6BB72.htm . Thank you very much! With FreeImagePlus using a 24 or 32 bit image, getting the pixel at coords 50, 50 would look like this: fipImage input;

Why FreeImage loads image in BGR format?

老子叫甜甜 提交于 2019-12-04 16:57:33
I write game using Android NDK and FreeImage library to load images into my game. It loads images in BGR format. It is possible to load in RGB format? Or I need to swap R and B components manualy? Edited My device is Samsung Galaxy S4(armv7 archtecture). Here is code` FIMEMORY* fiStream = FreeImage_OpenMemory((BYTE*)data, size); FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeFromMemory(fiStream); if (FreeImage_FIFSupportsReading(fif)) { dib = FreeImage_LoadFromMemory(fif, fiStream, 0); } if (!dib) return; data_ = FreeImage_GetBits(dib); width_ = FreeImage_GetWidth(dib); height_ = FreeImage

OpenCasCade开发环境搭建(vs2010 编译编译源码)

匿名 (未验证) 提交于 2019-12-03 00:29:01
我的安装环境 OpenCasCade下载和安装 OpenCasCade编译、示例运行及使用 总结 我的安装环境: Windows7 旗舰版 SP1 x64; Visual Studio 2010 SP1; 如图为OpenCasCade官方文档上列出的 Requirements : 注意 Visual Studio 的版本要求。 OpenCasCade下载和安装 请自行到OpenCasCade官网进行 下载 解压后的OpenCasCade目录如图: 接下来,下载适合自己编译器版本的第三方库( 官方下载地址 ): Note:这里的第三方库都是根据相应的平台编译生成好的,直接下载解压即可使用。如果不从这里下,而是从各个第三方库的官网下载,则需要自己根据平台自行编译对应的版本,下面也会告诉你怎么自己编译生成。 OpenCasCade编译、示例运行及使用 1. 确保你下载安装了所有需要的第三方库(对照上图) OCCT使用两种类型的第三方库: 强依赖(必须的): 弱依赖(可选的): FreeImage 3.14.1 -3.15.4. 安装强依赖的第三方库: Tcl/Tk FreeType FreeType是3D窗口中,文字表现所必须的。 解压下载的FreeType到occ3rdparty文件中即可。 如果你 不是 从上图适配过的第三方库链接下载的(是的跳过 ,比如你从其自身官网下载

c++ - FreeImage+OpenCV - 16bit image get distorted

拥有回忆 提交于 2019-12-02 10:08:09
I'm trying to load an image because I have to apply an algorithm on it. If I load an 8 bit-per-channel image there are no problems, but if I load a 16bpc image then it get "ruined". Unfortunatly, since I don't have enough reputation I can't uplad images. Those are the links to them: Either the source and the 8bpc processing result http://postimg.org/image/gc0zf2lp5/ ..result if I process the same image saved as 16bpc http://postimg.org/image/5nnwee7df/ And this is the code: FreeImage_Initialise(); FREE_IMAGE_FORMAT formato = FreeImage_GetFileType(argv[1], 0); FIBITMAP* imagetmp = FreeImage

Linking FreeImage as a static library in VS2010?

早过忘川 提交于 2019-12-01 16:20:25
I need a image library and I've been looking into FreeImage, http://freeimage.sourceforge.net/ . I want to link it statically with my application. I have tried downloading the binaries and link it with, but I get 2019 linker errors when I try to call their functions, even though I am positive I linked it correct. So then I tried to download their source, converted their "FreeImageLib.2008" to VS2010 and built it. It builds just fine on its own, but I still have the same problem when linking against it, my application that uses it still complaints about linker errors. I also set all the project