Create a w * h image and fill it with color.
tt_color black = tt_make_color(0xFF000000);
tt_image *image = tt_create(800, 600, black);Save image to filename.
const char *filename = "demo.tga";
tt_save(image, filename);Load .tga file.
const char *file_path = "demo.tga";
tt_image *image = tt_load_from_file(file_path);Destroy image.
Flip image vertically.
Make color from an uint32_t color value and return.
The color value is in the form of 0xAARRGGBB.
tt_color black = tt_make_color(0xFF000000);Set dot (w, h) to color.
w and h starts from 0.
tt_set_color(image, 200, 300, black);Get color value from a tt_color variable.
tt_color color = tt_make_color(0xFF986BEB);
uint32_t color_value = tt_get_color_value(color);Get color value of pixel (w, h) from image.
uint32_t color_value = tt_get_color_value_from(image, 200, 300);Get color of pixel (w, h) from image.
tt_color color = tt_get_color_from(image, 200, 300);Set color intensity, by setting the r, g and b value to rintensity, gintensity, b*intensity, and a value remains
tt_color = tt_make_color(0xFFFFFFFF);
tt_color_intensity(&color, 0.5); // color = (255, 127, 127, 127) ARGB