Below is the code I used for Below is the code I used for processing that Sory A73 ARW file with the pink/purple cast. Am I doing something wrong? LibRaw *rawProcessor = new LibRaw; CIImage *ciImage = nil; // Set up image processing parameters rawProcessor->imgdata.params.half_size = 1; rawProcessor->imgdata.params.user_qual = 0; rawProcessor->imgdata.params.use_camera_wb = 1; rawProcessor->imgdata.params.use_auto_wb = 0; rawProcessor->imgdata.params.no_auto_bright = 1; rawProcessor->imgdata.params.exp_correc = 1; rawProcessor->imgdata.params.exp_shift = 2.3; rawProcessor->imgdata.params.use_rawspeed = 0; rawProcessor->imgdata.params.user_flip = 0; // Do not rotate image, let the caller do it if (rawProcessor->open_file([filePath UTF8String]) == LIBRAW_SUCCESS) { int ret = rawProcessor->unpack(); if (ret == LIBRAW_SUCCESS) { ret = rawProcessor->dcraw_process(); if (ret == LIBRAW_SUCCESS) { libraw_processed_image_t *imageData = rawProcessor->dcraw_make_mem_image(&ret); rawProcessor->recycle(); // make data provider from buffer CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, imageData->data, imageData->data_size, NULL); // set up for CGImage creation int bitsPerComponent = imageData->bits; int bitsPerPixel = imageData->bits * imageData->colors; int bytesPerRow = bitsPerPixel / 8 * imageData->width; int width = imageData->width; int height = imageData->height; CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); CGImageRef imageRef = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, kCGBitmapByteOrderDefault, provider, NULL, NO, kCGRenderingIntentDefault); ciImage = [CIImage imageWithCGImage:imageRef]; // Free memory CFRelease(colorSpaceRef); CFRelease(imageRef); CFRelease(provider); LibRaw::dcraw_clear_mem(imageData); // Auto adjust image NSDictionary *options = @{ CIDetectorImageOrientation : [NSNumber numberWithInt:1], kCIImageAutoAdjustRedEye : [NSNumber numberWithBool:NO]}; NSArray *adjustments = [ciImage autoAdjustmentFiltersWithOptions:options]; for (CIFilter *filter in adjustments) { // Do not apply tone curve, as it can make the contrast too high if ([[filter name] isNotEqualTo:@"CIToneCurve"]) { [filter setValue:ciImage forKey:kCIInputImageKey]; ciImage = filter.outputImage; } } } } } delete rawProcessor; return ciImage; Kuro reply
Below is the code I used for processing that Sory A73 ARW file with the pink/purple cast.
Am I doing something wrong?