Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing x and y coordinates a puzzle

Status
Not open for further replies.

Chrissirhc

Programmer
May 20, 2000
926
GB
Hello I making a memmory intensive program. I need to store the coordinates of pixels in an array. I was thinking of making a point object that takes in an x and y integer and that is it. Will this object take up more memmory than just the two integers. This is important as my there are about 2000000 pixels. Is this the best way to do it.

I couldn't represent the data just using arrays I think. What I need is to have an array which holds a x and y coord for a pixel and then what label it has i.e position x=5 y=7 could belong to the no. 8 family. How else could this be represented. Also the label must be equal to the index.

With my own point object I could have an int[label]=point;

Any suggestions?

Thanks in advance
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top