commit 712ff5381ea3581c5166104fba27714b997bc3e3
parent dfe03d12415710ca1304d1b63c148ff814cfcca5
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 24 Jun 2016 09:46:55 +0200
Add the ssol_image opaque data structure to the API
Diffstat:
| M | src/ssol.h | | | 37 | +++++++++++++++++++++++++++++++++---- |
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/src/ssol.h b/src/ssol.h
@@ -46,6 +46,7 @@ struct mem_allocator;
/* Opaque Solstice solver types */
struct ssol_device;
+struct ssol_image;
struct ssol_material;
struct ssol_object;
struct ssol_object_instance;
@@ -54,6 +55,11 @@ struct ssol_shape;
struct ssol_spectrum;
struct ssol_sun;
+enum ssol_pixel_format {
+ SSOL_PIXEL_DOUBLE3,
+ SSOL_PIXEL_FORMAT_COUNT__
+};
+
enum ssol_quadric_type {
SSOL_QUADRIC_PLANE,
SSOL_QUADRIC_PARABOL,
@@ -89,16 +95,16 @@ struct ssol_vertex_data {
static const struct ssol_vertex_data SSOL_VERTEX_DATA_NULL =
SSOL_VERTEX_DATA_NULL__;
-/* the following quadric definitions are in local coordinate system */
+/* The following quadric definitions are in local coordinate system. */
struct ssol_quadric_plane {
- char unused; /* define z = 0 */
+ char unused; /* Define z = 0 */
};
struct ssol_quadric_parabol {
- double focal; /* define x² + y² - 4 focal z = 0 */
+ double focal; /* Define x^2 + y^2 - 4 focal z = 0 */
};
struct ssol_quadric_parabolic_cylinder {
- double focal; /* define y² - 4 focal z = 0 */
+ double focal; /* Define y^2 - 4 focal z = 0 */
};
struct ssol_quadric {
@@ -170,6 +176,29 @@ ssol_device_ref_put
(struct sht_device* dev);
/*******************************************************************************
+ * Image API
+ ******************************************************************************/
+SSOL_API res_T
+ssol_image_create
+ (struct s2d_device* dev,
+ struct s2d_image** image);
+
+SSOL_API res_T
+ssol_image_ref_get
+ (struct s2d_image* image);
+
+SSOL_API res_T
+ssol_image_ref_put
+ (struct s2d_image* image);
+
+SSOL_API res_T
+ssol_image_setup
+ (struct s2d_image* image,
+ const size_t width,
+ const size_t height,
+ const enum s2d_pixel_format format);
+
+/*******************************************************************************
* Scene API - Opaque abstraction of the virtual environment. It contains a
* list of instantiated objects, handle a collection of light sources and
* describes the environment medium properties.