Re: Data Structure to Data
Re: Data Structure to Data
- Subject: Re: Data Structure to Data
- From: "Bruce Johnson" <email@hidden>
- Date: Fri, 18 Jan 2008 08:25:13 -0800
typedef struct{
unsigned int xsize, ysize, channels;
char fname[255];
unsigned int *pixels;
} foo;
then in code I do something like:
foo *myStructFoo = (foo *) malloc (sizeof(foo));
then later I fill in the unsigned int and char variables
myStructFoo->xsize = 512;
myStructFoo->ysize = 512;
myStructFoo->channels; = 3;
strcpy(myStructFoo->fname, "out.tif");
...etc;
myStructFoo->pixels = (unsigned int *) malloc (myStructFoo->xsize
* myStructFoo->ysize* myStructFoo->channels*sizeof(unsigned int));
the struct also contains a large list of metadata information set as
unsigned ints as well. All these I can access going to and from a CFData
object. It is the pixel data that goes null. I am assuming that when I
create CFData object, it isn't dereferencing the pixel data pointer.
thanks
On Jan 17, 2008 10:43 PM, Kyle Sluder <email@hidden>
wrote:
> You need to post your actual struct for this to make sense. I can
> only assume it's something like:
>
> struct foo
> {
> unsigned int xsize, ysize, channels;
> unsigned int pixels[];
> }
>
> --Kyle Sluder
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
--
----
Bruce Johnson
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden