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

Last change on this file since 2844 was 2844, checked in by Sam Hocevar, 11 years ago

Fix headers.

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#include "common.h"
22
23#include <stdio.h>
24#include <stdlib.h>
25#include <string.h>
26
27#include <math.h>
28
29#include "pipi.h"
30#include "pipi_internals.h"
31
32int pipi_get_image_width(pipi_image_t *img)
33{
34    return img->w;
35}
36int pipi_get_image_height(pipi_image_t *img)
37{
38    return img->h;
39}
40int pipi_get_image_pitch(pipi_image_t *img)
41{
42    return img->pitch;
43}
44int pipi_get_image_last_modified(pipi_image_t *img)
45{
46    return img->last_modified;
47}
48
49
50
51char formats[][100] =
52{
53    "Unknow",
54    "RGBA_C",
55    "BGR_C",
56    "RGBA_F",
57    "Y_F",
58    "MASK_C",
59    "LOL",
60};
61
62const char* pipi_get_format_name(int format)
63{
64    if(format>PIPI_PIXELS_MAX) return "Invalid";
65    else return formats[format];
66}
Note: See TracBrowser for help on using the repository browser.