src/lib/tile.h
changeset 19 ebcc49de97d0
parent 18 f92a24ab046e
child 56 d5e3089906da
equal deleted inserted replaced
18:f92a24ab046e 19:ebcc49de97d0
    18 
    18 
    19 
    19 
    20 
    20 
    21 /** Per-tile-render state */
    21 /** Per-tile-render state */
    22 struct pt_tile {
    22 struct pt_tile {
       
    23     /** Cache to render from */
       
    24     struct pt_cache *cache;
       
    25 
    23     /** Render spec */
    26     /** Render spec */
    24     struct pt_tile_info info;
    27     struct pt_tile_info info;
    25 
    28 
    26     /** Output type */
    29     /** Output type */
    27     enum pt_tile_output out_type;
    30     enum pt_tile_output out_type;
    37         } mem;
    40         } mem;
    38     } out;
    41     } out;
    39 };
    42 };
    40 
    43 
    41 /**
    44 /**
       
    45  * Alloc a new pt_tile, which must be initialized using pt_tile_init_*
       
    46  */
       
    47 int pt_tile_new (struct pt_tile **tile_ptr);
       
    48 
       
    49 /**
    42  * Initialize to render with given params, writing output to given FILE*
    50  * Initialize to render with given params, writing output to given FILE*
    43  */
    51  */
    44 int pt_tile_init_file (struct pt_tile *tile, const struct pt_tile_info *info, FILE *out);
    52 int pt_tile_init_file (struct pt_tile *tile, struct pt_cache *cache, const struct pt_tile_info *info, FILE *out);
    45 
    53 
    46 /**
    54 /**
    47  * Initialize to render with given params, writing output to a memory buffer
    55  * Initialize to render with given params, writing output to a memory buffer
    48  */
    56  */
    49 int pt_tile_init_mem (struct pt_tile *tile, const struct pt_tile_info *info);
    57 int pt_tile_init_mem (struct pt_tile *tile, struct pt_cache *cache, const struct pt_tile_info *info);
    50 
    58 
    51 /**
    59 /**
    52  * Render PNG data from given cache according to parameters given to pt_tile_init_*
    60  * Render PNG data from given cache according to parameters given to pt_tile_init_*
    53  */
    61  */
    54 int pt_tile_render (struct pt_tile *tile, struct pt_cache *cache);
    62 int pt_tile_render (struct pt_tile *tile);
    55 
    63 
    56 /**
    64 /**
    57  * Abort any failed render process, cleaning up.
    65  * Abort any failed render process, cleaning up.
    58  */
    66  */
    59 void pt_tile_abort (struct pt_tile *tile);
    67 void pt_tile_abort (struct pt_tile *tile);
    60 
    68 
       
    69 /**
       
    70  * Destroy given pt_tile, aborting it and freeing it
       
    71  */
       
    72 void pt_tile_destroy (struct pt_tile *tile);
       
    73 
    61 #endif
    74 #endif