home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume5 / xldimage / part01 / image.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-13  |  2.0 KB  |  87 lines

  1. /* image.h:
  2.  *
  3.  * portable image type declarations
  4.  *
  5.  * jim frost 10.02.89
  6.  *
  7.  * Copyright 1989 Jim Frost.  See included file "copyright.h" for complete
  8.  * copyright information.
  9.  */
  10.  
  11. #include "copyright.h"
  12. #include <stdio.h>
  13.  
  14. typedef unsigned long  Pixel;     /* what X thinks a pixel is */
  15. typedef unsigned short Intensity; /* what X thinks an RGB intensity is */
  16. typedef unsigned char  byte;      /* byte type */
  17.  
  18. typedef struct {
  19.   unsigned int  type;
  20.   FILE         *stream;
  21. } ZFILE;
  22.  
  23. #define ZSTANDARD 0
  24. #define ZPIPE     1
  25.  
  26. typedef struct rgbmap {
  27.   unsigned int  size;  /* size of RGB map */
  28.   unsigned int  used;  /* number of colors used in RGB map */
  29.   Intensity    *red;   /* color values in X style */
  30.   Intensity    *green;
  31.   Intensity    *blue;
  32. } RGBMap;
  33.  
  34. /* image structure
  35.  */
  36.  
  37. typedef struct {
  38.   char         *title;  /* name of image */
  39.   unsigned int  type;   /* type of image */
  40.   RGBMap        rgb;    /* RGB map of image if IRGB type */
  41.   unsigned int  width;  /* width of image in pixels */
  42.   unsigned int  height; /* height of image in pixels */
  43.   unsigned int  depth;  /* depth of image in bits if IRGB type */
  44.   unsigned int  pixlen; /* length of pixel if IRGB type */
  45.   byte         *data;   /* data rounded to full byte for each row */
  46. } Image;
  47.  
  48. #define IBITMAP 0 /* image is a bitmap */
  49. #define IRGB    1 /* image is RGB */
  50.  
  51. #define BITMAPP(IMAGE) ((IMAGE)->type == IBITMAP)
  52. #define RGBP(IMAGE)    ((IMAGE)->type == IRGB)
  53.  
  54. /* function declarations
  55.  */
  56.  
  57. Image *clip(); /* clip.c */
  58.  
  59. Image *dither(); /* dither.c */
  60.  
  61. void fold(); /* fold.c */
  62.  
  63. Image *loadImage(); /* imagetypes.c */
  64. void   identifyImage();
  65. void   goodImage();
  66.  
  67. Image *mergeImages(); /* merge.c */
  68.  
  69. char  *dupString(); /* new.c */
  70. Image *newBitImage();
  71. Image *newRGBImage();
  72. void   freeImage();
  73. void   freeImageData();
  74. void   newRGBMapData();
  75. void   freeRGBMapData();
  76. byte  *lcalloc();
  77. byte  *lmalloc();
  78. void   lfree();
  79.  
  80. void reduceRGBMap(); /* reduce.c */
  81. void reduce();
  82.  
  83. unsigned long memToVal(); /* value.c */
  84. void          valToMem();
  85.  
  86. Image *zoom(); /* zoom.c */
  87.