/usr/include/crystalspace-2.0/igraphic/imageio.h is in libcrystalspace-dev 2.0+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | /*
Copyright (C) 1998 by Jorrit Tyberghein
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __CS_IGRAPHIC_IMAGEIO_H__
#define __CS_IGRAPHIC_IMAGEIO_H__
/**\file
* Image input/output interface
*/
/**
* \addtogroup gfx2d
* @{ */
#include "csutil/scf.h"
#include "csutil/array.h"
struct iDataBuffer;
struct iImage;
/** \internal
* Format can be read.
*/
#define CS_IMAGEIO_LOAD 1
/** \internal
* Format can be written.
*/
#define CS_IMAGEIO_SAVE 2
/// Description for a file format supported by an image loader.
struct csImageIOFileFormatDescription
{
/// mime type of image, e.g. "image/png"
const char *mime;
/// descriptive format specifier, e.g. "8 bit palettized"
const char *subtype;
/// a combination of CS_IMAGEIO_* flags
int cap;
};
/// Description for the array of file formats.
typedef csArray<csImageIOFileFormatDescription const*>
csImageIOFileFormatDescriptions;
/**
* The iImageIO interface is used to save and load graphic files.
*
* Main creators of instances implementing this interface:
* - Image loader multiplexer plugin
* (crystalspace.graphic.image.io.multiplexer) and all image loader plugins.
*
* Main ways to get pointers to this interface:
* - csQueryRegistry<iImageIO> ()
*
* Main users of this interface:
* - Application.
* - Loader.
*/
struct iImageIO : public virtual iBase
{
SCF_INTERFACE (iImageIO, 2, 0, 0);
/// Description for a file format supported by an image loader.
typedef csImageIOFileFormatDescription FileFormatDescription;
/**
* Propagate the image fileformats handled by this plugin.
*/
virtual const csImageIOFileFormatDescriptions& GetDescription () = 0;
/**
* Load an image from a buffer.<p>
* This routine will read from the buffer buf , try to
* recognize the type of image contained within, and return an csImageFile
* of the appropriate type. Returns a pointer to the iImage on
* success, or 0 on failure. The bits that fit the CS_IMGFMT_MASK
* mask are mandatory: the image always will be loaded in the
* appropiate format; the bits outside that mask (i.e. CS_IMGFMT_ALPHA)
* are optional: if the image does not contain alpha mask, the GetFormat()
* method of the image will return a value without that bit set.
*/
virtual csPtr<iImage> Load (iDataBuffer* buf, int iFormat) = 0;
/**
* Save an image using a prefered format.<p>
* <code>extraoptions</code> allows to specify additional output options.
* Those options consist of a comma-separated list and can be either 'option'
* or 'option=value'. The available options vary from plugin to plugin, some
* common ones are:<p>
* <code>compress=#</code> - Set image compression, from 0..100. Higher
* values give smaller files, but at the expense of quality(e.g. JPEG) or
* speed(e.g. PNG).<br>
* <code>progressive</code> - Progressive/interlaced encoding.<p>
* Examples:<br>
* <code>compress=50</code><br>
* <code>progressive,compress=30</code>
*/
virtual csPtr<iDataBuffer> Save (iImage *image, FileFormatDescription *format,
const char* extraoptions = 0) = 0;
/**
* Save an image using format MIME.
* If omitted format selection is left to the plugin.
*/
virtual csPtr<iDataBuffer> Save (iImage *image, const char *mime = 0,
const char* extraoptions = 0) = 0;
};
/** @} */
#endif // __CS_IGRAPHIC_IMAGEIO_H__
|