Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / free image wrapper for dbpro

Author
Message
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 9th Jun 2009 16:44 Edited at: 10th Jul 2009 17:25
Hi all , i was looking around the forums and i found that someone had started a dll wrapper for the free image library but alas it was never finished .

anyways i decided to wrap it myself , so here it is for you to enjoy.

Please go to the website and check out the licences .

don`t forget to add a dummy memblock command or it will crash , at least till i get it sorted..


chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.

Attachments

Login to view attachments
Sixty Squares
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 15th Jun 2009 22:34
Wow looks like it could be helpful for an image editing program. Nice one . Do you know how fast the commands would work in realtime?

<-- Spell based team dueling game!
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 16th Jun 2009 12:43
It transports images from dbpro to fi_image almost instantly and vice versa , its got a bug when doing this where it adds an extra line of pixels , but i will sort it i have not finished this yet .

It has no drawing commands , but its great for resizing , and changing contrast/color etc .

I am making a little app , where you can convert images + a few effects eg. normal maps , invert , colorize etc.

Thanks for having a look , what would you be wanting to acheive in realtime , let me know and i will tell u if this lib is capable.

thanks chunks

nvidia geforce 9500gt + amd athlon 64
windows xp pro.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 17th Jun 2009 18:07
hi i made a little app to show what the lib can do , its a bit quirky cos i am not the best programmer but its functional .

make sure you type the file extension when saving ......

nvidia geforce 9500gt + amd athlon 64
windows xp pro.

Attachments

Login to view attachments
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 20th Jun 2009 00:21
i cant get

fi_image to dbpro

to work, it always crashes



thats the code... i dont really understand why it crashes, any help is good help

yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 20th Jun 2009 02:15
You need to add a dummy memblock command in to add the memblock dll,at least till the next update .



thanks chunks

nvidia geforce 9500gt + amd athlon 64
windows xp pro.
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 20th Jun 2009 14:47
ok, thankyou for the quick reply, but im still comfused as hell
i can load an image and save it with a different extension, but i can't convert it to a dbpro image to display on screen, thus i can't see if the grayscale ect... works.

anychance of some example code?

yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 20th Jun 2009 16:00 Edited at: 20th Jun 2009 16:07
sorry i should have provided some examples , its quite easy for me as i know how every command works .

Anyway attached is an example project so you can see how it all works
, thanks for having a go with it .




EDIT: I think for next release i might do all the image swapping internally so you you don`t have to keep swapping every time you apply an effect or resize an image .

So what that means is when you use a command like the greyscale one you will not have to call fi_image to dbpro , it will do it automatically.

thanks again chunks.

nvidia geforce 9500gt + amd athlon 64
windows xp pro.

Attachments

Login to view attachments
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 20th Jun 2009 16:37
Right, i think there's a problem with my pc, cos in the exmaple you provided, the .exe runs fine, but if i open the .dbpro and compile it, it crashes on the conversion part...

fi_image to dbpro (or visaversa)

any ideas?

yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 20th Jun 2009 17:22 Edited at: 20th Jun 2009 17:29
Try replacing the dll you have in your user plugins with the one attached , see if that works .

If that fails go here you might not have the VC++ redistributables.


VC++ redistributables :http://forumfiles.thegamecreators.com/?i=959271


Other than that is it giving any error messages ?

nvidia geforce 9500gt + amd athlon 64
windows xp pro.

Attachments

Login to view attachments
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 20th Jun 2009 19:27
nope still crashes, and it dosnt give any error messages, but does make a crash report in the local directory,

Quote: "
[COMMON]
PathToEXE=C:\Users\n3wton\Desktop\free image test\CrashOn_06_20_09.txt
[CEXE]
m_dwRuntimeErrorDWORD=Internal Code:0
m_dwRuntimeErrorLineDWORD=14
"


yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 20th Jun 2009 21:13 Edited at: 20th Jun 2009 21:56
works fine here i haven`t a clue whats goin on , i have made dlls before and had the problem that i posted above and it was fixed , so i don`t really no whats goin on here.

try making a new project and use the code i posted ,make sure the freeimage dll is alongside your exe , and the constants file is included .

if that doesn`t work i dont know what to do , sorry man looks like your outta luck .

really need someone to test this as well .

I have just tested it on three computers 1 xp and two vista and its works fine , mabey check that u put the dll in the user-plugins folder


thanks chunks

nvidia geforce 9500gt + amd athlon 64
windows xp pro.
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 20th Jun 2009 22:10
Right, i've also been looking into and i've found the problem the PC i was running it on used dbpro 0.69 and that didnt work, so i tested it on my laptop which uses 0.73 and it worked, so i guess something in the update is needed? or maybe in the wrapper you wrote is 0.73 + persific? if so could you make a 0.69 compatable version?
if not, no worriers ill just update

yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 20th Jun 2009 22:47
How strange i have only called the memblock commands from dbro ,so it should work with older versions ,i haven`t use any new commands at all .

glad you got it working , there is nothing i can change to make it work with 6.9 as i would have done exactly the same , its more likely that you have some dll on your laptop that you don`t have on your pc which makes it work ,try upgrading your pc to 7.3 and see if it works then .

nvidia geforce 9500gt + amd athlon 64
windows xp pro.
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 24th Jun 2009 18:47
Yerp Upgrading worked, dunno why... but it did

I was also wonddering how you got it to make a normalmap image on your previous example?

yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 24th Jun 2009 22:13
the normalmap maker command is in my other dll community functions ,plus there is loads of other helpfull commands .

http://forum.thegamecreators.com/?m=forum_view&t=142264&b=18&p=1


thanks chunks

nvidia geforce 9500gt + amd athlon 64
windows xp pro.
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 4th Jul 2009 00:54
Hey chunks,

I think I've found a bug

basically when i change the brightness of an image it scrolls the texture...

i've attached the file, so you can see what i mean...

and here's the part of the code that changes the brightness...



Yours N3wton

Attachments

Login to view attachments
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 4th Jul 2009 01:04
Thanks for pointing that out , i think the error is actually in the conversion from fi to dbpro sometimes it adds extra pixels , i will try and track down whats happening .

By the way looks like a good program your making , is it a shader editor or something ?

thanks chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 4th Jul 2009 14:11
Cheers chunks,

I think your right its something to do with conversion, so I re-wrote that part and it know works, my new code is...



so it can't be the fi_image to dbpro, but the dbpro to fi_image that does it?

and it started off being a program just to make normal maps for models, then i thought i'd add heightmaps, tho i dont now how to yet but i might add a way to edit shaders aswel, cos that would be cool

Yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 5th Jul 2009 17:53 Edited at: 5th Jul 2009 17:56
hi i`ve fixed the bug it was because how freeimage reads in images it was reading in the header and adding extra pixels , also you don`t have to use init/deinit anymore put them in the constructor/deconstructor .

Attached is the dll so enjoy .


ps: i`m still working on your heightmap query , also trying to fix the memblock issue so you don`t have to add a dummy function.

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.

Attachments

Login to view attachments
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 5th Jul 2009 23:17
Cheers chunks

I'll donwload the new version now and update my code

Thanks allot

Yours
N3wton

N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 6th Jul 2009 12:45
Found another bug chunks

fi_adjust colors

I thought insted of change brightness contrast gamma all individually i'd use that command, makes sense yer? but when i tried to compile i got an error...



heres mycode



Presume this is a typo or something in the dll?

Yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 6th Jul 2009 14:53 Edited at: 6th Jul 2009 15:45
sorry its just the string table will sort it wont take long ,when i get over ten commands i always get errors lol .



EDIT : fixed dll attached to this post , also added a new command.

FI_COMPOSITE src img , dest img , r , g , b , a

It changes the color of the alpha layer , could be usefull for image editing.

thanks chunks.

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.

Attachments

Login to view attachments
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 6th Jul 2009 18:25
Why thankyou chucnks

i'll update my code now just gotta work on some performance issues cos at the moment after you've edited the image loads you drop down to 0 fps

yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 6th Jul 2009 19:20
I just checked the fps on my image converter test , and its around 3000 fps , then when i load and display a dbpro image it drops to 900 fps and it hovers around that until i open a filebox or edit an image then it drops to 120 fps and back to 900 fps when its done .

But saying that you use more cameras i`m not using the camera at all no backdrop .

shame we can`t render a seprate camera to another window , i have a dll which renders the whole scene to another window .

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 7th Jul 2009 12:16 Edited at: 7th Jul 2009 12:50
My problem lies in where i adjust the colors and contrast ect... as everytime a change is made it takes the original image, stores it in a temp image, changes the brightness, contrast, gamma ect... then converts it back to a dbpro image to be display, but if someone changes the brightness from -100 to 100 it does that loop 200 times, and after awhile my physical memory on my laptop hits 98%ish which is why Im loosing frame rate

also on a couple of occasions i've had problems where its crashed becouse of a memblock, so i was wondering if when the dll is converting? or something? it uses memblocks (thus the dummy memblock) but does it use a different memblock everytime? so after awhile it gets clogged up?

Yours
N3wton

p.s. i'll try get the memblock problem again, to provide more info on it.


Managed to get one of the crashes...
Quote: "[COMMON]
PathToEXE=C:\Users\N3wton\Code\N3wton Map\CrashOn_07_07_09.txt
[CEXE]
m_dwRuntimeErrorDWORD=Internal Code:13002
m_dwRuntimeErrorLineDWORD=678"


N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 7th Jul 2009 16:27
Right I think i've sorted the memory problems, tho they still exist, it's just allot harder to get them

also found a problem with saving images.

only .bmp and .png seem to work?

if i use say, .jpg, it makes the files but there 0kb big and dont contain the images

Yours
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 7th Jul 2009 17:57
I will have a look see if i can optimize the conversion its actually free image where you have to do the source destination thing ,also what should happen is it uses 1 memblock for conversion then it gets deleted , perhaps its not deleting them for some reason , will have a look for you later i`m a bit sore today cos of re-habilitation so my mind wont be on it .

chunks

also are you doing all the free image work before you convert to dbpro and not swapping between because that will slow it down , i`m sure you are though.

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 9th Jul 2009 19:12
Right i think i have sorted the memory problems , it seems stable now + i have added a few more commands , just need to do the proper help files now ,should be ready by the weekend .

Also i tested the saving to jpg and others and you are right they dont work , i can`t even get them to save jpgs in c++ with the free image , so i think it must be a bug with the lib , i will look into though , for now you can convert and save from dbpro .

thanks chunks.

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 9th Jul 2009 20:48
Sweet
and good idea, i'll just convert to dbpro and use save image command i am silly

Your
N3wton

chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 10th Jul 2009 17:26
Hi i have updated and finished the help files , it should now be more stable , please let me know of any bugs .


thanks chunks.

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-18 03:31:54
Your offset time is: 2024-04-18 03:31:54