Changeset 3339 for libpipi


Ignore:
Timestamp:
Jan 13, 2009, 12:50:53 AM (12 years ago)
Author:
Sam Hocevar
Message:

Create basic tile handling functions.

Location:
libpipi/trunk/pipi
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/Makefile.am

    r3102 r3339  
    2222        context.c \
    2323        pixels.c \
     24        tiles.c \
    2425        codec.c \
    2526        stock.c \
  • libpipi/trunk/pipi/pipi.h

    r3164 r3339  
    102102pipi_pixels_t;
    103103
     104/* pipi_tile_t: the internal tile type */
     105typedef struct pipi_tile pipi_tile_t;
     106
    104107/* pipi_image_t: the main image type */
    105108typedef struct pipi_image pipi_image_t;
     
    127130__extern pipi_command_t const *pipi_get_command_list(void);
    128131__extern int pipi_command(pipi_context_t *, char const *, ...);
     132
     133__extern pipi_tile_t *pipi_get_tile(pipi_image_t *, int, int, int,
     134                                    pipi_format_t, int);
     135__extern void pipi_release_tile(pipi_image_t *, pipi_tile_t *);
     136__extern pipi_tile_t *pipi_create_tile(pipi_format_t, int);
    129137
    130138__extern pipi_image_t *pipi_load(char const *);
  • libpipi/trunk/pipi/pipi_internals.h

    r3075 r3339  
    3636};
    3737
     38#ifdef USE_TILES
     39#define TILE_SIZE 128
     40
     41struct pipi_tile
     42{
     43    int x, y;
     44    int zoom;
     45
     46    int refcount;
     47
     48    pipi_format_t fmt;
     49    int plane;
     50    union { uint8_t *u8; float *f; double *d; } data;
     51    union { uint8_t u8[1]; float f[1]; double d[1]; } align;
     52};
     53#endif /* USE_TILES */
    3854
    3955/* pipi_image_t: the image structure. This is probably going to be the most
     
    4359{
    4460    int w, h, pitch;
     61
     62#ifdef USE_TILES
     63    pipi_tile_t **tiles;
     64    int ntiles;
     65#endif /* USE_TILES */
    4566
    4667    /* A list of internal image flags.
Note: See TracChangeset for help on using the changeset viewer.