Code base obscuration (for images) 1.0
It implements different obscuration methods on portable images (.pgm and .ppm)
Loading...
Searching...
No Matches
obscurationPGM.hpp
Go to the documentation of this file.
1
10#include <iostream>
11#include <vector>
12#include <random>
13#include <bitset>
14#include <cstring>
15#include <fstream>
16#include <cstdio>
17#include <filesystem>
18#include <string>
19
20#ifndef OBSCURATION_PGM_LIBRARY
21#define OBSCURATION_PGM_LIBRARY
22
32{
33public:
34 //====================== Interpolate ======================//
48 static int interpolate_grey(int p11, int p21, int p12, int p22, float dx, float dy);
49
60 static void interpolate_bilinear_PGM(ImageBase &image, int &valV, float i, float j);
61
70 static void bilinearRedim299_PGM(ImageBase &image, ImageBase &o_image);
71
72 //====================== Average blurring ======================//
73
82 static void newAverageBlurring_PGM(ImageBase &image, std::vector<ImageBase> &o_images);
83
84 //====================== Scrambling ======================//
85
98 static void areaScrambling_PGM(ImageBase &image, ImageBase &o_image, int start_i, int start_j, int area_h, int area_w);
99
110 static void scrambling_PGM(ImageBase &image, ImageBase &o_image, int regionHeight, int regionWidth);
111
112 //====================== Averager ======================//
113
126 static void areaAverager_PGM(ImageBase &image, ImageBase &o_image, int start_i, int start_j, int area_h, int area_w);
127
138 static void averageByRegion_PGM(ImageBase &image, ImageBase &o_image, int regionHeight, int regionWidth);
139
140 //====================== Encryption ======================//
141
150 static void selectiveIndividualEncryption_PGM(ImageBase &image, ImageBase o_images[8]);
151
161 static void selectiveProgressiveEncryption_PGM(ImageBase &image, ImageBase o_images[8], bool MSBtoLSB);
162
173 static void selectiveGroupEncryption_PGM(ImageBase &image, ImageBase &o_image, int bitsGroup[8], int groupSize);
174};
175
176#endif // OBSCURATION_PGM_LIBRARY
This class is a base class for images. It provides some basic functionalities for images.
Definition ImageBase.hpp:21
This class contains common and useful methods for obscuring images.
Definition obscurationCommon.hpp:28
A subclass of obscurationCommon for obscuring images in the PGM format.
Definition obscurationPGM.hpp:32
static int interpolate_grey(int p11, int p21, int p12, int p22, float dx, float dy)
Interpolates a greyscale value between four neighboring pixels.
Definition obscurationPGM.cpp:20
static void interpolate_bilinear_PGM(ImageBase &image, int &valV, float i, float j)
Interpolates a greyscale value at a specific point in an image using bilinear interpolation.
Definition obscurationPGM.cpp:30
static void selectiveIndividualEncryption_PGM(ImageBase &image, ImageBase o_images[8])
Encrypts an image using selective individual encryption.
Definition obscurationPGM.cpp:206
static void scrambling_PGM(ImageBase &image, ImageBase &o_image, int regionHeight, int regionWidth)
Scrambles the pixels in an image.
Definition obscurationPGM.cpp:143
static void bilinearRedim299_PGM(ImageBase &image, ImageBase &o_image)
Resizes an image to 299x299 pixels using bilinear interpolation.
Definition obscurationPGM.cpp:41
static void areaScrambling_PGM(ImageBase &image, ImageBase &o_image, int start_i, int start_j, int area_h, int area_w)
Scrambles the pixels in a specific area of an image.
Definition obscurationPGM.cpp:119
static void averageByRegion_PGM(ImageBase &image, ImageBase &o_image, int regionHeight, int regionWidth)
Applies averaging to an image.
Definition obscurationPGM.cpp:183
static void selectiveGroupEncryption_PGM(ImageBase &image, ImageBase &o_image, int bitsGroup[8], int groupSize)
Encrypts an image using selective group encryption.
Definition obscurationPGM.cpp:256
static void selectiveProgressiveEncryption_PGM(ImageBase &image, ImageBase o_images[8], bool MSBtoLSB)
Encrypts an image using selective progressive encryption.
Definition obscurationPGM.cpp:228
static void areaAverager_PGM(ImageBase &image, ImageBase &o_image, int start_i, int start_j, int area_h, int area_w)
Applies averaging to a specific area of an image.
Definition obscurationPGM.cpp:166
static void newAverageBlurring_PGM(ImageBase &image, std::vector< ImageBase > &o_images)
Applies average blurring to an image.
Definition obscurationPGM.cpp:62
Header of super class containing common and useful methods for obscuring pgm and ppm images.