Coder Social home page Coder Social logo

sharplibraw's Introduction

SharpLibraw

C#.NET wrapper around Libraw. Wrapper class rawlib.cs includes C# signatures for all external native methods from libraw.dll.

Try the demo console application Program.cs which demonstrates key libraw features, like:

  • initialize library
  • open raw file
  • export raw file to TIFF
  • export thumbnail from raw file to JPEG
  • load raw data, process it and export to Windows bitmap
  • error handling

Demo project

To successfully build wrapper and demo application the following steps are needed:

  • Download and install Visual Studio 2017 or 2019 Community Edition.
  • Open LibRAWDemo.sln solution file and start build.
  • The built executable LibRAWDemo.exe requires to have the included libraw.dll library in the same folder (should be there automatically)!
  • Note: 64bit build of the project is required, since the included libraw.dll is also a 64bit library!

Sample usage of wrapper

using System;
using static LibRAWDemo.RAWLib;

class Program {
	static void Main(string[] args) {
		var handler = libraw_init(LibRaw_init_flags.LIBRAW_OPTIONS_NONE);
		libraw_set_output_tif(handler, LibRaw_output_formats.TIFF);
		libraw_set_no_auto_bright(handler, 0);
		var r = libraw_open_file(handler, @"C:\Temp\RawFile01.cr2");
		if (r != LibRaw_errors.LIBRAW_SUCCESS) {
			Console.WriteLine("Open file:       " + PtrToStringAnsi(libraw_strerror(r)));
			libraw_close(handler);
			return;
		}
		r = libraw_unpack(handler);
		r = libraw_dcraw_process(handler);
		r = libraw_dcraw_ppm_tiff_writer(handler, @"C:\Temp\Processed01.tiff");
		libraw_close(handler);
	}
}

sharplibraw's People

Contributors

laheller avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.