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:


\begin{lstlisting}
/*
fz_keep_shade: Add a reference to an fz_shade.
\par
shade...
...royed.
*/
void fz_drop_shade(fz_context *ctx, fz_shade *shade);
\end{lstlisting}

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