Ignore:
Timestamp:
Apr 22, 2011, 7:32:09 PM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: reimplement trans_image::put_scan_line so that it uses the
common template for all blitting functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/timage.h

    r531 r532  
    99 */
    1010
    11 #ifndef __TIMAGE_HPP_
    12 #define __TIMAGE_HPP_
     11#ifndef __TIMAGE_HPP__
     12#define __TIMAGE_HPP__
    1313
    1414#include "image.h"
     
    1616#include "filter.h"
    1717
    18 /* data is stored in the following format
     18/*  Data is stored in the following format:
     19 *
     20 *   uint8_t skip;       // transparent pixel count
     21 *   uint8_t size;       // solid pixel count
     22 *   uint8_t data[size]; // solid pixel values
     23 *   ...
     24 *   (no scan line wraps allowed, there can be a last skip value)
     25 */
    1926
    20   skip amount, data size, data  // no scan line wraps allowed
    21 
    22 */
    23 
    24 
    25 class trans_image       // transpernet image
     27class trans_image // transparent image
    2628{
    2729public:
    28   trans_image(image *im, char const *name);
    29   ~trans_image();
     30    trans_image(image *im, char const *name);
     31    ~trans_image();
    3032
    31   inline vec2i Size() { return m_size; }
    32   inline uint8_t *Data() { return m_data; }
     33    inline vec2i Size() { return m_size; }
     34    inline uint8_t *Data() { return m_data; }
    3335
    34   image *ToImage();
     36    image *ToImage();
    3537
    36   void PutImage(image *screen, int x, int y); // always transparent
    37   void PutRemap(image *screen, int x, int y, uint8_t *remap);
    38   void PutDoubleRemap(image *screen, int x, int y,
    39                       uint8_t *remap, uint8_t *remap2);
    40   void PutFade(image *screen, int x, int y, int amount, int total_frames,
    41                color_filter *f, palette *pal);
    42   void PutFadeTint(image *screen, int x, int y, int amount, int total_frames,
    43                    uint8_t *tint, color_filter *f, palette *pal);
    44   void PutColor(image *screen, int x, int y, uint8_t color);
    45   void PutFilled(image *screen, int x, int y, uint8_t color);
    46   void PutPredator(image *screen, int x, int y);
    47   void PutBlend(image *screen, int x, int y, image *blend, int bx, int by,
    48                 int blend_amount, color_filter *f, palette *pal);
     38    void PutImage(image *screen, int x, int y); // always transparent
     39    void PutRemap(image *screen, int x, int y, uint8_t *remap);
     40    void PutDoubleRemap(image *screen, int x, int y,
     41                        uint8_t *remap, uint8_t *remap2);
     42    void PutFade(image *screen, int x, int y, int amount, int total_frames,
     43                 color_filter *f, palette *pal);
     44    void PutFadeTint(image *screen, int x, int y, int amount, int total_frames,
     45                     uint8_t *tint, color_filter *f, palette *pal);
     46    void PutColor(image *screen, int x, int y, uint8_t color);
     47    void PutFilled(image *screen, int x, int y, uint8_t color);
     48    void PutPredator(image *screen, int x, int y);
     49    void PutBlend(image *screen, int x, int y, image *blend, int bx, int by,
     50                  int blend_amount, color_filter *f, palette *pal);
     51    void PutScanLine(image *screen, int x, int y, int line);
    4952
    50   void put_scan_line(image *screen, int x, int y, int line);   // always transparent
    51   size_t MemUsage();
     53    size_t MemUsage();
    5254
    5355private:
    54   uint8_t *ClipToLine(image *screen, int x1, int y1, int x2, int y2,
    55                       int x, int &y, int &ysteps);
     56    uint8_t *ClipToLine(image *screen, int x1, int y1, int x2, int y2,
     57                        int x, int &y, int &ysteps);
    5658
    57   enum PutMode { NORMAL, REMAP, DOUBLE_REMAP, FADE, FADE_TINT, COLOR,
    58                  FILLED, PREDATOR, BLEND };
    59   template<int N>
    60   void PutImageGeneric(image *dest, int x, int y, uint8_t color,
    61                        image *blend, int bx, int by,
    62                        uint8_t *map1, uint8_t *map2, int amount,
    63                        int total_frames, uint8_t *tint,
    64                        color_filter *f, palette *pal);
     59    enum PutMode { NORMAL, REMAP, REMAP2, FADE, FADE_TINT, COLOR,
     60                   FILLED, PREDATOR, BLEND, SCANLINE };
     61    template<int N>
     62    void PutImageGeneric(image *dest, int x, int y, uint8_t color,
     63                         image *blend, int bx, int by,
     64                         uint8_t *map1, uint8_t *map2, int amount,
     65                         int total_frames, uint8_t *tint,
     66                         color_filter *f, palette *pal);
    6567
    66   vec2i m_size;
    67   uint8_t *m_data;
     68    vec2i m_size;
     69    uint8_t *m_data;
    6870};
    6971
Note: See TracChangeset for help on using the changeset viewer.