Projeto ITP - Esteganografia 1.0
Loading...
Searching...
No Matches
decod.cpp File Reference
#include <bits/stdc++.h>
#include <filesystem>
#include "../include/Image.h"

Functions

int main (int argc, char *argv[])
 Prints out an ASCII message encoded in the least significant bit (LSB) of the pixels of a PPM image.
 

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Prints out an ASCII message encoded in the least significant bit (LSB) of the pixels of a PPM image.

Parameters
argc
argv

Verifies if the number of arguments is correct.

‍Stores the PPM image to be decoded.

Tests if the ReadPPM() function was successful, stops the decoding process otherwise.

13{
15 if (argc != 2)
16 {
17 cout << "Uso: " << argv[0] << " <nome_do_arquivo>" << endl;
18 return 1;
19 }
20
21 string img_name = argv[1];
22 Image img;
25 if (img.ReadPPM(img_name))
26 {
27 img.DecodeMsg();
28 }
29
30 img.LiberatePixels();
31
32 return 0;
33}
Defines a dinamically allocated PPM image and provides various methods to manipulate and access the i...
Definition Image.h:30
bool ReadPPM(const string &file_name)
Reads and dynamically stores the content of an image from a valid PPM file.
Definition Image.h:194
void LiberatePixels()
Deallocates the memory previously allocated by the AllocatePixels() function, as well as the memory a...
Definition Image.h:84
void DecodeMsg()
Main function used in uncovering and decrypting an ASCII message inside the least significant bits (L...
Definition Image.h:374