3_27_02
Ok, main point for today is: Accessing a bitmap in memory!
Anything past that is just bonus for what I want to accomplish today.
Log:
Doing some yahoo searches for:
loadbitmap and Hbitmap
-------------------------
OK, I may be on to something... www.gamedev.net showed me a relation between hwnd and HDC!
HDC GetDC(HWND hwnd)
I have 'hwnd' so now I can get a HDC... Lets see how this works.
Well, I try and debug in directX and it locks up my computer + forces a reboot... So I'm rebooting now. It compiled, but I need to figure out how to debug, prolly will need to make a file logger or something. This will suck.
Whats really annoying is that I'm on day 2 of something that takes like 2 seconds to do in DJGPP/GCC. It shouldn't even be a problem
OK, so I made the damned logger. It would be so nice just to use visual c++ watches, but its out of the question.
I had to copy/paste over some functions I wrote in another program:
Getline - gets a line of text from a file
Putline - Puts a line of text into a file
You'd think M$ would provide you with basic functions like this, but no.
Anyway my logger is done, no use ranting on it anymore, aside from the fact that every time I run the program, I need to resize Visual C's window 2 times to get it back to normal. This is what cavemen must have felt when they coded.
Alright... so I was able to get a pixel.
Now lets see if I can get a pixel from the image I want to process.
Nope, I'm still getting 255 for every value from get pixel...
Time to look for more getpixel examples on the net. This is such an amazing hassle for such a small thing.
Hours and hours go by...
Stuff like this pisses me off.
I go to the directx documentation... Type in CreateSurfaceFromBitmap, which is a directX function. No results returned
Yahoo.com has no results returned.
trying to learn CDisplay and CSurface now.
OMG, there is like no documentation anywhere for these functions
Ok, I spent all day on this. I'm super depressed, going to bed.
-------------------------------------------------------
Ok, laying in bed, I realized that I don't need Visual C++ to do the pixel operations on an image. I can program this in Djgpp, and when someone is nice enough to show me how to interpret pixels in Visual C++, then I can transfer it over. I need to use Visual C++ because I'm fairly certain its the only language that supports real time camera input.
So I'm whipping out the good ol DJGPP :)
***I also realized that once I can get edge detection kicking, then I can write calibration routines that judge a user's height/weight, and can tell the person's clothing. Calibration routines will be the first step I take in converting the images to 3d :) ***+
Ok, figuring out where I left DJGPP on my computer and setting up a project...
In the time of 5 minutes, I compiled my old MMORPG, made a new project, and I'm totally ready to start coding. Quite the opposite of Visual C++... Its funny that a program people made for free is superior in most every way to a program people get overly paid to make.
And to top it off, it works on my 2nd computer simply by me loading up the backup, no freaking registry checks that Microsoft likes to play. I wrestled with Visual C++ for a solid 20 hours.
------------------------------------------------------------
8:52 AM 3/27/02
Now that I have a compiler that is solid, time to get gears moving:
1) Load image
2) Display image
3) Play with pixels
4) Develop and apply a mask.
5) Display the resultant edges.
6) Debug some.
7) Draw lines around edges.
8) Go to 3d and do calibration stances.
-------------------------------------------------------------
Log:
8:58 AM 3/27/02- Converted pattern1.bmp to pattern1.pcx and saved it in the DJGPP directory.
9:10 AM 3/27/02 Ok, DJGPP isn't so great either, its giving me segmentation faults in some stuff I ran earlier with no problems.
9:15 AM 3/27/02 Its working fine now.
9:28 AM 3/27/02 Ok, now I'm trying to understand pallete data for true color, 24 bit pallete mode. I want a great deal of color data, and not be restricted by ghetto 256 color mode.
9:38 AM 3/27/02 Found my answer on the first webpage I looked:http://www.talula.demon.co.uk/allegro/truecol.html
"Short answer:
Call set_color_depth() before set_gfx_mode()."
How convienient.
9:39 AM 3/27/02 Now I am to interpret the data in each pixel, should be fairly easy.
9:45 AM 3/27/02 Got it :) Now I need to display it on the screen for the heck of it.
9:52 AM 3/27/02 Ok, I did that :) I now have complete control over my image. MUWAHAHAHAH! Now the fun begins. So basically its breaktime where I sit down with pencil and paper and sculpt out the first mask I feel like using.