The open imaging DSP library
Loading...
Searching...
No Matches
op_palettize.h
1
7#ifndef MPIX_OP_PALETTIZE_H
8#define MPIX_OP_PALETTIZE_H
9
10#include <stdlib.h>
11#include <stdint.h>
12
13#include <mpix/op.h>
14
20 uint8_t *colors;
22 uint32_t format;
23};
24
30 void (*palette_fn)(const uint8_t *s, uint8_t *d, uint16_t w, const struct mpix_palette *p);
33};
34
43#define MPIX_REGISTER_PALETTE_OP(id, fn, format_in, format_out) \
44 const struct mpix_palette_op mpix_palette_op_##id = { \
45 .base.name = ("palettize_" #id), \
46 .base.format_src = (MPIX_FMT_##format_in), \
47 .base.format_dst = (MPIX_FMT_##format_out), \
48 .base.window_size = 1, \
49 .base.run = mpix_palettize_op, \
50 .palette_fn = (fn), \
51 }
52
64void mpix_convert_rgb24_to_palette8(const uint8_t *src, uint8_t *dst, uint16_t width,
65 const struct mpix_palette *palette);
70void mpix_convert_palette8_to_rgb24(const uint8_t *src, uint8_t *dst, uint16_t width,
71 const struct mpix_palette *palette);
76void mpix_convert_rgb24_to_palette4(const uint8_t *src, uint8_t *dst, uint16_t width,
77 const struct mpix_palette *palette);
82void mpix_convert_palette4_to_rgb24(const uint8_t *src, uint8_t *dst, uint16_t width,
83 const struct mpix_palette *palette);
88void mpix_convert_rgb24_to_palette2(const uint8_t *src, uint8_t *dst, uint16_t width,
89 const struct mpix_palette *palette);
94void mpix_convert_palette2_to_rgb24(const uint8_t *src, uint8_t *dst, uint16_t width,
95 const struct mpix_palette *palette);
100void mpix_convert_rgb24_to_palette1(const uint8_t *src, uint8_t *dst, uint16_t width,
101 const struct mpix_palette *palette);
106void mpix_convert_palette1_to_rgb24(const uint8_t *src, uint8_t *dst, uint16_t width,
107 const struct mpix_palette *palette);
108
120
121#endif
void mpix_convert_palette1_to_rgb24(const uint8_t *src, uint8_t *dst, uint16_t width, const struct mpix_palette *palette)
Convert a line of pixel data from PALETTE1 to RGB24.
void mpix_palettize_op(struct mpix_base_op *op)
Helper to turn a line palettization function into an operation.
void mpix_convert_rgb24_to_palette4(const uint8_t *src, uint8_t *dst, uint16_t width, const struct mpix_palette *palette)
Convert a line of pixel data from RGB24 to PALETTE4.
void mpix_convert_rgb24_to_palette2(const uint8_t *src, uint8_t *dst, uint16_t width, const struct mpix_palette *palette)
Convert a line of pixel data from RGB24 to PALETTE2.
void mpix_convert_palette4_to_rgb24(const uint8_t *src, uint8_t *dst, uint16_t width, const struct mpix_palette *palette)
Convert a line of pixel data from PALETTE4 to RGB24.
void mpix_convert_palette2_to_rgb24(const uint8_t *src, uint8_t *dst, uint16_t width, const struct mpix_palette *palette)
Convert a line of pixel data from PALETTE2 to RGB24.
void mpix_convert_rgb24_to_palette8(const uint8_t *src, uint8_t *dst, uint16_t width, const struct mpix_palette *palette)
Convert a line of pixel data from RGB24 to PALETTE8.
void mpix_convert_palette8_to_rgb24(const uint8_t *src, uint8_t *dst, uint16_t width, const struct mpix_palette *palette)
Convert a line of pixel data from PALETTE8 to RGB24.
void mpix_convert_rgb24_to_palette1(const uint8_t *src, uint8_t *dst, uint16_t width, const struct mpix_palette *palette)
Convert a line of pixel data from RGB24 to PALETTE1.
One step of a line operation pipeline.
Definition op.h:27
Definition op_palettize.h:26
void(* palette_fn)(const uint8_t *s, uint8_t *d, uint16_t w, const struct mpix_palette *p)
Definition op_palettize.h:30
struct mpix_palette * palette
Definition op_palettize.h:32
struct mpix_base_op base
Definition op_palettize.h:28
Color palette as a list of pixels in the described format.
Definition op_palettize.h:18
uint32_t format
Definition op_palettize.h:22
uint8_t * colors
Definition op_palettize.h:20