source: libpipi/trunk/pipi/codec.c @ 2605

Last change on this file since 2605 was 2605, checked in by Sam Hocevar, 12 years ago
  • Big API reorganisation. Now libpipi can transparently convert between colour spaces for a given image. For instance, if pipi_gaussian_blur is applied to a 32-bpp image, it is automatically converted to gamma-corrected 32-bit floats beforehands, then converted back to normal.
  • TODO: clipping, regions of interest, more formats, getpixel macros...
File size: 1.5 KB
Line 
1/*
2 *  libpipi       Proper image processing implementation library
3 *  Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org>
4 *                All Rights Reserved
5 *
6 *  $Id$
7 *
8 *  This library is free software. It comes without any warranty, to
9 *  the extent permitted by applicable law. You can redistribute it
10 *  and/or modify it under the terms of the Do What The Fuck You Want
11 *  To Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15/*
16 * codec.c: image I/O functions
17 */
18
19#include <stdio.h>
20#include <stdlib.h>
21
22#include "config.h"
23#include "common.h"
24
25#include "pipi.h"
26#include "pipi_internals.h"
27
28pipi_image_t *pipi_load(const char *name)
29{
30#if USE_SDL
31    return pipi_load_sdl(name);
32#elif USE_IMLIB2
33    return pipi_load_imlib2(name);
34#elif USE_OPENCV
35    return pipi_load_opencv(name);
36#else
37#   error "No imaging library"
38#endif
39}
40
41pipi_image_t *pipi_new(int width, int height)
42{
43#if USE_SDL
44    return pipi_new_sdl(width, height);
45#elif USE_IMLIB2
46    return pipi_new_imlib2(width, height);
47#elif USE_OPENCV
48    return pipi_new_opencv(width, height);
49#endif
50}
51
52void pipi_free(pipi_image_t *img)
53{
54#if USE_SDL
55    return pipi_free_sdl(img);
56#elif USE_IMLIB2
57    return pipi_free_imlib2(img);
58#elif USE_OPENCV
59    return pipi_free_opencv(img);
60#endif
61}
62
63void pipi_save(pipi_image_t *img, const char *name)
64{
65#if USE_SDL
66    return pipi_save_sdl(img, name);
67#elif USE_IMLIB2
68    return pipi_save_imlib2(img, name);
69#elif USE_OPENCV
70    return pipi_save_opencv(img, name);
71#endif
72}
73
Note: See TracBrowser for help on using the repository browser.