Ignore:
Timestamp:
Apr 20, 2011, 8:32:26 AM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: some more vec2i transition for simplicity.

File:
1 edited

Legend:

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

    r512 r513  
    7575    void *extended_descriptor;
    7676
    77     image_descriptor(int16_t length, int16_t height,
    78                      int keep_dirties = 1, int static_memory = 0);
     77    image_descriptor(vec2i size, int keep_dirties = 1, int static_memory = 0);
    7978    int16_t bound_x1(int16_t x1)  { return x1 < clipx1 ? clipx1 : x1; }
    8079    int16_t bound_y1(int16_t y1)  { return y1 < clipy1 ? clipy1 : y1; }
     
    118117{
    119118private:
    120     uint8_t *data;
    121     vec2i size;
    122     void make_page(int16_t width, int16_t height, uint8_t *page_buffer);
     119    uint8_t *m_data;
     120    vec2i m_size;
     121
     122    void make_page(vec2i size, uint8_t *page_buffer);
    123123    void delete_page();
    124     bool _locked;
     124    bool m_locked;
    125125
    126126public:
     
    129129    image(spec_entry *e, bFILE *fp);
    130130    image(bFILE *fp);
    131     image(int16_t width, int16_t height,
    132           uint8_t *page_buffer = NULL, int16_t create_descriptor = 0);
     131    image(vec2i size, uint8_t *page_buffer = NULL, int create_descriptor = 0);
    133132    ~image();
    134133
     
    140139    uint8_t *scan_line(int16_t y)
    141140    {
    142         return data + y * size.x;
     141        return m_data + y * m_size.x;
    143142    }
    144143    uint8_t *next_line(int16_t lasty, uint8_t *last_scan)
    145144    {
    146         return last_scan + size.x;
     145        return last_scan + m_size.x;
    147146    }
    148147    int32_t total_pixels(uint8_t background=0);
     
    151150    void to_24bit(palette &pal);
    152151
    153     vec2i Size() const { return size; }
    154     int Pitch() const { return size.x; } // FIXME: for now, pitch == width
     152    vec2i Size() const { return m_size; }
    155153
    156154    void scroll(int16_t x1, int16_t y1, int16_t x2, int16_t y2,
     
    203201    }
    204202    void dither(palette *pal); // use a b&w palette!
    205     void resize(int16_t new_width, int16_t new_height);
    206     void change_size(int16_t new_width, int16_t new_height,
    207                      uint8_t *page = NULL);
     203    void Scale(vec2i size);
     204    void SetSize(vec2i size, uint8_t *page = NULL);
    208205    void flood_fill(int16_t x, int16_t y, uint8_t color);
    209206    image *create_smooth(int16_t smoothness = 1); // 0 no smoothness
Note: See TracChangeset for help on using the changeset viewer.