]> git.imager.perl.org - imager.git/blobdiff - image.h
Adds reading capabilities for certain variants of targa, writer code has not been
[imager.git] / image.h
diff --git a/image.h b/image.h
index d11436d3e1fef6e9aceb588bfc06d30f415b3737..c62369465938da17ea834a5e31702af3e99e1859 100644 (file)
--- a/image.h
+++ b/image.h
@@ -44,6 +44,8 @@ extern void i_fcolor_destroy(i_fcolor *cl);
 
 extern void i_rgb_to_hsvf(i_fcolor *color);
 extern void i_hsv_to_rgbf(i_fcolor *color);
+extern void i_rgb_to_hsv(i_color *color);
+extern void i_hsv_to_rgb(i_color *color);
 
 i_img *IIM_new(int x,int y,int ch);
 void   IIM_DESTROY(i_img *im);
@@ -125,11 +127,16 @@ struct i_fill_tag;
 
 typedef void (*i_fill_with_color_f)
      (struct i_fill_tag *fill, int x, int y, int width, int channels, 
-      i_color *data);
+      i_color *data, i_color *work);
 typedef void (*i_fill_with_fcolor_f)
      (struct i_fill_tag *fill, int x, int y, int width, int channels,
-      i_fcolor *data);
+      i_fcolor *data, i_fcolor *work);
 typedef void (*i_fill_destroy_f)(struct i_fill_tag *fill);
+typedef void (*i_fill_combine_f)(i_color *out, i_color *in, int channels, 
+                                 int count);
+typedef void (*i_fill_combinef_f)(i_fcolor *out, i_fcolor *in, int channels,
+                                  int count);
+
 
 typedef struct i_fill_tag
 {
@@ -146,9 +153,26 @@ typedef struct i_fill_tag
 
   /* if non-zero the caller will fill data with the original data
      from the image */
-  int combines;
+  i_fill_combine_f combine;
+  i_fill_combinef_f combinef;
 } i_fill_t;
 
+typedef enum {
+  ic_none,
+  ic_normal,
+  ic_multiply,
+  ic_dissolve,
+  ic_add,
+  ic_subtract,
+  ic_diff,
+  ic_lighten,
+  ic_darken,
+  ic_hue,
+  ic_sat,
+  ic_value,
+  ic_color
+} i_combine_t;
+
 extern i_fill_t *i_new_fill_solidf(i_fcolor *c, int combine);
 extern i_fill_t *i_new_fill_solid(i_color *c, int combine);
 extern i_fill_t *
@@ -523,9 +547,12 @@ undef_int i_writeraw_wiol(i_img* im, io_glue *ig);
 i_img   * i_readpnm_wiol(io_glue *ig, int length);
 undef_int i_writeppm_wiol(i_img *im, io_glue *ig);
 
-extern int i_writebmp_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);
 
+i_img   * i_readtga_wiol(io_glue *ig, int length);
+undef_int i_writetga_wiol(i_img *im, io_glue *ig);
+
 i_img * i_scaleaxis(i_img *im, float Value, int Axis);
 i_img * i_scale_nn(i_img *im, float scx, float scy);
 i_img * i_haar(i_img *im);