X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Frasterize;a=blobdiff_plain;f=raster.h;h=7ed8e33f533f90d3d071b664cda153ac95a4ea88;hp=1d43132c6ce7fe40a62b5c8566d589ba195656ea;hb=07083c8dfbbd4fe48e84d86ce8d7e44e0719b84a;hpb=e16cf0578f4baaf879e4ab9d3528a765bfd29be0 diff --git a/raster.h b/raster.h index 1d43132..7ed8e33 100644 --- a/raster.h +++ b/raster.h @@ -11,6 +11,7 @@ #include "color.h" #include "common.h" #include "light.h" +#include "model.h" #include "tri.h" @@ -37,6 +38,12 @@ void raster_destroy(raster_t* p); void raster_printstats(raster_t* p); +/* + * Get the color value at a particular point. + */ +color_t raster_color(const raster_t* p, vec_t pt); + + /* * Set the viewport rectangle. This effectively sets up a clipping rectangle * where nothing is drawn outside of the rectangle. The default viewport is @@ -96,13 +103,35 @@ int raster_export_ppm(const raster_t* p, const char* filename); int raster_export_bmp(const raster_t* p, const char* filename); +/* + * Load the raster from an image file. The file extension is used to + * determine which importer is actually called. + */ +raster_t* raster_import(const char* filename); + +/* + * Load the raster from a PPM file. + */ +raster_t* raster_import_ppm(const char* filename); + +/* + * Load the raster from a BMP file. + */ +raster_t* raster_import_bmp(const char* filename); + + /* * Fill the entire raster with a solid color and reset the raster statistics. */ void raster_clear(raster_t* p, color_t fill); /* - * Draw a smooth gradient triangle to the raster. + * Draw a model to the raster. + */ +void raster_draw_model(raster_t* p, const model_t* model); + +/* + * Draw a triangle to the raster. */ void raster_draw_tri(raster_t* p, const tri_t* triangle);