26.1 Creation

Currently, there is no defined API for creating a shading due to the public nature of the structure. Just call fz_malloc_struct(ctx, fz_shade) and initialise the fields accordingly.

We may look to add convenience functions in the future, as this is likely to be desirable for the JNI (and other) bindings.

Shading objects are reference counted, with the implicit understanding that once more than one reference exists to a fz_shade, it will no longer be modified.

Additional references can be taken and dropped as usual:

/* 
   fz_keep_shade: Add a reference to an fz_shade. 
 
   shade: The reference to keep. 
 
   Returns shade. 
*/ 
fz_shade *fz_keep_shade(fz_context *ctx, fz_shade *shade); 
 
/* 
   fz_drop_shade: Drop a reference to an fz_shade. 
 
   shade: The reference to drop. If this is the last 
   reference, shade will be destroyed. 
*/ 
void fz_drop_shade(fz_context *ctx, fz_shade *shade);

We also provide a function to process a given shading, by calling: