pixel-region

pixel-region

Synopsis

                    PixelRegion;
                    PixelRegionHolder;
                    PixelRegionIterator;
void                pixel_region_init                   (PixelRegion *PR,
                                                         TileManager *tiles,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h,
                                                         gboolean dirty);
void                pixel_region_init_temp_buf          (PixelRegion *PR,
                                                         TempBuf *temp_buf,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);
void                pixel_region_init_data              (PixelRegion *PR,
                                                         guchar *data,
                                                         gint bytes,
                                                         gint rowstride,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);
void                pixel_region_resize                 (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);
void                pixel_region_get_row                (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         guchar *data,
                                                         gint subsample);
void                pixel_region_set_row                (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         const guchar *data);
void                pixel_region_get_col                (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint h,
                                                         guchar *data,
                                                         gint subsample);
void                pixel_region_set_col                (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint h,
                                                         const guchar *data);
gboolean            pixel_region_has_alpha              (PixelRegion *PR);
PixelRegionIterator * pixel_regions_register            (gint num_regions,
                                                         ...);
PixelRegionIterator * pixel_regions_process             (PixelRegionIterator *PRI);
void                pixel_regions_process_stop          (PixelRegionIterator *PRI);

Description

Details

PixelRegion

typedef struct {
  guchar      *data;           /*  pointer to region data        */
  TileManager *tiles;          /*  pointer to tiles              */
  Tile        *curtile;        /*  current tile                  */
  gint         offx;           /*  tile offsets                  */
  gint         offy;           /*  tile offsets                  */
  gint         rowstride;      /*  bytes per pixel row           */
  gint         x;              /*  origin                        */
  gint         y;              /*  origin                        */
  gint         w;              /*  width of region               */
  gint         h;              /*  height of region              */
  gint         bytes;          /*  bytes per pixel               */
  gboolean     dirty;          /*  will this region be dirtied?  */
  gint         process_count;  /*  used internally               */
} PixelRegion;


PixelRegionHolder

typedef struct {
  PixelRegion *PR;
  guchar      *original_data;
  gint         startx;
  gint         starty;
  gint         count;
} PixelRegionHolder;


PixelRegionIterator

typedef struct {
  GSList *pixel_regions;
  gint    region_width;
  gint    region_height;
  gint    portion_width;
  gint    portion_height;
  gint    process_count;
} PixelRegionIterator;


pixel_region_init ()

void                pixel_region_init                   (PixelRegion *PR,
                                                         TileManager *tiles,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h,
                                                         gboolean dirty);

Initializes a pixel region over a set of tiles.

PR :

Pointer to PixelRegion struct, typically allocated on the stack

tiles :

Tiles

x :

X of region

y :

Y of region

w :

Width of region

h :

Height of region

dirty :

TRUE if there will be changes to the pixel region that shall be written back to the tiles, FALSE otherwise

pixel_region_init_temp_buf ()

void                pixel_region_init_temp_buf          (PixelRegion *PR,
                                                         TempBuf *temp_buf,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);


pixel_region_init_data ()

void                pixel_region_init_data              (PixelRegion *PR,
                                                         guchar *data,
                                                         gint bytes,
                                                         gint rowstride,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);


pixel_region_resize ()

void                pixel_region_resize                 (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         gint h);


pixel_region_get_row ()

void                pixel_region_get_row                (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         guchar *data,
                                                         gint subsample);


pixel_region_set_row ()

void                pixel_region_set_row                (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint w,
                                                         const guchar *data);


pixel_region_get_col ()

void                pixel_region_get_col                (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint h,
                                                         guchar *data,
                                                         gint subsample);


pixel_region_set_col ()

void                pixel_region_set_col                (PixelRegion *PR,
                                                         gint x,
                                                         gint y,
                                                         gint h,
                                                         const guchar *data);


pixel_region_has_alpha ()

gboolean            pixel_region_has_alpha              (PixelRegion *PR);


pixel_regions_register ()

PixelRegionIterator * pixel_regions_register            (gint num_regions,
                                                         ...);


pixel_regions_process ()

PixelRegionIterator * pixel_regions_process             (PixelRegionIterator *PRI);


pixel_regions_process_stop ()

void                pixel_regions_process_stop          (PixelRegionIterator *PRI);