source: libpipi/trunk/pipi/accessors.c @ 4690

Last change on this file since 4690 was 2902, checked in by Sam Hocevar, 12 years ago

Support C99 types on Win32 through the same hacks as in libcaca.

File size: 1.3 KB
Line 
1/*
2 *  libpipi       Pathetic image processing interface library
3 *  Copyright (c) 2004-2008 Sam Hocevar <sam@zoy.org>
4 *                2008 Jean-Yves Lamoureux <jylam@lnxscene.org>
5 *                All Rights Reserved
6 *
7 *  $Id$
8 *
9 *  This library is free software. It comes without any warranty, to
10 *  the extent permitted by applicable law. You can redistribute it
11 *  and/or modify it under the terms of the Do What The Fuck You Want
12 *  To Public License, Version 2, as published by Sam Hocevar. See
13 *  http://sam.zoy.org/wtfpl/COPYING for more details.
14 */
15
16/*
17 * accessors.c: accessors for various informations about images
18 */
19
20#include "config.h"
21
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
25
26#include <math.h>
27
28#include "pipi.h"
29#include "pipi_internals.h"
30
31int pipi_get_image_width(pipi_image_t *img)
32{
33    return img->w;
34}
35int pipi_get_image_height(pipi_image_t *img)
36{
37    return img->h;
38}
39int pipi_get_image_pitch(pipi_image_t *img)
40{
41    return img->pitch;
42}
43int pipi_get_image_last_modified(pipi_image_t *img)
44{
45    return img->last_modified;
46}
47
48
49
50char formats[][100] =
51{
52    "Unknow",
53    "RGBA_C",
54    "BGR_C",
55    "RGBA_F",
56    "Y_F",
57    "MASK_C",
58    "LOL",
59};
60
61const char* pipi_get_format_name(int format)
62{
63    if(format>PIPI_PIXELS_MAX) return "Invalid";
64    else return formats[format];
65}
Note: See TracBrowser for help on using the repository browser.