// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
// //
-// Written by Francois Fleuret, (C) IDIAP //
+// Written by Francois Fleuret //
+// (C) Idiap Research Institute //
+// //
// Contact <francois.fleuret@idiap.ch> for comments & bug reports //
///////////////////////////////////////////////////////////////////////////
delete[] _content;
}
-void Image::crop(int xmin, int ymin, int width, int height) {
- ASSERT(xmin >= 0 && xmin + width <= _width &&
- ymin >= 0 && ymin + height <= _height);
- unsigned char *new_content = new unsigned char[width * height];
- for(int y = 0; y < height; y++) {
- for(int x = 0; x < width; x++) {
- new_content[x + (y * width)] = _content[x + xmin + _width * (y + ymin)];
- }
- }
- delete[] _content;
- _content = new_content;
- _width = width;
- _height = height;
-}
-
void Image::to_rgb(RGBImage *image) {
int c;
for(int y = 0; y < _height; y++) {