nuthole.com "above us only ''Bob''"
contact:email
subscribe:feed
follow me on twitter:twitter
2009 04
Powered by Blosxom
Get Firefox!
geourl
subgenius
spampoison hosting rails

I Can't Believe I'm Not a Millionaire

posted by jack at 05:12 CET in / compute / programming feed

Last night, I gave a presentation at the Stockholm Cocoaheads meeting entitled "I Can't Believe I'm Not a Millionaire"about my experiences with Scribattle and Scribattle Lite on the App Store. Scribattle Lite had a short but intense "hit" period when it reached the #1 or #2 spot in most countries, and has now been downloaded over 1.5 million times! See more in the slideshow.

permalink | digg this | slashdot this | add to del.icio.us |
Comments
blog comments powered by Disqus

Anything below here is from the old commenting system, which is now disabled. Use the Disqus commenting system above instead!

Re: I Can't Believe I'm Not a Millionaire
Jin Ryu wrote on Fri, 10 Apr 2009 02:44

This program source displays the decoded image source which received data from socket to the screen. There is some problem in this source which I do not know... If I make comment the last end of the code ( [imgview setImage:processedImage] ) it works fine but image doesn't displays. but if I use the code ( [imgview setImage:processedImage] ) in the end of the code the program dies in 5 minute. I would like to know why.....

  retvalue = DecompressFrame(aBuffer, [data length], _rgbdata, buffersize);
   
   size_t pixelsWide = 176;
   size_t pixelsHigh = 144;
   int m_xy_size = pixelsWide * pixelsHigh;
   int             bitsPerComponent = 8;
   int             bitmapByteCount;
   int numberOfCompponents = 3;//CGColorSpaceGetNumberOfComponents(colorSpace); //always returns 3 -> unsupported parameter combination
   int bitsPerPixel = bitsPerComponent * numberOfCompponents;
   int bitmapBytesPerRow   = (pixelsWide * numberOfCompponents);
   bitmapByteCount     = (bitmapBytesPerRow * pixelsHigh);
   CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
  
   // È­¸é µÚÁý±â
   unsigned    char        *imageData;
   imageData = (unsigned char *)malloc(m_xy_size*3);
   memcpy(imageData, _rgbdata, m_xy_size*3 * sizeof(unsigned char));
   int i,j,k;
   for(j=0, k=pixelsHigh-1; j< pixelsHigh; j++, k--)
   { 
    for ( i = 0; i < pixelsWide; i++)
    {
    imageData[(j*pixelsWide+i)*3+2] = imageDataAsInts[(k*pixelsWide+i)+3];
    imageData[(j*pixelsWide+i)*3+1] = imageDataAsInts[(k*pixelsWide+i)*3+1];
    imageData[(j*pixelsWide+i)*3] = imageDataAsInts[(k*pixelsWide+i)*3+2];
    }
   } 
   
   CGDataProviderRef dataProvider = CGDataProviderCreateWithData(NULL, imageData, bitmapByteCount, NULL);
   
   CGImageRef cgImage = CGImageCreate(pixelsWide, pixelsHigh, bitsPerComponent,
              bitsPerPixel, bitmapBytesPerRow, colorSpace, kCGImageAlphaNone, 
              dataProvider, NULL, false, kCGRenderingIntentDefault);
   
   UIImage *processedImage = [UIImage imageWithCGImage:cgImage]; 
   CGDataProviderRelease(dataProvider);
   CGColorSpaceRelease(colorSpace);
   
   [imgview setImage:processedImage];
Re: I Can't Believe I'm Not a Millionaire
Jack wrote on Fri, 10 Apr 2009 17:56

Well Jin, I don't have an immediate answer for you I'm afraid. You might want to post this question to the cocoa-dev or macosxdev lists, where more people will see it, including pehaps someone who can see what the problem is. Good luck!


Looking for programming talent that doesn't make you say "WTF!"? Try the hidden network.