• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Data Structure to Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Data Structure to Data
      • From: "Kyle Sluder" <email@hidden>
References: 
 >Data Structure to Data (From: "Bruce Johnson" <email@hidden>)
 >Re: Data Structure to Data (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: custom view reference from inside control.
  • Next by Date: Re: System preferences panes on Leopard
  • Previous by thread: Re: Data Structure to Data
  • Next by thread: Re: Data Structure to Data
  • Index(es):
    • Date
    • Thread