FreeImage Userlib (open source project)

Community Forums/Showcase/FreeImage Userlib (open source project)

Snarty(Posted 2003) [#1]
Hi all,

I'm releasing the unfinished FreeImage Userlib for B+ this is obviously open source. What I would ask that any improvements and additions be emailed to me so that I can keep this Userlib up to date. The original Userlib will be v1.0 and I will add contributors names to the lib as and when they are implimented.

Doc's and a more generic command send would be a start for anyone wishing to improve on this.

The showcase entry is HERE!

Have fun, and I hope it helps someone out. (or at least it's a start)


TeraBit(Posted 2003) [#2]
I have a question for anyone that knows. According to the FreeImage T&C it *LOOKs* like it can be used in commercial projects (i.e. Blitz / Blitz3D & BlitzPlus ).

Can someone who understands the terms and conditions tell me if I really *can* use this DLL in a commercial project without getting shot!


Snarty(Posted 2003) [#3]
Yes you can, you need to use the FreeImage Public License not the GNU license.

http://freeimage.sourceforge.net/freeimage-license.txt


TeraBit(Posted 2003) [#4]
Thanks!


Beaker(Posted 2003) [#5]
Thanks Snarty. Nice contribution.

Anyone know if it supports alpha as is?


Snarty(Posted 2003) [#6]
Yup, it should do. :)


Rob(Posted 2003) [#7]
Nice one!


TeraBit(Posted 2003) [#8]
Is there any way to get this to run from Blitz3D? We seem a bit stuffed without LockedPixels!


Snarty(Posted 2003) [#9]
Yes, you could write to a bank then translate via WritePixelFast from the bank to the image :) (obviously will be quite a bit slower)


Snarty(Posted 2003) [#10]
Something like this should work (replacing the FIToBank in the B+ Version)
FIImage\Pitch=(Ceil(FIImage\Width*4)/4)*4
ImageBank=CreateBank(FIImage\Height*FIImage\Pitch)
FIToBank ImageBank,FIBITMAP,FIImage\Pitch,24,$FF0000,$FF00,$FF,0
LockBuffer ImageBuffer(FIImage\ImageLoc)
For y=0 To FIImage\Height
	Yoff=y*FIImage\Pitch
	For x=0 To FIImage\Width
		WritePixelFast x,y,PeekInt(ImageBank,Yoff+(x*4))
	Next
Next
UnlockBuffer ImageBuffer(FIImage\ImageLoc)
FreeBank ImageBank