]> git.imager.perl.org - imager.git/blobdiff - image.h
More support for autodetection of formats, still some error comes up in
[imager.git] / image.h
diff --git a/image.h b/image.h
index 7e507fd8bc4a6e05daccf75ec3325f2f2d7fd25c..9ca74a3cb0a56d7adba3f48f02af74712ed338ab 100644 (file)
--- a/image.h
+++ b/image.h
@@ -58,6 +58,7 @@ void   i_img_destroy(i_img *im);
 void   i_img_info(i_img *im,int *info);
 
 extern i_img *i_sametype(i_img *im, int xsize, int ysize);
+extern i_img *i_sametype_chans(i_img *im, int xsize, int ysize, int channels);
 
 i_img *i_img_pal_new(int x, int y, int ch, int maxpal);
 
@@ -202,8 +203,8 @@ float i_gpix_pch(i_img *im,int x,int y,int ch);
 void i_box         (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
 void i_box_filled  (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
 void i_box_cfill(i_img *im, int x1, int y1, int x2, int y2, i_fill_t *fill);
-void i_draw        (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
-void i_line_aa     (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
+void i_line        (i_img *im,int x1,int y1,int x2,int y2,i_color *val, int endp);
+void i_line_aa     (i_img *im,int x1,int y1,int x2,int y2,i_color *val, int endp);
 void i_arc         (i_img *im,int x,int y,float rad,float d1,float d2,i_color *val);
 void i_arc_cfill(i_img *im,int x,int y,float rad,float d1,float d2,i_fill_t *fill);
 void i_circle_aa   (i_img *im,float x, float y,float rad,i_color *val);
@@ -221,7 +222,9 @@ void i_bezier_multi(i_img *im,int l,double *x,double *y,i_color *val);
 void i_poly_aa     (i_img *im,int l,double *x,double *y,i_color *val);
 void i_poly_aa_cfill(i_img *im,int l,double *x,double *y,i_fill_t *fill);
 
-void i_flood_fill  (i_img *im,int seedx,int seedy,i_color *dcol);
+undef_int i_flood_fill  (i_img *im,int seedx,int seedy,i_color *dcol);
+undef_int i_flood_cfill(i_img *im, int seedx, int seedy, i_fill_t *fill);
+
 
 /* image processing functions */
 
@@ -242,12 +245,12 @@ undef_int i_init_fonts( int t1log );
 #ifdef HAVE_LIBT1
 #include <t1lib.h>
 
-undef_int init_t1( int t1log );
+undef_int i_init_t1( int t1log );
 int       i_t1_new( char *pfb, char *afm );
 int       i_t1_destroy( int font_id );
-undef_int i_t1_cp( i_img *im, int xb, int yb, int channel, int fontnum, float points, char* str, int len, int align );
-undef_int i_t1_text( i_img *im, int xb, int yb, i_color *cl, int fontnum, float points, char* str, int len, int align );
-void      i_t1_bbox( int fontnum, float point, char *str, int len, int cords[6] );
+undef_int i_t1_cp( i_img *im, int xb, int yb, int channel, int fontnum, float points, char* str, int len, int align, int utf8, char const *flags );
+undef_int i_t1_text( i_img *im, int xb, int yb, i_color *cl, int fontnum, float points, char* str, int len, int align, int utf8, char const *flags );
+void      i_t1_bbox( int fontnum, float point, char *str, int len, int cords[6], int utf8, char const *flags );
 void      i_t1_set_aa( int st );
 void      close_t1( void );
 
@@ -255,39 +258,17 @@ void      close_t1( void );
 
 #ifdef HAVE_LIBTT
 
-#include <freetype.h>
-#define TT_CHC 5
-
-struct TT_Instancehandle_ {
-  TT_Instance instance;
-  TT_Instance_Metrics imetrics;
-  TT_Glyph_Metrics gmetrics[256];
-  TT_Glyph glyphs[256];
-  int smooth;
-  int ptsize;
-  int order;
-};
-
-typedef struct TT_Instancehandle_ TT_Instancehandle;
-
-struct TT_Fonthandle_ {
-  TT_Face face;
-  TT_Face_Properties properties;
-  TT_Instancehandle instanceh[TT_CHC];
-  TT_CharMap char_map;
-};
+struct TT_Fonthandle_;
 
 typedef struct TT_Fonthandle_ TT_Fonthandle;
 
-
-
-undef_int init_tt( void );
+undef_int i_init_tt( void );
 TT_Fonthandle* i_tt_new(char *fontname);
 void i_tt_destroy( TT_Fonthandle *handle );
-undef_int i_tt_cp( TT_Fonthandle *handle,i_img *im,int xb,int yb,int channel,float points,char* txt,int len,int smooth);
-undef_int i_tt_text( TT_Fonthandle *handle, i_img *im, int xb, int yb, i_color *cl, float points, char* txt, int len, int smooth);
-undef_int i_tt_bbox( TT_Fonthandle *handle, float points,char *txt,int len,int cords[6]);
-
+undef_int i_tt_cp( TT_Fonthandle *handle,i_img *im,int xb,int yb,int channel,float points,char const* txt,int len,int smooth, int utf8);
+undef_int i_tt_text( TT_Fonthandle *handle, i_img *im, int xb, int yb, i_color *cl, float points, char const* txt, int len, int smooth, int utf8);
+undef_int i_tt_bbox( TT_Fonthandle *handle, float points,char *txt,int len,int cords[6], int utf8);
+int i_tt_has_chars(TT_Fonthandle *handle, char const *text, int len, int utf8, char *out);
 
 #endif  /* End of freetype headers */
 
@@ -302,16 +283,16 @@ extern int i_ft2_getdpi(FT2_Fonthandle *handle, int *xdpi, int *ydpi);
 extern int i_ft2_settransform(FT2_Fonthandle *handle, double *matrix);
 extern int i_ft2_sethinting(FT2_Fonthandle *handle, int hinting);
 extern int i_ft2_bbox(FT2_Fonthandle *handle, double cheight, double cwidth, 
-                      char *text, int len, int *bbox, int utf8);
+                      char const *text, int len, int *bbox, int utf8);
 extern int i_ft2_text(FT2_Fonthandle *handle, i_img *im, int tx, int ty, 
                       i_color *cl, double cheight, double cwidth, 
-                      char *text, int len, int align, int aa, int vlayout,
-                      int utf8);
+                      char const *text, int len, int align, int aa, 
+                      int vlayout, int utf8);
 extern int i_ft2_cp(FT2_Fonthandle *handle, i_img *im, int tx, int ty, 
                     int channel, double cheight, double cwidth, 
-                    char *text, int len, int align, int aa, int vlayout, 
+                    char const *text, int len, int align, int aa, int vlayout, 
                     int utf8);
-extern int i_ft2_has_chars(FT2_Fonthandle *handle, char *text, int len,
+extern int i_ft2_has_chars(FT2_Fonthandle *handle, char const *text, int len,
                            int utf8, char *work);
 
 #endif
@@ -356,7 +337,7 @@ typedef struct {
 
 extern int  i_gen_reader(i_gen_read_data *info, char *buffer, int need);
 extern      i_gen_read_data *i_gen_read_data_new(i_read_callback_t cb, char *userdata);
-extern void free_gen_read_data(i_gen_read_data *);
+extern void i_free_gen_read_data(i_gen_read_data *);
 
 /* general writer callback
    userdata - the data the user passed into the writer
@@ -376,7 +357,7 @@ typedef struct {
 
 extern int i_gen_writer(i_gen_write_data *info, char const *data, int size);
 extern i_gen_write_data *i_gen_write_data_new(i_write_callback_t cb, char *userdata, int maxlength);
-extern int free_gen_write_data(i_gen_write_data *, int flush);
+extern int i_free_gen_write_data(i_gen_write_data *, int flush);
 
 /* transparency handling for quantized output */
 typedef enum i_transp_tag {
@@ -528,6 +509,10 @@ extern i_img *i_img_16_new_low(i_img *im, int x, int y, int ch);
 extern i_img *i_img_double_new(int x, int y, int ch);
 extern i_img *i_img_double_new_low(i_img *im, int x, int y, int ch);
 
+
+char * i_test_format_probe(io_glue *data, int length);
+
+
 #ifdef HAVE_LIBJPEG
 i_img *   
 i_readjpeg_wiol(io_glue *ig, int length, char** iptc_itext, int *itlength);
@@ -578,6 +563,8 @@ undef_int i_writeppm_wiol(i_img *im, io_glue *ig);
 extern int    i_writebmp_wiol(i_img *im, io_glue *ig);
 extern i_img *i_readbmp_wiol(io_glue *ig);
 
+int tga_header_verify(unsigned char headbuf[18]);
+
 i_img   * i_readtga_wiol(io_glue *ig, int length);
 undef_int i_writetga_wiol(i_img *img, io_glue *ig, int wierdpack, int compress, char *idstring, size_t idlen);
 
@@ -614,6 +601,7 @@ void i_radnoise(i_img *im,int xo,int yo,float rscale,float ascale);
 void i_turbnoise(i_img *im,float xo,float yo,float scale);
 void i_gradgen(i_img *im, int num, int *xo, int *yo, i_color *ival, int dmeasure);
 void i_nearest_color(i_img *im, int num, int *xo, int *yo, i_color *ival, int dmeasure);
+i_img *i_diff_image(i_img *im, i_img *im2, int mindist);
 typedef enum {
   i_fst_linear,
   i_fst_curved,
@@ -692,7 +680,7 @@ typedef struct {
   int (*i_gpix)(i_img *im,int x,int y,i_color *val);
   */
   void(*i_box)(i_img *im,int x1,int y1,int x2,int y2,i_color *val);
-  void(*i_draw)(i_img *im,int x1,int y1,int x2,int y2,i_color *val);
+  void(*i_line)(i_img *im,int x1,int y1,int x2,int y2,i_color *val,int endp);
   void(*i_arc)(i_img *im,int x,int y,float rad,float d1,float d2,i_color *val);
   void(*i_copyto)(i_img *im,i_img *src,int x1,int y1,int x2,int y2,int tx,int ty);
   void(*i_copyto_trans)(i_img *im,i_img *src,int x1,int y1,int x2,int y2,int tx,int ty,i_color *trans);