]> git.imager.perl.org - imager.git/blobdiff - imageri.h
add new comparison method rgb_difference that resembles arithmetical difference per...
[imager.git] / imageri.h
index 14d1d23ced965f2454afca679ecd36698c1a456c..1b5e4a8d3e8a9dcc1fbdd8bc76d7e2f2edd61a27 100644 (file)
--- a/imageri.h
+++ b/imageri.h
@@ -112,6 +112,22 @@ i_img_dim i_abs(i_img_dim x);
 
 #define color_to_grey(col) ((col)->rgb.r * 0.222  + (col)->rgb.g * 0.707 + (col)->rgb.b * 0.071)
 
 
 #define color_to_grey(col) ((col)->rgb.r * 0.222  + (col)->rgb.g * 0.707 + (col)->rgb.b * 0.071)
 
+struct file_magic_entry {
+  unsigned char *magic;
+  size_t magic_size;
+  char *name;
+  unsigned char *mask;  
+};
+
+
+typedef struct im_file_magic im_file_magic;
+struct im_file_magic {
+  struct file_magic_entry m;
+
+  /* more magic to check */
+  im_file_magic *next;
+};
+
 #define IM_ERROR_COUNT 20
 typedef struct im_context_tag {
   int error_sp;
 #define IM_ERROR_COUNT 20
 typedef struct im_context_tag {
   int error_sp;
@@ -138,6 +154,9 @@ typedef struct im_context_tag {
   size_t slot_alloc;
   void **slots;
 
   size_t slot_alloc;
   void **slots;
 
+  /* registered file type magic */
+  im_file_magic *file_magic;
+
   ptrdiff_t refcount;
 } im_context_struct;
 
   ptrdiff_t refcount;
 } im_context_struct;