Code base obscuration (for images) 1.0
It implements different obscuration methods on portable images (.pgm and .ppm)
Loading...
Searching...
No Matches
image_pgm.hpp
Go to the documentation of this file.
1
9#ifndef IMAGE_PGM
10#define IMAGE_PGM
11#include "image_portable.hpp"
12#include <stdlib.h>
13#include <stdio.h>
14#include <math.h>
15#include <stdint.h>
16#include <inttypes.h>
17#include <iostream>
18#include <string>
19using namespace std;
20
21typedef unsigned char OCTET;
22
30{
31public:
32 // uint8_t
33
43 static uint8_t lire_image_pgm_and_get_maxgrey(char nom_image[], uint8_t *pt_image, int taille_image);
44
55 static void ecrire_image_pgm_variable_size(char nom_image[], uint8_t *pt_image, int nb_lignes, int nb_colonnes, uint8_t max_value);
56
57 // uint16_t
67 static uint16_t lire_image_pgm_and_get_maxgrey(char nom_image[], uint16_t *pt_image, int taille_image);
68
79 static void ecrire_image_pgm_variable_size(char nom_image[], uint16_t *pt_image, int nb_lignes, int nb_colonnes, uint16_t max_value);
80
81 // Compress
95 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);
96
105 static pair<int, int> read_image_pgm_compressed_and_get_originalDimension(char nom_image[], uint16_t *pt_image);
106
107 // uint32_t
108
118 static uint32_t lire_image_pgm_and_get_maxgrey(char nom_image[], uint32_t *pt_image, int taille_image);
119
130 static void ecrire_image_pgm_variable_size(char nom_image[], uint32_t *pt_image, int nb_lignes, int nb_colonnes, uint32_t max_value);
131
132 // uint64_t
133
143 static uint64_t lire_image_pgm_and_get_maxgrey(char nom_image[], uint64_t *pt_image, int taille_image);
144
155 static void ecrire_image_pgm_variable_size(char nom_image[], uint64_t *pt_image, int nb_lignes, int nb_colonnes, uint64_t max_value);
156
165 static void lire_image_pgm_variable_size(char nom_image[], uint64_t *pt_image, int taille_image);
166
175 static void lire_nb_lignes_colonnes_image_p(char nom_image[], int *nb_lignes, int *nb_colonnes);
176
185 static void lire_image_p(char nom_image[], OCTET *pt_image, int taille_image);
186
196 static void ecrire_image_p(char nom_image[], OCTET *pt_image, int nb_lignes, int nb_colonnes);
197};
198
199#endif
The image_pgm class provides methods to read and write PGM images with various bit depths.
Definition image_pgm.hpp:30
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.
Definition image_pgm.cpp:69
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.
Definition image_pgm.cpp:45
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.
Definition image_pgm.cpp:387
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.
Definition image_pgm.cpp:233
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.
Definition image_pgm.cpp:21
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.
Definition image_pgm.cpp:124
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.
Definition image_pgm.cpp:96
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.
Definition image_pgm.cpp:202
Base class for portable image formats. This class provides an interface for reading and writing porta...
Definition image_portable.hpp:48
unsigned char OCTET
Definition image_pgm.hpp:21
This file defines the image_portable class, which is a base class for different image formats.