pike.git / src / modules / Image / encodings / wbf.c

version» Context lines:

pike.git/src/modules/Image/encodings/wbf.c:1:   #include "global.h"      #include <math.h>   #include <stdio.h>   #include <ctype.h>      #include "stralloc.h" - RCSID("$Id: wbf.c,v 1.8 2001/04/17 09:00:50 per Exp $"); + RCSID("$Id: wbf.c,v 1.9 2001/11/07 22:03:03 nilsson Exp $");   #include "pike_macros.h"   #include "object.h"   #include "mapping.h"   #include "constants.h"   #include "interpret.h"   #include "operators.h"   #include "svalue.h"   #include "threads.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/modules/Image/encodings/wbf.c:23:   #include "image.h"   #include "builtin_functions.h"   #include "module_support.h"      /* MUST BE INCLUDED LAST */   #include "module_magic.h"         extern struct program *image_program;    - /* - **! module Image - **! submodule WBMP - **! WAP WBMP format + /*! @module Image    */    -  + /*! @module WBMP +  *! WAP bitmap format - WBMP. +  */ +    struct buffer   {    size_t len;    unsigned char *str;   };      struct ext_header   {    struct ext_header *next;    char name[8];
pike.git/src/modules/Image/encodings/wbf.c:284:    break;       default:    free_string( s );    free_wbf_header_contents( &wh );       Pike_error("Unsupported wbf image type.\n");    }   }    + /*! @decl object decode(string image) +  *! +  *! @fixme +  *! Document this function. +  */ +    static void image_f_wbf_decode( int args )   {    low_image_f_wbf_decode( args, 2 );   }    -  + /*! @decl mapping _decode(string image) +  *! +  *! @fixme +  *! Document this function. +  */ +    static void image_f_wbf__decode( int args )   {    low_image_f_wbf_decode( args, 1 );   }    -  + /*! @decl mapping decode_header(string image) +  *! +  *! @returns +  *! @mapping +  *! @member string "format" +  *! The MIME type and encoding for the image, e.g. "image/x-wap.wbmp; type=0". +  *! @member int "xsize" +  *! @member int "ysize" +  *! @member int "fix_header_field" +  *! @member int "ext_header_field" +  *! @endmapping +  */ +    static void image_f_wbf_decode_header( int args )   {    low_image_f_wbf_decode( args, 0 );   }      void push_wap_integer( unsigned int i )   {    char data[10]; /* More than big enough... */    int pos = 0;   
pike.git/src/modules/Image/encodings/wbf.c:344:    if( is->r || is->g || is->b )    p[x/8] |= 128 >> (x%8);    is++;    }    printf("\n");    }    push_string( make_shared_binary_string( (char *)data,    i->ysize * (i->xsize+7)/8 ) );   }    + /*! @decl string encode(object image, void|mapping args) +  *! @decl string _encode(object image, void|mapping args) +  *! +  *! @fixme +  *! Document this function. +  */ +    static void image_f_wbf_encode( int args )   {    struct object *o;    struct image *i;    struct mapping *options = NULL;    int num_strings = 0;       if( !args )    Pike_error("No image given to encode.\n");    if( args > 2 )
pike.git/src/modules/Image/encodings/wbf.c:381:    push_wap_integer( 0 ); num_strings++; /* type */    push_wap_integer( 0 ); num_strings++; /* extra header */    push_wap_integer( i->xsize ); num_strings++;    push_wap_integer( i->ysize ); num_strings++;    push_wap_type0_image_data( i ); num_strings++;    f_add( num_strings );    if( options ) free_mapping( options );    free_object( o );   }    + /*! @endmodule +  */ +  + /*! @endmodule +  */ +    void init_image_wbf()   {    add_function( "encode", image_f_wbf_encode,    "function(object,void|mapping:string)", 0);    add_function( "_encode", image_f_wbf_encode,    "function(object,void|mapping:string)", 0);    add_function( "decode", image_f_wbf_decode, "function(string:object)", 0);    add_function( "_decode", image_f_wbf__decode, "function(string:mapping)", 0);    add_function( "decode_header", image_f_wbf_decode_header,    "function(string:mapping)", 0);   }      void exit_image_wbf()   {   }