26#define FMI_IMAGE_VER "fmi_image \t v2.2\t Jul 2002 (c) Markus.Peura@fmi.fi"
29#include "rave_types.h"
61extern char FmiImageFormatExtension[7][4];
71} CoordOverflowHandler;
74typedef unsigned char Byte;
77#define HISTOGRAM_SIZE (256+15)
79typedef signed long Histogram[HISTOGRAM_SIZE];
83enum histogram_special_data {
121typedef unsigned char ColorMap[][4];
122typedef unsigned char ColorMap256[256][3];
124#define MAX_COMMENT_LENGTH 1024
126extern int FMI_IMAGE_COMMENT;
134 int width,height,channels;
143 float elevation_angle;
149 RaveDataType original_type;
150 double original_nodata;
151 double original_undetect;
152 double original_gain;
153 double original_offset;
156 CoordOverflowHandler coord_overflow_handler_x, coord_overflow_handler_y;
158 char comment_string[MAX_COMMENT_LENGTH];
159 FmiImageFormat format;
166int legal_coords(
FmiImage *img,
int x,
int y);
170FmiImage *new_image(
int sweep_count);
177int link_image_segment(
FmiImage *reference_img,
int channel_start,
int channel_count,
FmiImage *linked_img);
183void split_to_channels(
FmiImage *source,
int channels);
201Byte get_pixel(
FmiImage *img,
int x,
int y,
int channel);
202double get_pixel_orig(
FmiImage *img,
int x,
int y,
int channel);
206Byte get_pixel_direct(
FmiImage *img,
int i);
208void put_pixel(
FmiImage *img,
int x,
int y,
int channel,Byte c);
209void put_pixel_orig(
FmiImage *img,
int x,
int y,
int channel,
double c);
211void put_pixel_direct(
FmiImage *img,
int address,Byte c);
212void put_pixel_direct_inc(
FmiImage *img,
int address);
214void put_pixel_min(
FmiImage *img,
int x,
int y,
int channel,Byte c);
215void put_pixel_max(
FmiImage *img,
int x,
int y,
int channel,Byte c);
216void put_pixel_or(
FmiImage *img,
int x,
int y,
int channel,Byte c);
217void put_pixel_and(
FmiImage *img,
int x,
int y,
int channel,Byte c);
219void fill_image(
FmiImage *img,Byte c);
220void fill_image_orig(
FmiImage *img,
double c);
221void image_fill_random(
FmiImage *img,Byte mean,Byte amplitude);
223void translate_intensity(
FmiImage *img,Byte from,Byte to);
224void limit_image_intensities(
FmiImage *img,Byte min,Byte max);
237void multiply_image_scalar255(
FmiImage *img,
int coeff);
238void semisigmoid_image(
FmiImage *source,
int half_width);
239void semisigmoid_image_inv(
FmiImage *source,
int half_width);
240void sigmoid_image(
FmiImage *source,
int threshold,
int slope);
241void gaussian_image(
FmiImage *source,
int mean,
int half_width);
248int legal_coord(
FmiImage *img,
int x,
int y);
252void write_image(
char *filename,
FmiImage *img,FmiImageFormat format);
253void read_image(
char *filename,
FmiImage *img);
256void read_pnm_image(FILE *fp,
FmiImage *img,FmiImageFormat format);
257void write_pnm_image(FILE *fp,
FmiImage *img,FmiImageFormat format);
267void map_channel_to_colors(
FmiImage *source,
int channel,
FmiImage *target,
int map_size,ColorMap map);
268void map_channel_to_256_colors(
FmiImage *source,
int channel,
FmiImage *target,ColorMap256 map);
269void map_256_colors_to_gray(
FmiImage *source,
FmiImage *target,ColorMap256 map);
270void read_colormap256(
char *filename,ColorMap256 map);
288void calc_histogram(
FmiImage *source,Histogram hist);
289void clear_histogram(Histogram hist);
290void write_histogram(
char *filename,Histogram hist);
291void dump_histogram(Histogram hist);
293int initialize_vert_stripe(
FmiImage *img,
int height);