rgb_to_y r g b y
Given ByteImages r, g and b (they must have same dimensions), convert them to gray-scale and store the result in ByteImage y
rgb_to_yuv_444 r g b y u v yuv_to_rgb_444 y u v r g b
Given ByteImages r, g, b and y, u, v, these functions convert between the two color spaces using 4:4:4 sampling (i.e., all buffers must have the same dimensions).
rgb_to_yuv_422 r g b y u v yuv_to_rgb_422 y u v r g b
Given ByteImages r, g, b and y, u, v, these functions convert between the two color spaces using 4:2:2 sampling (i.e., the r, g, b, and y must have the same dimensions, u and v must have the same height and half the width of y).
rgb_to_yuv_411 r g b y u v yuv_to_rgb_411 y u v r g b
Given ByteImages r, g, b and y, u, v, these functions convert between the two color spaces using 4:1:1 sampling (i.e., the r, g, b, and y must have the same dimensions, u and v must have the same height and one fourth the width of y).
rgb_to_yuv_420 r g b y u v yuv_to_rgb_420 y u v r g b
Given ByteImages r, g, b and y, u, v, these functions convert between the two color spaces using 4:2:0 sampling (i.e., the r, g, b, and y must have the same dimensions, u and v must have half the height and half the width of y).
color_hash_table_new bits
Allocates a new ColorHashTable of size 2^(bits) and returns a handle to it.
color_hash_table_clear table
Initializes the ColorHashTable table to empty. This should be done before inserting elements into table.
color_hash_table_free table
Deallocates the ColorHashTable table
color_hash_table_get_size table
Returns the allocated size of the ColorHashTable table.
color_hash_table_get_num_of_entry table
Returns the number of entries in the ColorHashTable table.
vp_tree_new
Allocates a Vptree and returns a pointer to the tree.
vp_tree_init rmap gmap bmap tree
Initializes the Vptree tree with data from ImageMaps rmap, gmap and bmap.
vp_tree_free tree
Deallocates the Vptree tree.
rgb_to_256 r g b table rmap gmap bmap
Given three ByteImages r, g, b and a ColorHashTable table of size 32678, perform median cut algorithm and produce 256 colors that are closest to the original colors in r, g and b. These 256 colors are stored in three ImageMaps rmap, gmap, and bmap. The ColorHashTable must be emptied before calling this function, and it will be modified by this primitive. Note that this function does not find the mappings from the original colors to the quantized colors.
rgb_quant_with_hash_table r g b table rmap gmap bmap out
For each color that appears in ByteImages r, g, b, find the color closest to it from the 256 colors available in rmap, gmap and bmap by comparing the distances one by one. The mappings is stored in ByteImage out, where value v at position (x,y) means that the color from r, g, b at (x,y) is closest to the color at position v from rmap, gmap and bmap. The ColorHashTable is used as a cache to store previously calculated mappings. It must be emptied before calling this function, and it will be modified by this primitive. Typically this is called after a color reduction primitives such as rgb_to_256.
rgb_quant_with_vp_tree r g b tree table rmap gmap bmap out
This is similar to RgbQuantWithHashTable. The difference is that it uses a VpTree data sturcture to find the closest color instead of comparing the distance one by one. The VpTree should be initialized using the 256 colors from rmap, gmap and bmap before calling this function. The ColorHashTable is used as a cache to store previously probed mappings. This function is generally faster than RgbQuantWithHashTable if the images are large, because the overhead in tree creation is offset by the gain in probing time. Typically this is called after a color reduction primitives such as rgb_to_256. vp_tree_init must be caleld before this function.
Last updated : Saturday, November 14, 1998, 07:50 PM