#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <stdint.h>
#include <math.h>
#include <imageutils.h>
Go to the source code of this file.
|
img_rgb_t * | img_new (int w, int h) |
|
void | img_free (img_rgb_t *img) |
|
int | img_write_ppm (img_rgb_t *img, char *filename) |
|
int | read_num (FILE *f) |
|
img_rgb_t * | img_read_ppm (char *filename) |
|
int | cmp_node (oct_node a, oct_node b) |
|
void | down_heap (node_heap *h, oct_node p) |
|
void | up_heap (node_heap *h, oct_node p) |
|
void | heap_add (node_heap *h, oct_node p) |
|
oct_node | pop_heap (node_heap *h) |
|
oct_node | node_new (uint8_t idx, uint8_t depth, oct_node p) |
|
void | node_free () |
|
oct_node | node_insert (oct_node root, uint8_t *pix) |
|
oct_node | node_fold (oct_node p) |
|
void | color_replace (oct_node root, uint8_t *pix) |
|
uint8_t | find_color_index (oct_node root, uint8_t *pix) |
|
void | img_color_quant (img_rgb_t *im, int n_colors, int dither) |
|
void | img_color_palette_quantization (img_rgb_t *in_image, int num_colors, uint8_t *palette, uint8_t *out_image) |
|
◆ ON_INHEAP
◆ cmp_node()
int cmp_node |
( |
oct_node |
a, |
|
|
oct_node |
b |
|
) |
| |
◆ color_replace()
void color_replace |
( |
oct_node |
root, |
|
|
uint8_t * |
pix |
|
) |
| |
◆ down_heap()
◆ find_color_index()
uint8_t find_color_index |
( |
oct_node |
root, |
|
|
uint8_t * |
pix |
|
) |
| |
◆ heap_add()
◆ img_color_palette_quantization()
void img_color_palette_quantization |
( |
img_rgb_t * |
in_image, |
|
|
int |
num_colors, |
|
|
uint8_t * |
palette, |
|
|
uint8_t * |
out_image |
|
) |
| |
Take the input 24 bit full color RGB image and convert it into a color mapped image and color palette which have already been allocated by the caller.
- Parameters
-
in_image | 24 bit RGB input image |
num_colors | number of colors in the color palette |
palette | color palette (allocated by caller) 3 bytes (r,g,b) for each entry |
out_image | output image data (allocated by caller) |
Definition at line 300 of file color_quant.c.
◆ img_color_quant()
void img_color_quant |
( |
img_rgb_t * |
im, |
|
|
int |
n_colors, |
|
|
int |
dither |
|
) |
| |
◆ img_free()
◆ img_new()
◆ img_read_ppm()
◆ img_write_ppm()
int img_write_ppm |
( |
img_rgb_t * |
img, |
|
|
char * |
filename |
|
) |
| |
◆ node_fold()
oct_node node_fold |
( |
oct_node |
p | ) |
|
◆ node_free()
◆ node_insert()
oct_node node_insert |
( |
oct_node |
root, |
|
|
uint8_t * |
pix |
|
) |
| |
◆ node_new()
oct_node node_new |
( |
uint8_t |
idx, |
|
|
uint8_t |
depth, |
|
|
oct_node |
p |
|
) |
| |
◆ pop_heap()
◆ read_num()
◆ up_heap()