Merge branch 'develop' into release-0.1.0

This commit is contained in:
Alexandre Quessy
2014-04-30 22:48:06 -04:00
24 changed files with 375 additions and 226 deletions
+5
View File
@@ -4,3 +4,8 @@ LibreMapping known bugs
* cannot delete paints
* cannot remove points in meshes
On OS X
-------
QObject: shared QObject was deleted directly. The program is malformed and may crash.
mapmap(299,0x7fff79da0310) malloc: *** error for object 0x102229ce0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
+4 -48
View File
@@ -36,57 +36,13 @@ Shape* DestinationGLCanvas::getShapeFromMappingId(uid mappingId)
void DestinationGLCanvas::doDraw(QPainter* painter)
{
// // No sources = nothing to do.
// if (Common::nImages() == 0)
// return;
//
// // TODO: Ceci est un hack necessaire car tout est en fonction de la width/height de la texture.
// // Il faut changer ca.
// std::tr1::shared_ptr<TextureMapping> textureMapping = std::tr1::static_pointer_cast<TextureMapping>(Common::currentMapping);
// Q_CHECK_PTR(textureMapping);
//
// std::tr1::shared_ptr<Texture> texture = std::tr1::static_pointer_cast<Texture>(textureMapping->getPaint());
// Q_CHECK_PTR(texture);
//
// for (int i=0; i < Common::nImages(); i++)
// {
// std::tr1::shared_ptr<Texture> tex = std::tr1::static_pointer_cast<Texture>(Common::mappings[i]->getPaint());
// Q_CHECK_PTR(tex);
//
// // FIXME: maybe the texture id is actually 0 and it's ok, no?
// // we should use a boolean is_texture_loaded, or so
// if (tex->getTextureId() == 0)
// {
// tex->loadTexture();
// }
// }
if (getMainWindow() == NULL)
return;
glPushMatrix();
MappingManager& mappingManager = getMainWindow()->getMappingManager();
QVector<Mapping::ptr> mappings = mappingManager.getVisibleMappings();
// Draw the mappings.
QVector<Mapping::ptr> mappings = getMainWindow()->getMappingManager().getVisibleMappings();
for (QVector<Mapping::ptr>::const_iterator it = mappings.begin(); it != mappings.end(); ++it)
{
Mapping::ptr mapping = (*it);
// XXX: change : UGLY!
if (mapping->getType().endsWith("_texture"))
{
std::tr1::shared_ptr<TextureMapping> textureMapping = std::tr1::static_pointer_cast<TextureMapping>(mapping);
Q_CHECK_PTR(textureMapping);
std::tr1::shared_ptr<Texture> texture = std::tr1::static_pointer_cast<Texture>(textureMapping->getPaint());
Q_CHECK_PTR(texture);
if (texture->getTextureId() == 0)
texture->loadTexture();
}
// Draw the mappings.
getMainWindow()->getMapperByMappingId(mapping->getId())->draw(painter);
getMainWindow()->getMapperByMappingId((*it)->getId())->draw(painter);
}
// Draw the controls of current mapping.
-2
View File
@@ -36,8 +36,6 @@ public:
virtual Shape* getShapeFromMappingId(uid mappingId);
// virtual Quad& getQuad();
private:
virtual void doDraw(QPainter* painter);
};
+7
View File
@@ -65,3 +65,10 @@ Make a release
* merge into develop.
* keep developing.
XML file version number
-----------------------
* update its minor number when you introduce new features.
* update its major number when it's not backward-comptatible anymore with its previous versions
* generally, we should follow the MapMap version, when new changes are introduced. (no need to increment it otherwise)
* we will need to implement some fancy XML file version number checking in the future.
+1 -1
View File
@@ -52,7 +52,7 @@ Build on Mac OS X
* Install the Apple Developer Tools. You need to register with a credit card in the Apple Store in order to download it.
* Install Qt5. You can get it from http://qt-project.org/downloads and choose the default location.
* Install the GStreamer SDK development files.
* Install the GStreamer SDK development files http://docs.gstreamer.com/display/GstSDK/Installing+on+Mac+OS+X
Do this::
+3
View File
@@ -170,6 +170,8 @@ private:
// Actions-related.
bool okToContinue();
public:
bool loadFile(const QString &fileName);
bool saveFile(const QString &fileName);
void setCurrentFile(const QString &fileName);
@@ -184,6 +186,7 @@ private:
// Returns a short version of filename.
static QString strippedName(const QString &fullFileName);
private:
// Connects/disconnects project-specific widgets (paints and mappings).
void connectProjectWidgets();
void disconnectProjectWidgets();
+49 -1
View File
@@ -299,7 +299,7 @@ void TextureMapper::draw(QPainter* painter)
painter->beginNativePainting();
// Only works for similar shapes.
Q_ASSERT( outputShape->nVertices() == outputShape->nVertices());
Q_ASSERT( inputShape->nVertices() == outputShape->nVertices());
// Project source texture and sent it to destination.
texture->update();
@@ -333,6 +333,54 @@ void TextureMapper::draw(QPainter* painter)
void TextureMapper::drawInput(QPainter* painter)
{
Q_UNUSED(painter);
painter->beginNativePainting();
// Only works for similar shapes.
Q_ASSERT( inputShape->nVertices() == outputShape->nVertices());
// Project source texture and sent it to destination.
texture->update();
glEnable (GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture->getTextureId());
// Copy bits to texture iff necessary.
if (texture->bitsHaveChanged())
{
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
texture->getWidth(), texture->getHeight(), 0, GL_RGBA,
GL_UNSIGNED_BYTE, texture->getBits());
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
// FIXME: Does this draw the quad counterclockwise?
glBegin (GL_QUADS);
{
Util::correctGlTexCoord(0, 0);
glVertex3f (texture->getX(), texture->getY(), 0);
Util::correctGlTexCoord(1, 0);
glVertex3f (texture->getX()+texture->getWidth(), texture->getY(), 0);
Util::correctGlTexCoord(1, 1);
glVertex3f (texture->getX()+texture->getWidth(), texture->getY() + texture->getHeight(), 0);
Util::correctGlTexCoord(0, 1);
glVertex3f (texture->getX(), texture->getY() + texture->getHeight(), 0);
}
glEnd ();
glDisable(GL_TEXTURE_2D);
glPopMatrix();
painter->endNativePainting();
}
void TextureMapper::drawControls(QPainter* painter)
+5
View File
@@ -72,9 +72,14 @@ protected:
public:
virtual QWidget* getPropertiesEditor();
virtual void draw(QPainter* painter) = 0;
virtual void drawControls(QPainter* painter) = 0;
virtual void drawInput(QPainter* painter) { Q_UNUSED(painter); }
virtual void drawInputControls(QPainter* painter) { Q_UNUSED(painter); }
static void drawShapeContour(QPainter* painter, const Shape& shape, int lineWidth, const QColor& color);
public slots:
+6 -5
View File
@@ -18,20 +18,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAPPING_H_
#define MAPPING_H_
#include <QtGlobal>
#include <tr1/memory>
#include "Shape.h"
#include "Paint.h"
#include "UidAllocator.h"
/**
* Mapping is the central concept of Libremapping.
* Mapping is the central concept of this software.
*
* A Mapping represents a relationship between an input Paint and
* and output Shape where the paint (possibly modified by some other
@@ -85,6 +82,9 @@ public:
Paint::ptr getPaint() const { return _paint; }
Shape::ptr getShape() const { return _shape; }
virtual bool hasInputShape() const { return false; }
virtual Shape::ptr getInputShape() const { return Shape::ptr(); }
uid getId() const { return _id; }
void setLocked(bool locked) { _isLocked = locked; }
@@ -148,7 +148,8 @@ public:
}
public:
Shape::ptr getInputShape() const { return _inputShape; }
virtual bool hasInputShape() const { return true; }
virtual Shape::ptr getInputShape() const { return _inputShape; }
};
#endif /* MAPPING_H_ */
+2
View File
@@ -23,6 +23,7 @@
*/
#include "MediaImpl.h"
#include <cstring>
#include <iostream>
// -------- private implementation of VideoImpl -------
@@ -430,6 +431,7 @@ bool MediaImpl::runVideo() {
}
_videoNewBufferCounter--;
//std::cout << "VideoImpl::runVideo: read frame #" << _videoNewBufferCounter << std::endl;
}
_postRun();
+2 -3
View File
@@ -211,12 +211,11 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma
std::string typetags = command.at(1).toString().toStdString();
// Handle all OSC messages here
if (path == "/texture/uri" && typetags == "is")
if (path == "/mapmap/paint/media/load" && typetags == "is")
{
int paint_id = command.at(2).toInt();
std::string image_uri = command.at(3).toString().toStdString();
//std::cout << "TODO load /image/uri " << image_id << " " << image_uri << std::endl;
// TODO:
//std::cout << "load /mapmap/paint/media/load " << paint_id << " " << image_uri << std::endl;
main_window.setTextureUri(paint_id, image_uri);
}
+2 -2
View File
@@ -76,8 +76,8 @@ int Media::getHeight() const
}
void Media::update() {
if (impl_->runVideo())
bitsChanged = true;
//std::cout << "XXX Video::update()!" << std::endl;
impl_->runVideo();
}
const uchar* Media::_getBits() const
+4 -2
View File
@@ -41,8 +41,10 @@ bool ProjectReader::readFile(QIODevice *device)
}
QDomElement root = doc.documentElement();
if (root.tagName() != "project" || root.attribute("version") != "1.0") {
_xml.raiseError(QObject::tr("The file is not a mapmap version 1.0 file."));
// The handling of the version number will get fancier as we go.
if (root.tagName() != "project" || root.attribute("version") != "0.1")
{
_xml.raiseError(QObject::tr("The file is not a mapmap version 0.1 file."));
return false;
}
+1 -1
View File
@@ -33,7 +33,7 @@ bool ProjectWriter::writeFile(QIODevice *device)
_xml.writeStartDocument();
_xml.writeDTD("<!DOCTYPE mapmap>");
_xml.writeStartElement("project");
_xml.writeAttribute("version", "1.0");
_xml.writeAttribute("version", "0.1"); // Similar to pkg-config version numbers.
_xml.writeStartElement("paints");
for (int i = 0; i < _manager->nPaints(); i++)
+13 -9
View File
@@ -26,18 +26,22 @@ Build and install
-----------------
See the INSTALL file.
To use this software on Mac OS X:
* Install Qt5. You can get it from http://qt-project.org/downloads and choose the default location.
* Install the GStreamer SDK Runtime files from http://docs.gstreamer.com/display/GstSDK/Installing+on+Mac+OS+X
Authors
-------
* Sofian Audry, lead developer, project manager.
* Alexandre Quessy, release manager, developer, technical writer, project manager.
* Alexandre Quessy: release manager, developer, technical writer, project manager.
* Sofian Audry: lead developer, user interface designer, project manager.
Contributors
------------
* Mike Latona, user interface designer.
* Vasilis Liaskovitis, developer.
* Maxime Damecour, inspiration.
* Christian Ambaud, sponsor, inspiration.
* Louis Desjardins, project manager.
* Julien Keable, developer.
* Sylvain Cormier, developer.
* Mike Latona: user interface designer.
* Vasilis Liaskovitis: developer.
* Maxime Damecour: inspiration.
* Christian Ambaud: sponsor, inspiration.
* Louis Desjardins: project manager.
* Julien Keable: developer.
* Sylvain Cormier: developer.
+10 -138
View File
@@ -36,149 +36,21 @@ Shape* SourceGLCanvas::getShapeFromMappingId(uid mappingId)
else
{
Mapping::ptr mapping = getMainWindow()->getMappingManager().getMappingById(mappingId);
// TODO: this is real shit... : we should at the very least use some dynamic casting or (better) implement a correct
// class architecture to suit our needs
if (mapping->getType().endsWith("_texture"))
{
std::tr1::shared_ptr<TextureMapping> textureMapping = std::tr1::static_pointer_cast<TextureMapping>(mapping);
Q_CHECK_PTR(textureMapping);
return textureMapping->getInputShape().get();
}
else
return NULL;
Q_CHECK_PTR(mapping);
return mapping->getInputShape().get();
}
}
//Quad& SourceGLCanvas::getQuad()
//{
// std::tr1::shared_ptr<TextureMapping> textureMapping = std::tr1::static_pointer_cast<TextureMapping>(Common::currentMapping);
// Q_CHECK_PTR(textureMapping);
//
// std::tr1::shared_ptr<Quad> inputQuad = std::tr1::static_pointer_cast<Quad>(textureMapping->getInputShape());
// Q_CHECK_PTR(inputQuad);
//
// return (*inputQuad);
//}
void SourceGLCanvas::doDraw(QPainter* painter)
{
if (!getMainWindow()->hasCurrentPaint())
return;
uint paintId = getMainWindow()->getCurrentPaintId();
// Retrieve paint (as texture) and draw it.
Paint::ptr paint = getMainWindow()->getMappingManager().getPaintById(paintId);
Q_CHECK_PTR(paint);
// Retrieve all mappings associated to paint.
QMap<uid, Mapping::ptr> mappings = getMainWindow()->getMappingManager().getPaintMappingsById(paintId);
if (paint->getType() == "color")
_drawColor(painter, paint, mappings);
else
_drawTexture(painter, paint, mappings);
}
void SourceGLCanvas::_drawColor(QPainter* painter, Paint::ptr paint, QMap<uid, Mapping::ptr> mappings)
{
// Not doing anything for now.
Q_UNUSED(painter);
Q_UNUSED(paint);
Q_UNUSED(mappings);
}
void SourceGLCanvas::_drawTexture(QPainter* painter, Paint::ptr paint, QMap<uid, Mapping::ptr> mappings)
{
Q_UNUSED(painter);
std::tr1::shared_ptr<Texture> texture = std::tr1::static_pointer_cast<Texture>(paint);
Q_CHECK_PTR(texture);
// Load texture if needed.
if (texture->getTextureId() == 0) {
texture->loadTexture();
}
// Draw the texture.
glPushMatrix();
// Enable blending mode (for alphas).
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable (GL_LIGHTING);
glEnable (GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture->getTextureId());
if (texture->bitsHaveChanged())
{
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture->getWidth(), texture->getHeight(), 0, GL_RGBA,
GL_UNSIGNED_BYTE, texture->getBits());
}
//std::cout << texture->getX() << "x" << texture->getY() << " : " << texture->getWidth() << "x" << texture->getHeight() << " " << texture->getTextureId() << std::endl;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// TODO: Exact projection of texture
// see http://stackoverflow.com/questions/15242507/perspective-correct-texturing-of-trapezoid-in-opengl-es-2-0
// Draw source texture (not moving) in the center of the area.
// float centerX = (float) width() / 2.0f;
// float centerY = (float) height() / 2.0f;
// float textureHalfWidth = (float) texture->getWidth() / 2.0f;
// float textureHalfHeight = (float) texture->getHeight() / 2.0f;
glColor4f (1.0f, 1.0f, 1.0f, 1.0f);
// FIXME: Does this draw the quad counterclockwise?
glBegin (GL_QUADS);
{
Util::correctGlTexCoord(0, 0);
glVertex3f (texture->getX(), texture->getY(), 0);
Util::correctGlTexCoord(1, 0);
glVertex3f (texture->getX()+texture->getWidth(), texture->getY(), 0);
Util::correctGlTexCoord(1, 1);
glVertex3f (texture->getX()+texture->getWidth(), texture->getY() + texture->getHeight(), 0);
Util::correctGlTexCoord(0, 1);
glVertex3f (texture->getX(), texture->getY() + texture->getHeight(), 0);
}
glEnd ();
glDisable(GL_TEXTURE_2D);
for (QMap<uid, Mapping::ptr>::iterator it = mappings.begin(); it != mappings.end(); ++it)
{
// TODO: Ceci est un hack necessaire car tout est en fonction de la width/height de la texture.
// Il faut changer ca.
std::tr1::shared_ptr<TextureMapping> textureMapping = std::tr1::static_pointer_cast<TextureMapping>(it.value());
Q_CHECK_PTR(textureMapping);
std::tr1::shared_ptr<Shape> inputShape = std::tr1::static_pointer_cast<Quad>(textureMapping->getInputShape());
Q_CHECK_PTR(inputShape);
if (displayControls() &&
it.key() == getMainWindow()->getCurrentMappingId())
{
Mapper::ptr mapper = getMainWindow()->getMapperByMappingId(it.key());
Q_CHECK_PTR(mapper);
std::tr1::shared_ptr<TextureMapper> textureMapper = std::tr1::static_pointer_cast<TextureMapper>(mapper);
Q_CHECK_PTR(textureMapper);
textureMapper->drawInputControls(painter);
}
}
glPopMatrix();
if (getMainWindow()->hasCurrentMapping())
{
uint mappingId = getMainWindow()->getCurrentMappingId();
Mapper::ptr mapper = getMainWindow()->getMapperByMappingId(mappingId);
mapper->drawInput(painter);
if (displayControls())
mapper->drawInputControls(painter);
}
}
-4
View File
@@ -36,13 +36,9 @@ public:
// virtual ~SourceGLCanvas() {}
virtual Shape* getShapeFromMappingId(uid mappingId);
// virtual Quad& getQuad();
private:
virtual void doDraw(QPainter* painter);
void _drawColor(QPainter* painter, Paint::ptr paint, QMap<uid, Mapping::ptr> mappings);
void _drawTexture(QPainter* painter, Paint::ptr paint, QMap<uid, Mapping::ptr> mappings);
};
+22
View File
@@ -49,3 +49,25 @@ Fonctionnalités cool à faire plus tard
* animation de stroke par groupe
* OSC pour controler les positions et l'alpha des quads
OSC INTERFACE ADDITIONAL CALLBACKS
----------------------------------
Instead of using boolean values (true or false) we use numbers, where 0 means false, and any positive number means true.
You should make sure to block all incoming messages on that port if you don't want to be hacked during a show.
/mapmap/mapping/move/xy ,iff <mapping identifier> <x> <y>
/mapmap/mapping/vertex/source/xy ,iiff <mapping identifier> <vertex index> <x> <y>
/mapmap/mapping/vertex/destination/xy ,iiff <mapping identifier> <vertex index> <x> <y>
/mapmap/mapping/visible ,ii <mapping identifier> <enable>
/mapmap/mapping/highlight ,ii <mapping identifier> <enable>
/mapmap/mapping/vertex/highlight ,iii <mapping identifier> <vertex identifier> <enable>
/mapmap/project/load ,s <file>
/mapmap/project/save ,s <file>
/mapmap/paint/color/rgba ,iffff <paint identifier> <red> <green> <blue> <alpha> (each channel within [0,1])
/mapmap/paint/media/load ,is <paint identifier> <file>
/mapmap/paint/media/speed ,if <paint identifier> <speed ratio> (1.0 means 100% speed)
/mapmap/paint/media/seek ,il <paint identifier> <time position> (in milliseconds)
/mapmap/output/fullscreen ,i <enable>
/mapmap/output/size ,ii <width> <height>
/mapmap/output/position ,ii <x> <y>
+111
View File
@@ -0,0 +1,111 @@
Datasheet
===========
User Interface
--------------
* Create and destroy an unlimited amount of video texture sources paints. Textures can be video or image files.
* Create and destroy an unlimited amount of mappings. Each mapping is a shape on which a source paint is drawn.
* Color paints can be used as masks.
* Move layers.
* Save the project to a human-readable XML file.
* Load the project from a human-readable XML file.
* OpenSoundControl (OSC) support.
* Turn any quad into a mesh.
* Properties inspector.
Supported codecs and file formats
---------------------------------
Image file formats
~~~~~~~~~~~~~~~~~~
* PNG.
* SVG.
* JPEG.
Video containers
~~~~~~~~~~~~~~~~
* OGG.
* Quicktime. (MOV)
* AVI.
* Matroska. (MKV)
* etc.
Recommended video codecs
~~~~~~~~~~~~~~~~~~~~~~~~
* Motion-JPEG.
* Vorbis.
* MPEG4.
* H.264.
Supported Operating Systems
---------------------------
* Apple OS X 10.9.2 and up.
* Ubuntu GNU/Linux 12.04 and up.
* Fedora GNU/Linux 19 and up.
Recommended hardware configuration
----------------------------------
* Dual-core 1.0 GHz processor, or better.
* At least 1 Gb of RAM.
* Video card with 3D acceleration, OpenGL 2.0 support and at least 64 Mb or VRAM.
Using the OSC interface
-----------------------
You can control MapMap via a set of OSC messages. OpenSoundControl allows users to send messages to control audio and video software. These messages are transmitted via UDP/IP. This allows one to control multi-projector shows with little efforts.
MapMap listens for incoming OSC messages on the default port 12345.
Roadmap (to do)
---------------
* Change default OSC port. (currently 12345)
* Allow to change the default OSC port via the GUI.
* Reorder layers.
* MIDI support.
* Art-Net support.
* Make output window fullscreen.
* Port to Microsoft Windows 8.
* Port to iOS.
* Port to Android.
* Support multiple output windows.
* Chroma-key effect.
* Luma-key effect.
* More control via OSC.
* Live video capture. (camera)
* Syphon support on Apple OS X.
* Shared memory support on all operating systems.
* Transition between video clips.
* Anti-aliasing.
* Multiple cues for video files playback in a project.
* Multiple layouts in a project.
* Reorder mappings.
* Sample OSC clients: Python, bash, Pure Data, Processing.
* Allow to start the software with no GUI.
* Support OSC via TCP.
* Implement a JSON REST interface.
* Bézier curves.
* Pause and resume media files.
* Support RTSP URI.
* Support audio.
Fiche technique
===========
+58 -7
View File
@@ -6,28 +6,79 @@
#include "Common.h"
#include "MainWindow.h"
#include "MainApplication.h"
#include <stdlib.h>
#include <iostream>
static void set_env_vars_if_needed()
{
#ifdef __MACOSX_CORE__
std::cout << "OS X detected. Set environment for GStreamer-SDK support." << std::endl;
if (0 == setenv("GST_PLUGIN_PATH", "/Library/Frameworks/GStreamer.framework/Libraries", 1))
std::cout << " * GST_PLUGIN_PATH=Library/Frameworks/GStreamer.framework/Libraries" << std::endl;
if (0 == setenv("GST_DEBUG", "2", 1))
std::cout << " * GST_DEBUG=2" << std::endl;
//setenv("LANG", "C", 1);
#endif // __MACOSX_CORE__
}
// This class is just used to provide sleep functionalities in the main() method.
class I : public QThread
{
public:
static void sleep(unsigned long secs) {
QThread::sleep(secs);
}
static void msleep(unsigned long msecs) {
QThread::msleep(msecs);
}
static void usleep(unsigned long usecs) {
QThread::usleep(usecs);
}
};
int main(int argc, char *argv[])
{
// TODO: avoid segfaults when OSC port is busy
set_env_vars_if_needed();
MainApplication app(argc, argv);
if (! QGLFormat::hasOpenGL())
{
std::cerr << "This system has no OpenGL support" << std::endl;
return 1;
}
if (!QGLFormat::hasOpenGL())
qFatal("This system has no OpenGL support.");
// Create splash screen.
QPixmap pixmap("splash.png");
QSplashScreen splash(pixmap);
// Show splash.
splash.show();
splash.showMessage(" " + QObject::tr("Initiating your program now..."),
Qt::AlignLeft | Qt::AlignTop, QColor("#f6f5f5"));
// Set translator.
QTranslator translator;
translator.load("mapmap_fr");
app.installTranslator(&translator);
MainWindow win;
// Let splash for at least one second.
I::sleep(1);
// Create window.
MainWindow win;
//win.setLocale(QLocale("fr"));
// Load file from commandline (optional).
if (QCoreApplication::arguments().size() > 1)
win.loadFile(QCoreApplication::arguments().at(1));
// Show window.
win.show();
// Terminate splash.
splash.finish(&win);
splash.raise();
// Start app.
return app.exec();
}
+57
View File
@@ -0,0 +1,57 @@
How to use MapMap to create to do video mapping
===============================================
Launching the application
-------------------------
On Apple OS X, open the application by either double-clicking on its icon in the Finder, or by clicking on its icon in the Dock.
On Debian or Ubuntu GNU/Linux, find its icon in the application menu and activate it.
Paints and mappings
-------------------
A paint is some materials to be drawn. Currently supported paint types are color paint and media paint.
A mapping is a shape in the output window on which to display some paint. Currently supported shapes are: quads and circles. When quads have a dimension of two by two (2x2) vertices, they are actuals quads. When they have more than 2x2 vertices, they are called meshes. A mesh is a grid of vertices that allow more flexible mapping.
The elements of the user interface
----------------------------------
The application has a main window and an output window. The main window includes the toolbar, input viewport, the output viewport, the list of paints, the list of mappings and the property inspector.
Make the output window fullscreen before starting to do video mapping on an actual object. This is necessary so that the pixel positions match the actual location of the pixels drawn by the projector. One should also make sure to use the native resolution of the projector, for best results, if any.
Note that there are handles that are drawn on the mappings in the output window, to ease editing. For a show, one will most probably want to disable them. Uncheck the "View > Display canvas controls" menu item to do so.
Create a media paint
--------------------
Choose File > Import media source file... or click on the button in the toolbar. Choose a media file using the dialog.
Create a mapping
----------------
First, select the desired paint for the mapping in the paint list. To create a quad, click on the "Choose Quad/Mesh" button in the toolbar. Move around the vertices of the quad by click and dragging near them. The closest vertex should be dragged. You can also use the number boxes in the property inspector to move the vertices.
To make a mesh from a quad, change its dimension using its width and height mumber boxes.
Creating a triangle is very similar to creating a quad. Move around its vertices with the mouse.
To create a circle do the same as for a quad or a triangle. Changing its size, orientation and position is a bit tricky, though. Play around by drag and dragging the vertices of the blue shape that is in the input and output viewports.
Create a color paint
--------------------
Color paints can be used as black masks and must be created the same way as a media paint, but it's a color dialog instead.
Destroy a mapping
-----------------
Mapping can be destroyed simply by selecting it in the mapping list, and then choosing the "Edit > Delete" menu item.
Destroy a paint
---------------
Paints can be destroyed simply by selecting it in the paint list, and then choosing the "Edit > Delete" menu item. Since all the mappings that use that paint will also be delete, a dialog will ask you for confirmation.
Save the project to a file
--------------------------
To save the current project, choose "File > Save as..." and then choose a file name. The extension file is ".mmp", but the file format is simply XML, a very common one.
Load a project from a file
--------------------------
To load a project from a file, choose "File > Open...".
+3 -3
View File
@@ -96,9 +96,9 @@ unix:!mac {
mac {
TARGET = MapMap
DEFINES += MACOSX
INCLUDEPATH += \
/opt/local/include/ \
/opt/local/include/libxml2
# INCLUDEPATH += \
# /opt/local/include/ \
# /opt/local/include/libxml2
LIBS += \
-framework OpenGL \
-framework GLUT
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
set -o verbose
#export GST_PLUGIN_PATH=/Library/Frameworks/GStreamer.framework/Libraries
export LANG=C
# export GST_DEBUG=3
#FILEPATH=/Users/aalex/Desktop/mapmap-videos/BonneFete.mov
FILEPATH=/Users/aalex/Downloads/sintel_trailer-480p.ogv
gst-launch-0.10 uridecodebin uri=file://${FILEPATH} ! ffmpegcolorspace ! autovideosink
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB