Giter Club home page Giter Club logo

Comments (8)

Hagbuck avatar Hagbuck commented on June 15, 2024

La fonctionPGM_image* PGM_get_image_from_file(FILE * file) remplit la structure PGM_image. Elle utilise plusieurs fonctions intermédiaires permettant d'éviter la réécriture du code.

Il faut penser à commenter le fonctionnement des fonctions

from imagetools.

Hagbuck avatar Hagbuck commented on June 15, 2024

Commentaires ajoutés

from imagetools.

Hagbuck avatar Hagbuck commented on June 15, 2024

Notre méthode fonctionne bien pour un petit fichier, mais un fichier de 512*512 ne fonctionne pas (http://people.sc.fsu.edu/~jburkardt/data/pgma/lena.png)

Il faut considérer que les les lignes ne doivent pas dépasser 70 caractères ( et cela dans TOUT le programme).

Il faut également comprendre où notre méthode échoue et comment corriger le tir.

from imagetools.

Hagbuck avatar Hagbuck commented on June 15, 2024

On lit actuellement ligne par ligne, sauf que une ligne du fichier ne correspond pas forcement a une ligne de pixel !

from imagetools.

Hagbuck avatar Hagbuck commented on June 15, 2024

Une solution potentiel est la suivante :

Lire le fichier caractère par caractère
On compte les retour à la ligne pour savoir notre position
    Si ligne == 1 Alors Magic word
    Si ligne == 2 Alors width, height
    Si ligne == 3 Alors v_max
Si caractère = # alors on lit jusqu'à retour à la ligne

Ensuite pour le tableau de pixel, après avoir allouer dynamiquement la mémoire
On lit chaque caractère jusqu'à former un entier, une fois l'entier lut et confirmé, on l'injecte dans le tableau de pixels.

Avec cette méthode au évite de ce prendre la tête avec les retour à la ligne pour le tableau de pixel

from imagetools.

Hagbuck avatar Hagbuck commented on June 15, 2024

Créer une nouvelle branch pour coder la modification

from imagetools.

Hagbuck avatar Hagbuck commented on June 15, 2024

La nouvelle fonction lit correctement les fichiers (branch fill_struct_from_big_picture)

from imagetools.

Hagbuck avatar Hagbuck commented on June 15, 2024

Par contre le code est trop répétitif sur la lecture des nombres, il faut coder une fonction par fraction la fonction qui est illisible --> #16

from imagetools.

Related Issues (20)

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.