المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Data structure advice



C# Programming
12-15-2009, 07:53 PM
Hi,

I am attempting to create a simple region growing image program. The idea is that these regions will become "nodes" for the next part of my project. I just need a bit of advice of a good easy way to store the pixel data.

At the moment I have a Class called PixelData that holds x/y ********, pixel color value and a Label ("F"- free/ "A"-allocated etc) of all the pixels in a grayscale image. This is all held by a List. I have a node class that will hold the pixels that it consumes.

So the idea is that a random seed point will be selected, and that the PixelData list will change that pixel lable to "A" for allocated and also add it to the node class. Over time lots of pixels in the PixelData list will become Allocated by the node, and the node class's list of pixels will grow.

This is the first way that came to me. Can anyone recommend a better or simpler way? Speed isnt a necessity at this stage, I just want to get something working.

Regards.