2
* @file movement_from_image.hpp
3
* @author Ugo Cupcic <ugo@shadowrobot.com>
4
* @date Tue Sep 27 10:05:01 2011
7
* Copyright 2011 Shadow Robot Company Ltd.
9
* This program is free software: you can redistribute it and/or modify it
10
* under the terms of the GNU General Public License as published by the Free
11
* Software Foundation, either version 2 of the License, or (at your option)
14
* This program is distributed in the hope that it will be useful, but WITHOUT
15
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19
* You should have received a copy of the GNU General Public License along
20
* with this program. If not, see <http://www.gnu.org/licenses/>.
22
* @brief Reads a png file and creates a movement from it.
28
#ifndef _MOVEMENT_FROM_IMAGE_HPP_
29
#define _MOVEMENT_FROM_IMAGE_HPP_
31
#include <png++/png.hpp>
32
#include "sr_movements/partial_movement.hpp"
36
class MovementFromImage : public PartialMovement
39
MovementFromImage(std::string image_path);
40
virtual ~MovementFromImage();
44
* Generates a movement from the given png file:
45
* - Reads the image from the top left corner, row by row.
46
* - The first encountered pixel is the target (the scale is
47
* the full range of the joint = the height of the png).
49
* @param image an image containing a movement.
51
void generate_movement( png::image<png::rgb_pixel> image);
55
/* For the emacs weenies in the crowd.