OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
imageutils.h
Go to the documentation of this file.
1 #ifndef IMAGE_UTILS_H
2 #define IMAGE_UTILS_H
3 
4 #include <stdint.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
14 typedef struct {
15  int w, h; // width and height of image
16  uint8_t *pix; // image data, first pixel is top left, next pixel is
17  // to the right. each pixel is 3 bytes (red, green, blue)
18 } img_rgb_t;
19 
20 
21 img_rgb_t* img_new(int w, int h);
22 void img_free(img_rgb_t* img);
23 
24 int img_write_ppm(img_rgb_t* img, char *filename);
26 
27 void img_color_quant(img_rgb_t* img, int n_colors, int dither);
28 
29 void img_color_palette_quantization(img_rgb_t* in_image, int num_colors,
30  uint8_t* palette, uint8_t* out_image);
31 
32 
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 
38 #endif
uint8_t * pix
Definition: imageutils.h:16
void img_color_quant(img_rgb_t *img, int n_colors, int dither)
Definition: color_quant.c:263
float h[MODELMAX]
Definition: atrem_corl1.h:131
void img_color_palette_quantization(img_rgb_t *in_image, int num_colors, uint8_t *palette, uint8_t *out_image)
Definition: color_quant.c:300
img_rgb_t * img_read_ppm(char *filename)
Definition: color_quant.c:75
void img_free(img_rgb_t *img)
Definition: color_quant.c:48
char filename[FILENAME_MAX]
Definition: atrem_corl1.h:122
img_rgb_t * img_new(int w, int h)
Definition: color_quant.c:40
int img_write_ppm(img_rgb_t *img, char *filename)
Definition: color_quant.c:54