documentation update
This commit is contained in:
		
							parent
							
								
									1d014a20a7
								
							
						
					
					
						commit
						fe41a56c66
					
				@ -38,7 +38,7 @@ PROJECT_NAME           = "Compression par surfaces unies"
 | 
			
		||||
# could be handy for archiving the generated documentation or if some version
 | 
			
		||||
# control system is used.
 | 
			
		||||
 | 
			
		||||
PROJECT_NUMBER         = 0.4
 | 
			
		||||
PROJECT_NUMBER         = 1.0
 | 
			
		||||
 | 
			
		||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
 | 
			
		||||
# for a project that appears at the top of each page and should give viewer a
 | 
			
		||||
 | 
			
		||||
@ -57,18 +57,16 @@ void addPixelToSelectedZone(Image *t_img, int64_t t_idx, Zone *t_zone) {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  for (left_limit = t_idx; left_limit - (y - 1) * (int64_t)t_img->sizeX >= 0;
 | 
			
		||||
       --left_limit) { /* fetch right limit of segment */
 | 
			
		||||
       --left_limit) {
 | 
			
		||||
    current_pixel = darrayGet(t_img->pixels, (size_t)left_limit);
 | 
			
		||||
    if (current_pixel->visited || !sameColor(current_pixel, t_zone)) {
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
    (*current_pixel).visited = 1;
 | 
			
		||||
  }
 | 
			
		||||
  /* Add segment to its zone */
 | 
			
		||||
  darrayPushBack(t_zone->segments,
 | 
			
		||||
                 newSegment((uint32_t)right_limit, (uint32_t)left_limit));
 | 
			
		||||
  for (; left_limit <= right_limit;
 | 
			
		||||
       ++left_limit) { /* process every pixel up and down the segment */
 | 
			
		||||
  for (; left_limit <= right_limit; ++left_limit) {
 | 
			
		||||
    addPixelToSelectedZone(t_img, t_idx + t_img->sizeX, t_zone);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -86,25 +84,17 @@ void chooseZoneForPixel(Image *t_img, int64_t t_idx, darray *t_zones) {
 | 
			
		||||
  Zone *current_zone;
 | 
			
		||||
  Pixel *pixel;
 | 
			
		||||
  size_t i;
 | 
			
		||||
 | 
			
		||||
  pixel = darrayGet(t_img->pixels, (size_t)t_idx);
 | 
			
		||||
  /* if the pixel has already been visited, no need to continue */
 | 
			
		||||
  if (pixel->visited) {
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  /* for each known zone, see if it matches the current pixel's color */
 | 
			
		||||
  for (i = 0; i < darraySize(t_zones); ++i) {
 | 
			
		||||
    current_zone = darrayGet(t_zones, i);
 | 
			
		||||
    /* if it does, add selected pixel and its neighbouring pixels of the same
 | 
			
		||||
     * color */
 | 
			
		||||
    if (sameColor(pixel, current_zone)) {
 | 
			
		||||
      addPixelToSelectedZone(t_img, t_idx, current_zone);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  /* if none of the same color was found, create a new one, add it to the image
 | 
			
		||||
   * and add the selected pixel and its neighbours of the same color to the zone
 | 
			
		||||
   */
 | 
			
		||||
  current_zone = newZone(pixel->red, pixel->green, pixel->blue);
 | 
			
		||||
  darrayPushBack(t_zones, current_zone);
 | 
			
		||||
  addPixelToSelectedZone(t_img, t_idx, current_zone);
 | 
			
		||||
 | 
			
		||||
@ -200,11 +200,12 @@ int imageLoadPPM(const char *t_filename, Image *t_img) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
() *  Ouvre le fichier image avec son nom de fichier passé par le paramètre
 | 
			
		||||
 *  Ouvre le fichier image avec son nom de fichier passé par le paramètre
 | 
			
		||||
 *  `filename` et y écrit les informations trouvées dans l’objet `img`.
 | 
			
		||||
 *
 | 
			
		||||
 *  \param[in] t_filename Nom du fichier image à ouvrir
 | 
			
		||||
 *  \param[in] t_img Objet \ref Image à écrire
 | 
			
		||||
 *  \param[in] t_data Données décompressées de l’image au format natif ppm
 | 
			
		||||
 */
 | 
			
		||||
void imageSavePPM(const char *t_filename, Image *t_img, uint8_t *t_data) {
 | 
			
		||||
  FILE *fp;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user