]> Dogcows Code - chaz/rasterize/blobdiff - raster.h
add opengl support
[chaz/rasterize] / raster.h
index 53f7627a65a5b43d1c94b47725bf046643a7f5a8..3b5a5502e2d9fef221806c40bd6210d59078c03b 100644 (file)
--- a/raster.h
+++ b/raster.h
@@ -38,6 +38,28 @@ 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);
+
+/*
+ * Get the width of the raster.
+ */
+int raster_width(const raster_t* p);
+
+/*
+ * Get the height of the raster.
+ */
+int raster_height(const raster_t* p);
+
+/*
+ * Get a copy of the raw RGBA pixel data of the raster.  The returned
+ * buffer is indeed a copy and must be freed when no longer needed.
+ */
+void* raster_data(const raster_t* p);
+
+
 /*
  * 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 +119,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.
  */
This page took 0.021299 seconds and 4 git commands to generate.