added resizer

This commit is contained in:
albert
2010-02-08 01:40:39 -05:00
parent 3d70335d92
commit 9c441aff4c
24 changed files with 1715 additions and 341 deletions

View File

@@ -0,0 +1,40 @@
#ifndef ROW_BUFFER_H
#define ROW_BUFFER_H
#include <stdint.h>
class RowBuffer
{
public:
RowBuffer();
~RowBuffer();
bool Init(int Width, int Height, int BPP);
/* Return row, allocating if necessary. */
uint8_t *GetRow(int row);
// Free rows [0,DiscardRow).
void DiscardRows(int DiscardRow);
/* Get a range of rows allocated in m_Rows: [m_StartRow,m_EndRow). If
* more than one allocated range exists, which range is returned is undefined. */
int GetStartRow() const { return m_StartRow; }
int GetEndRow() const { return m_EndRow; }
const uint8_t *const *GetRows() const { return m_Rows; }
private:
/* Array of image rows. These are allocated as needed. */
uint8_t **m_Rows;
/* in m_Rows is allocated: */
int m_StartRow;
int m_EndRow;
int m_Width;
int m_Height;
int m_BPP;
};
#endif