source: libpipi/trunk/pipi/pipi.c @ 2629

Last change on this file since 2629 was 2629, checked in by Sam Hocevar, 14 years ago
  • pipi.c: reimplement pipi_new() without relying on the underlying codec library, so we can have several or none of them at some time.
  • sdl.c imlib.c: allow to save images that weren't created using the current codec.
File size: 1.0 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 * pipi.c: core library routines
17 */
18
19#include "config.h"
20#include "common.h"
21
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
25
26#include "pipi.h"
27#include "pipi_internals.h"
28
29/*
30static int init = 0;
31
32void _pipi_init(void)
33{
34    if(init)
35        return;
36
37    _pipi_init_pixels();
38}
39*/
40
41pipi_image_t *pipi_new(int w, int h)
42{
43    pipi_image_t *img;
44
45    img = malloc(sizeof(pipi_image_t));
46    memset(img, 0, sizeof(pipi_image_t));
47
48    img->w = w;
49    img->h = h;
50    img->last_modified = PIPI_PIXELS_UNINITIALISED;
51
52    return img;
53}
54
Note: See TracBrowser for help on using the repository browser.