Recent comments

Reply to: compiling with mingw for Qt   13 years 3 weeks ago

ntohs is in libws2_32 library, so you need to add this lib to your linker command line.

Reply to: Shared library   13 years 3 weeks ago

libraw.so (generic), and so.2 (generic version 2) should be symlinks to so.2.0.5 (exact version).

You need to specify -lraw to linker command line and linker will do all magic.

Reply to: Shared library   13 years 3 weeks ago

Got this to work, cross compiling for android. So I want libraw.so.2? I have libraw.a, libraw.so, libraw.so.2, libraw.so.2.0.5 (all exact same size)

Reply to: RAW format of PENTAX K5   13 years 3 weeks ago

Pentax K5 images works fine since LibRaw 0.11.2 released on November 11, 2010.

Reply to: Shared library   13 years 3 weeks ago

Starting with version 0.13.2, LibRaw supports shared libraries.

Just use ./configure (then make && make install) and you'll get libraw.so.2 in your /usr/local/lib

Reply to: Shared library   13 years 3 weeks ago

I need to compile LibRaw as a .so (to use on Android) I'm going to try my hand at making these patches, but I have no idea what I'm doing. If you could provide some help, I'd very much appreciate it lexa! ;)

Reply to: Question about "maximum", "channel_maximum[4]" data fields and an observaition...   13 years 4 weeks ago

Thank you for your reply. Writing a simple program cannot reproduce the problem (four_color/half_size). So the error is somewhere in my own code. For the moment I cannot find it but I will.
Thanks again.

Reply to: highlight recovery regression...   13 years 1 month ago

For -H 2 and -H 9 the results are bitwise the same for dcraw and dcraw_emu (from 0.13.5) and my sample image (something with blown clouds)

The difference may be in auto-maximum feature in LibRaw (very useful for some cameras). To turn this feature off use -c 0 switch when running dcraw_emu:

dcraw_emu -c 0 -H 2

Reply to: highlight recovery regression...   13 years 1 month ago

Unfortunately, I'm unable to download your sample, file not found.

Reply to: Question about "maximum", "channel_maximum[4]" data fields and an observaition...   13 years 1 month ago

four_color_rgb value is saved in the beginning of dcraw_process() call, may be changed by half_size setting, but restored again at the end of dcraw_process(), just before return. (LibRaw 0.13.5)

Could you please provide sample code with errorneous four_color_rgb/half_size behaviour?

Reply to: Question about "maximum", "channel_maximum[4]" data fields and an observaition...   13 years 1 month ago

You're right, positive exposure shift without highlights compression will not affect entire image with default processing options, because data will be scaled to full 0..65535 range on postprocessing.

Anyway, positive exposure correcton is useful if
1) Manual data scaling is selected
2) Or highlights compression is non-zero.

Thank you for four_color/half_size report, I'll check.

Sorry for delayed answer, just returned from long vacation trip to Mongolia without any internet access....

Reply to: highlight recovery regression...   13 years 1 month ago

Thanks for report, to be tested.

Sorry for delayed answer, summer is vacation time.

Reply to: ./configure failing on OS X   13 years 1 month ago

According to configure output, your Xcode package is not installed correctly. The gcc is unable to compile small test program:

configure:2940: g++ conftest.cpp >&5
ld: library not found for -lcrt1.10.6.o

I've tested the configure script under 10.6.8 with Xcode 4.x without any minor problem. I've used Xcode 3.x several months ago without any problem too.

Reply to: Festina Lente   13 years 3 months ago

Well, those comments are for raw converter developers.

Reply to: Festina Lente   13 years 4 months ago

Where is the floating point implementation?

Elle Stone

Reply to: Festina Lente   13 years 4 months ago

Iliah, You say "It looks like the time spent in postprocessing to get more details and counter-act artifacts might be better spent if demosaicking prepares a cleaner and more detailed image to start with. The processing time difference between integer and floating point implementations of demosaicking most of the times is less than 5 seconds, which is substantially less compared to the time spent on image editing to get close to the same result. Try it, and you will see. "

How does one go about "trying it" to see? What about this comment:
"For float data output we need to change entire processing pipeline to floating point." from http://www.libraw.org/about?

Elle Stone

Reply to: Unscaled 16 bit RGB access   13 years 4 months ago

The data scaling is performed before interpolation.

So, there is no way to get debayered and unscaled data. You may remove call to scale colors or rewrite this call (LibRaw::scale_colors) if you wish.

Reply to: half_size and dcraw_make_mem_image()   13 years 5 months ago

Perfect, everything works. Thank you!

Reply to: half_size and dcraw_make_mem_image()   13 years 5 months ago

The problem is very simple:
- you have set half_size=1 *after* unpack is called. So for the very first run the half_size is not set for unpack stage but set for postprocessing stage.

But half_size option is heavily used on unpack() stage (only 1/4 of image array allocated, pixel data placement is very different).

You need to move
rawProcessor_.imgdata.params.half_size = 1;
line above of unpack() call.

Reply to: half_size and dcraw_make_mem_image()   13 years 5 months ago

The case is confirmed, your code really produces different first image (have not looked into it, but see by different MD5 sums).

Thanks again for your bug report. I'll write another comment here when bug will be fixed

Reply to: half_size and dcraw_make_mem_image()   13 years 5 months ago

I'm using LibRaw 0.13.1. I've tested on Windows and macosx; and in each case there is a difference between the first and the second decoded image.

Reply to: half_size and dcraw_make_mem_image()   13 years 5 months ago

Thanks for bug report.
It looks very strange for me because I use half_mode in my programs without any problem, but I'll test your code sample.

What version of LibRaw do you use?

Reply to: half_size and dcraw_make_mem_image()   13 years 5 months ago
#ifdef WIN32
// suppress sprintf-related warning. sprintf() is permitted in sample code
#define _CRT_SECURE_NO_WARNINGS
#endif
 
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#ifndef WIN32
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/time.h>
#endif
 
#include "libraw/libraw.h"
#ifdef WIN32
#define snprintf _snprintf
#include <windows.h>
#endif
 
 
void write_ppm(libraw_processed_image_t *img, const char *basename)
{
    if(!img) return;
    // type SHOULD be LIBRAW_IMAGE_BITMAP, but we'll check
    if(img->type != LIBRAW_IMAGE_BITMAP) return;
    // only 3-color images supported...
    if(img->colors != 3) return;
 
    char fn[1024];
    snprintf(fn,1024,"%s.ppm",basename);
    FILE *f = fopen(fn,"wb");
    if(!f) return;
    fprintf (f, "P6\n%d %d\n%d\n", img->width, img->height, (1 << img->bits)-1);
/*
  NOTE:
  data in img->data is not converted to network byte order.
  So, we should swap values on some architectures for dcraw compatibility
  (unfortunately, xv cannot display 16-bit PPMs with network byte order data
 
#define SWAP(a,b) { a ^= b; a ^= (b ^= a); }
    if (img->bits == 16 && htons(0x55aa) != 0x55aa)
        for(unsigned i=0; i< img->data_size; i+=2)
            SWAP(img->data[i],img->data[i+1]);
#undef SWAP
*/
    fwrite(img->data,img->data_size,1,f);
    fclose(f);
}
 
int main(int argc, char *argv[])
{
	char filename[] = "raw_canon_550d.cr2";
	LibRaw rawProcessor_;
	int rc;
	for (int i = 0; i < 10; i++)
	{
		libraw_processed_image_t* rawImg = NULL;
		rc = rawProcessor_.open_file(filename);
		rc = rawProcessor_.unpack();
		rawProcessor_.imgdata.params.filtering_mode = LIBRAW_FILTERING_AUTOMATIC;
		rawProcessor_.imgdata.params.output_bps = 16; // Write 16 bits per color value
//		rawProcessor_.imgdata.params.gamm[0] = rawProcessor_.imgdata.params.gamm[1] = 1.0; // linear gamma curve
//		rawProcessor_.imgdata.params.no_auto_bright = 1; // Don't use automatic increase of brightness by histogram.
		rawProcessor_.imgdata.params.document_mode = 0; // standard processing (with white balance)
		rawProcessor_.imgdata.params.use_camera_wb = 1; // If possible, use the white balance from the camera.
		rawProcessor_.imgdata.params.half_size = 1;
		rc = rawProcessor_.dcraw_process();
		rawImg = rawProcessor_.dcraw_make_mem_image(&rc);
		char ppmfname[128];
		snprintf(ppmfname,1024,"%04i",i);
		write_ppm(rawImg, ppmfname);
		rawProcessor_.dcraw_clear_mem(rawImg);
		rawProcessor_.recycle();
	} 
	return 0;
}
//not truncated
Reply to: random Crash with CRW file in memory stream   13 years 5 months ago

If i read doc, i can use it's memory stream which received file :/ but random crash appear. It's like stream size is incorrect (and it's possible ^^).

Now it's works perfectly for me when i'm embded my memory to edsdk MemoryStream.

For edsdk, you probably wait a long time before receive an answer...

Pages