Logo Search packages:      
Sourcecode: ziproxy version File versions  Download package

image.h

/* image.h
 * Part of ziproxy package
 *
 * Copyright (c)2003-2004 Juraj Variny<variny@naex.sk>
 * Copyright (c)2005-2008 Daniel Mealha Cabrita
 *
 * Released subject to GNU General Public License v2 or later version.
 *
 * Image reading/writing wrappers.
 */

#include "http.h"

//If this is included in image.c, make declarations local.
#ifdef SRC_IMAGE_C
#define EXTERN
#else
#define EXTERN extern
#endif 

//To stop multiple inclusions.
#ifndef SRC_IMAGE_H
#define SRC_IMAGE_H


enum {OTHER_CONTENT, IMG_PNG, IMG_GIF, IMG_JPEG, IMG_JP2K, TEXT_HTML, TEXT_CSS, APPLICATION_JAVASCRIPT};
enum {err_ok,err_bad_data_format,err_out_of_mem, err_unknown, err_not_impl_yet,err_possible_look_change,
      while_decomp = 100, while_transform = 150, while_compress = 200};
enum enum_color_space {CENC_RGB, CENC_YUV}; // only applies to color images, irrelevant to mono (LUMA) images
#define t_color_space enum enum_color_space

#define I_PALETTE (1<<1)
#define I_TRANSPARENT (1<<2)

//In case flags contains this, look for error code?.
#define I_ERROR (1<<15)

/* Components of raster/palette entries are known from bpp:
 * 1 -> Grayscale (Y)
 * 2 -> Y + Alpha (255 = opaque 0 = transparent)
 * 3 -> RGB (may contain YUV version in alternate buffer)
 * 4 -> RGB (may contain YUV version in alternate buffer) + Alpha
 */

typedef struct {
      unsigned char * raster; //For paletted images
      unsigned char * palette;
      unsigned char * bitmap; //For grayscale/truecolor RGB images (always present and the default bitmap)
      unsigned char * bitmap_yuv; //For truecolor YUV images (allocated on demand)
      int pal_entries;
      int width, height;
      int pal_bpp, bpp;
} raw_bitmap;

//EXTERN raw_image *new_raw_image(int height, int width, int bpp, int flags);
EXTERN int detect_type(char *line, int len);

EXTERN int compress_image(http_headers *serv_hdr, http_headers *client_hdr, char *inbuf, int insize, char ** outb, int *outl);      

#endif //SRC_IMAGE_H

#undef EXTERN

Generated by  Doxygen 1.6.0   Back to index