GithubHelp home page GithubHelp logo

fplibraw's Introduction

FPLibRaw

FreePascal wrapper around Libraw. It was written using Lazarus IDE powered by FreePascal. Wrapper unit libraw.pas includes pascal signatures for all external native methods from libraw.dll.

Try the demo console application demo.pas 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 latest 64bit version of Lazarus IDE (also installs FreePascal).
  • Open demo.lpi project file in Lazarus (Ctrl+F11) and build (Shift+F9).
  • The built executable demo.exe requires to have the included libraw.dll library in the same folder!
  • Note: 64bit build of the project is required, since the included libraw.dll is also a 64bit library!

Sample usage of wrapper

program Sample;
uses Crt, Libraw;
var
	handler: Pointer;
	err: LibRaw_errors;
begin
	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);
	err := libraw_open_file(handler, 'C:\Temp\RawImage01.CR2');
	if (err <> LibRaw_errors.LIBRAW_SUCCESS) then begin
		WriteLn('Open:            ' + libraw_strerror(err));
		libraw_close(handler);
		Write('Press any key...');
		ReadKey;
		Exit;
	end;
	err := libraw_unpack(handler);
	libraw_dcraw_process(handler);
	libraw_dcraw_ppm_tiff_writer(handler, 'C:\Temp\ProcessedImage01.tiff');
	libraw_close(handler);
end.

fplibraw's People

Contributors

laheller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

khongten001

fplibraw's Issues

Cross-platform

Are there possibilities to adapt the Libraw DLL code to Linux, Mac and Raspberry-Pi arm processor?

Han

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.