include/pngtile.h
changeset 64 98d934a9b3db
parent 59 80135bdfd343
child 69 1d188aa94aee
equal deleted inserted replaced
63:2aab5d906dc8 64:98d934a9b3db
   120 void pt_ctx_destroy (struct pt_ctx *ctx);
   120 void pt_ctx_destroy (struct pt_ctx *ctx);
   121 
   121 
   122 /**
   122 /**
   123  * Open a new pt_image for use.
   123  * Open a new pt_image for use.
   124  *
   124  *
       
   125  * The pt_ctx is optional, but required for pt_image_tile_async.
       
   126  *
   125  * @param img_ptr returned pt_image handle
   127  * @param img_ptr returned pt_image handle
   126  * @param ctx global state to use
   128  * @param ctx global state to use (optional)
   127  * @param path filesystem path to .png file
   129  * @param path filesystem path to .png file
   128  * @param mode combination of PT_OPEN_* flags
   130  * @param mode combination of PT_OPEN_* flags
   129  */
   131  */
   130 int pt_image_open (struct pt_image **image_ptr, struct pt_ctx *ctx, const char *png_path, int cache_mode);
   132 int pt_image_open (struct pt_image **image_ptr, struct pt_ctx *ctx, const char *png_path, int cache_mode);
   131 
   133 
   182  *
   184  *
   183  * The PNG data will be written to \a out, which will be fclose()'d once done.
   185  * The PNG data will be written to \a out, which will be fclose()'d once done.
   184  *
   186  *
   185  * This function may return before the PNG has been rendered.
   187  * This function may return before the PNG has been rendered.
   186  *
   188  *
       
   189  * Fails with PT_ERR if not pt_ctx was given to pt_image_open.
       
   190  *
   187  * @param image render from image's cache. The cache must have been opened previously!
   191  * @param image render from image's cache. The cache must have been opened previously!
   188  * @param info tile parameters
   192  * @param info tile parameters
   189  * @param out IO stream to write PNG data to, and close once done
   193  * @param out IO stream to write PNG data to, and close once done
   190  */
   194  */
   191 int pt_image_tile_async (struct pt_image *image, const struct pt_tile_info *info, FILE *out);
   195 int pt_image_tile_async (struct pt_image *image, const struct pt_tile_info *info, FILE *out);
   197 
   201 
   198 /**
   202 /**
   199  * Error codes returned
   203  * Error codes returned
   200  */
   204  */
   201 enum pt_error {
   205 enum pt_error {
       
   206     /** No error */
   202     PT_SUCCESS = 0,
   207     PT_SUCCESS = 0,
       
   208     
       
   209     /** Generic error */
       
   210     PT_ERR = 1,
       
   211 
   203     PT_ERR_MEM,
   212     PT_ERR_MEM,
   204 
   213 
   205     PT_ERR_PATH,
   214     PT_ERR_PATH,
   206     PT_ERR_OPEN_MODE,
   215     PT_ERR_OPEN_MODE,
   207     
   216