title: Using 3d-LUT files (*.cube) in CIColorCube - formatting issue?
body: <p>I am trying to wrap a <code>*.cube</code> file (which is one of many 3d-LUTs formats) into
  <code>NSData</code> for use as data input for the <code>CIColorCube</code> filter.</p>
  
  <p>The LUTs I'm using are of dimension 32 and although I think we got the length right,
  the result is solid gray. My LUTs are 32*32*32 lines of triplets but now I suspect that <code>CIColorCube</code> expects a fourth number representing Alpha. is this correct?</p>
  
  <p>All values in my tables are already premultiplied and are of the range <code>0.0 - 1.0</code>. My latest attempt was editing my tables and adding 1 as a fourth number in each row. I also deleted any title and text from the original <code>*.cube</code> file and saved as <code>*.txt</code>. Then I calculated the data length as <code>32*32*32*4*sizeof(float)</code> and used 32 as Cube dimension. In this case, I did not receive an error about unexpected length, but the result was all wrong.</p>
  
  <p>Below is the code we are using. The code uses the new <code>*.txt</code> file but of course we first started out
  with the original <code>*.cube</code>. Is this a formatting issue?</p>
  
  <p>Below the code is a snippet from the original <code>*.cube</code> file and a snippet from my edited 
  <code>*.txt</code> attempt.</p>
  
  <pre><code>NSString *docsDir = [[NSBundle mainBundle] resourcePath];
  NSString *soundFilePath=[[NSString alloc] init];
  soundFilePath=[docsDir stringByAppendingPathComponent:@"Inkwell-withAlpha.txt"];
  NSData *testData = [NSData dataWithContentsOfFile:soundFilePath];
  NSData * cube_data =[NSData dataWithBytes:testData.bytes length:32*32*32*4*sizeof(float)];
  CIFilter *filter = [CIFilter filterWithName:@"CIColorCube"];
  [filter setValue:_ciImage forKey:kCIInputImageKey];
  [filter setValue:@2 forKey:@"inputCubeDimension"];
  [filter setValue:cube_data forKey:@"inputCubeData"];
  
  CIImage *outImage = filter.outputImage;
  CIContext *context = [CIContext contextWithOptions:nil];
  CGImageRef outputImageRef = [context createCGImage:outImage fromRect:[outImage extent]];
  previewImageView.image = [UIImage imageWithCGImage:outputImageRef];
  </code></pre>
  
  <p><strong>Sample from the start of the original *.cube file:</strong></p>
  
  <pre><code>TITLE "Inkwell"
  LUT_3D_SIZE 32
  0.0000 0.0000 0.0000
  0.0000 0.0000 0.0000
  0.0000 0.0000 0.0000
  0.0039 0.0039 0.0039
  0.0235 0.0235 0.0235
  0.0353 0.0353 0.0353
  0.0549 0.0549 0.0549
  0.0745 0.0745 0.0745
  0.0863 0.0863 0.0863
  ...
  </code></pre>
  
  <p><strong>Sample from start of the *.txt file i'm trying to read:</strong></p>
  
  <pre><code>0.0000 0.0000 0.0000 1
  0.0000 0.0000 0.0000 1
  0.0000 0.0000 0.0000 1
  0.0039 0.0039 0.0039 1
  0.0235 0.0235 0.0235 1
  0.0353 0.0353 0.0353 1
  0.0549 0.0549 0.0549 1
  ... 
  </code></pre>