Code base obscuration (for images) 1.0
It implements different obscuration methods on portable images (.pgm and .ppm)
Loading...
Searching...
No Matches
image_pgm Class Reference

The image_pgm class provides methods to read and write PGM images with various bit depths. More...

#include <image_pgm.hpp>

Inheritance diagram for image_pgm:
Collaboration diagram for image_pgm:

Static Public Member Functions

static uint8_t lire_image_pgm_and_get_maxgrey (char nom_image[], uint8_t *pt_image, int taille_image)
 Reads a PGM image with 8-bit depth and returns the maximum grey value.
 
static void ecrire_image_pgm_variable_size (char nom_image[], uint8_t *pt_image, int nb_lignes, int nb_colonnes, uint8_t max_value)
 Writes a PGM image with variable size.
 
static uint16_t lire_image_pgm_and_get_maxgrey (char nom_image[], uint16_t *pt_image, int taille_image)
 Reads a PGM image with 16-bit depth and returns the maximum grey value.
 
static void ecrire_image_pgm_variable_size (char nom_image[], uint16_t *pt_image, int nb_lignes, int nb_colonnes, uint16_t max_value)
 Writes a PGM image with variable size and 16-bit depth.
 
static void write_image_pgm_compressed_variable_size (char nom_image[], uint16_t *pt_image, int nb_lignes, int nb_colonnes, uint16_t max_value, int imgSize, int nHOriginal, int nWOriginal)
 Writes a compressed PGM image with variable size and 16-bit depth.
 
static pair< int, int > read_image_pgm_compressed_and_get_originalDimension (char nom_image[], uint16_t *pt_image)
 Reads a compressed PGM image with 16-bit depth and returns the original dimensions.
 
static uint32_t lire_image_pgm_and_get_maxgrey (char nom_image[], uint32_t *pt_image, int taille_image)
 Reads a PGM image with 32-bit depth and returns the maximum grey value.
 
static void ecrire_image_pgm_variable_size (char nom_image[], uint32_t *pt_image, int nb_lignes, int nb_colonnes, uint32_t max_value)
 Writes a PGM image with variable size and 32-bit depth.
 
static uint64_t lire_image_pgm_and_get_maxgrey (char nom_image[], uint64_t *pt_image, int taille_image)
 Reads a PGM image with 64-bit depth and returns the maximum grey value.
 
static void ecrire_image_pgm_variable_size (char nom_image[], uint64_t *pt_image, int nb_lignes, int nb_colonnes, uint64_t max_value)
 Writes a PGM image with variable size and 64-bit depth.
 
static void lire_image_pgm_variable_size (char nom_image[], uint64_t *pt_image, int taille_image)
 Reads a PGM image with variable size and 64-bit depth.
 
static void lire_nb_lignes_colonnes_image_p (char nom_image[], int *nb_lignes, int *nb_colonnes)
 Reads the number of lines and columns of a PGM image.
 
static void lire_image_p (char nom_image[], OCTET *pt_image, int taille_image)
 Reads a PGM image with variable size and stores it in an OCTET array.
 
static void ecrire_image_p (char nom_image[], OCTET *pt_image, int nb_lignes, int nb_colonnes)
 Writes a PGM image from an OCTET array with given dimensions.
 

Additional Inherited Members

- Static Protected Member Functions inherited from image_portable
static void ignorer_commentaires (FILE *f)
 A base class for different image formats.
 

Detailed Description

The image_pgm class provides methods to read and write PGM images with various bit depths.

Author
Katia Auxilien
Date
May 2024

Member Function Documentation

◆ ecrire_image_p()

void image_pgm::ecrire_image_p ( char nom_image[],
OCTET * pt_image,
int nb_lignes,
int nb_colonnes )
static

Writes a PGM image from an OCTET array with given dimensions.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the OCTET array.
nb_lignesThe number of lines in the image.
nb_colonnesThe number of columns in the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ ecrire_image_pgm_variable_size() [1/4]

void image_pgm::ecrire_image_pgm_variable_size ( char nom_image[],
uint16_t * pt_image,
int nb_lignes,
int nb_colonnes,
uint16_t max_value )
static

Writes a PGM image with variable size and 16-bit depth.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
nb_lignesThe number of lines in the image.
nb_colonnesThe number of columns in the image.
max_valueThe maximum value in the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ ecrire_image_pgm_variable_size() [2/4]

void image_pgm::ecrire_image_pgm_variable_size ( char nom_image[],
uint32_t * pt_image,
int nb_lignes,
int nb_colonnes,
uint32_t max_value )
static

Writes a PGM image with variable size and 32-bit depth.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
nb_lignesThe number of lines in the image.
nb_colonnesThe number of columns in the image.
max_valueThe maximum value in the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ ecrire_image_pgm_variable_size() [3/4]

void image_pgm::ecrire_image_pgm_variable_size ( char nom_image[],
uint64_t * pt_image,
int nb_lignes,
int nb_colonnes,
uint64_t max_value )
static

Writes a PGM image with variable size and 64-bit depth.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
nb_lignesThe number of lines in the image.
nb_colonnesThe number of columns in the image.
max_valueThe maximum value in the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ ecrire_image_pgm_variable_size() [4/4]

void image_pgm::ecrire_image_pgm_variable_size ( char nom_image[],
uint8_t * pt_image,
int nb_lignes,
int nb_colonnes,
uint8_t max_value )
static

Writes a PGM image with variable size.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
nb_lignesThe number of lines in the image.
nb_colonnesThe number of columns in the image.
max_valueThe maximum value in the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ lire_image_p()

void image_pgm::lire_image_p ( char nom_image[],
OCTET * pt_image,
int taille_image )
static

Reads a PGM image with variable size and stores it in an OCTET array.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the OCTET array.
taille_imageThe size of the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ lire_image_pgm_and_get_maxgrey() [1/4]

uint16_t image_pgm::lire_image_pgm_and_get_maxgrey ( char nom_image[],
uint16_t * pt_image,
int taille_image )
static

Reads a PGM image with 16-bit depth and returns the maximum grey value.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
taille_imageThe size of the image.
Returns
The maximum grey value in the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ lire_image_pgm_and_get_maxgrey() [2/4]

uint32_t image_pgm::lire_image_pgm_and_get_maxgrey ( char nom_image[],
uint32_t * pt_image,
int taille_image )
static

Reads a PGM image with 32-bit depth and returns the maximum grey value.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
taille_imageThe size of the image.
Returns
The maximum grey value in the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ lire_image_pgm_and_get_maxgrey() [3/4]

uint64_t image_pgm::lire_image_pgm_and_get_maxgrey ( char nom_image[],
uint64_t * pt_image,
int taille_image )
static

Reads a PGM image with 64-bit depth and returns the maximum grey value.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
taille_imageThe size of the image.
Returns
The maximum grey value in the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ lire_image_pgm_and_get_maxgrey() [4/4]

uint8_t image_pgm::lire_image_pgm_and_get_maxgrey ( char nom_image[],
uint8_t * pt_image,
int taille_image )
static

Reads a PGM image with 8-bit depth and returns the maximum grey value.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
taille_imageThe size of the image.
Returns
The maximum grey value in the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ lire_image_pgm_variable_size()

void image_pgm::lire_image_pgm_variable_size ( char nom_image[],
uint64_t * pt_image,
int taille_image )
static

Reads a PGM image with variable size and 64-bit depth.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
taille_imageThe size of the image.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ lire_nb_lignes_colonnes_image_p()

void image_pgm::lire_nb_lignes_colonnes_image_p ( char nom_image[],
int * nb_lignes,
int * nb_colonnes )
static

Reads the number of lines and columns of a PGM image.

Parameters
nom_imageThe name of the image file.
nb_lignesThe pointer to store the number of lines.
nb_colonnesThe pointer to store the number of columns.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ read_image_pgm_compressed_and_get_originalDimension()

pair< int, int > image_pgm::read_image_pgm_compressed_and_get_originalDimension ( char nom_image[],
uint16_t * pt_image )
static

Reads a compressed PGM image with 16-bit depth and returns the original dimensions.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
Returns
A pair containing the original number of lines and columns.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005

◆ write_image_pgm_compressed_variable_size()

void image_pgm::write_image_pgm_compressed_variable_size ( char nom_image[],
uint16_t * pt_image,
int nb_lignes,
int nb_colonnes,
uint16_t max_value,
int imgSize,
int nHOriginal,
int nWOriginal )
static

Writes a compressed PGM image with variable size and 16-bit depth.

Parameters
nom_imageThe name of the image file.
pt_imageThe pointer to the image data.
nb_lignesThe number of lines in the image.
nb_colonnesThe number of columns in the image.
max_valueThe maximum value in the image.
imgSizeThe size of the image.
nHOriginalThe original number of lines.
nWOriginalThe original number of columns.
Authors
Katia Auxilien, William Puech
Date
May 2024, Tue Mar 31 13:26:36 2005