Changeset 513 for abuse/trunk/src/imlib/image.h
- Timestamp:
- Apr 20, 2011, 8:32:26 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/imlib/image.h
r512 r513 75 75 void *extended_descriptor; 76 76 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); 79 78 int16_t bound_x1(int16_t x1) { return x1 < clipx1 ? clipx1 : x1; } 80 79 int16_t bound_y1(int16_t y1) { return y1 < clipy1 ? clipy1 : y1; } … … 118 117 { 119 118 private: 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); 123 123 void delete_page(); 124 bool _locked;124 bool m_locked; 125 125 126 126 public: … … 129 129 image(spec_entry *e, bFILE *fp); 130 130 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); 133 132 ~image(); 134 133 … … 140 139 uint8_t *scan_line(int16_t y) 141 140 { 142 return data + y *size.x;141 return m_data + y * m_size.x; 143 142 } 144 143 uint8_t *next_line(int16_t lasty, uint8_t *last_scan) 145 144 { 146 return last_scan + size.x;145 return last_scan + m_size.x; 147 146 } 148 147 int32_t total_pixels(uint8_t background=0); … … 151 150 void to_24bit(palette &pal); 152 151 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; } 155 153 156 154 void scroll(int16_t x1, int16_t y1, int16_t x2, int16_t y2, … … 203 201 } 204 202 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); 208 205 void flood_fill(int16_t x, int16_t y, uint8_t color); 209 206 image *create_smooth(int16_t smoothness = 1); // 0 no smoothness
Note: See TracChangeset
for help on using the changeset viewer.