Giter Club home page Giter Club logo

cppa's Introduction

This directory contains our project for the course CPPA at EPITA.
We had to implement two adapters:
* the first one has to “convert” a graph to an image (STEP 1)
* the second one has to do the inverse (STEP 2)


To Compile:
* the 1st step: edit the Makefile by putting the correct file:
            SRC = ./src/step1_example.cc
* 2ns step: same thing but with:
            SRC = ./src/step2_example.cc
Those 2 files are self explanatory and serves as examples for the use of the adapter.




STEP 1:
The class AdapterGrToImg is a templated class which needs three parameters:
* coordType which is the type of coordinate on the image
* valueType which represents the type of the value of each point on the image
* graph which represents the type of the graph passed as argument


The constructor of this class needs a graph which has to implement two vertex properties:
* coordType coord
* valueType value


It can use severals methods:
* domain() which returns a range of points of the image
* values() which returns a range of constant / mutable value of the point of the image 
* pixels() which returns a combination of domain and values
* operator() (coordType coord) which returns the value of the point p
        


STEP 2:
The class AdapterGrToImg is a templated class which needs three parameters:
* coordType which is the type of coordinate on the image. Only few type are allowed: int, std::pair<int, int> and std::tuple<int, int, int> with the correct connexity
* valueType which represents the type of the value of each point on the image
* image which represents the type of the image passed as argument


The constructor needs a image and the connexity as argument:
* connexity = 2 if coordType is an int
* connexity = 4 or 8 if coordType is a pair
* connexity = 6 or 26 if coordType is a tuple


You can use the adapter as a graph with the operator().
The graph type will be:
boost::adjency_list<boost::listS, boost::vecS, boost::bidirectionnalS>

cppa's People

Contributors

aarzop avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.