X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=raster.h;h=7ed8e33f533f90d3d071b664cda153ac95a4ea88;hb=3955aa40277c4b86a43b21e78d55d2fea7b643ce;hp=53f7627a65a5b43d1c94b47725bf046643a7f5a8;hpb=95850b98f73ad7033af60a30e324e9c3cda55389;p=chaz%2Frasterize diff --git a/raster.h b/raster.h index 53f7627..7ed8e33 100644 --- a/raster.h +++ b/raster.h @@ -38,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 @@ -97,6 +103,23 @@ 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. */