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

A subclass of obscurationCommon for obscuring images in the PGM format. More...

#include <obscurationPGM.hpp>

Inheritance diagram for obscurationPGM:
Collaboration diagram for obscurationPGM:

Static Public Member Functions

static int interpolate_grey (int p11, int p21, int p12, int p22, float dx, float dy)
 Interpolates a greyscale value between four neighboring pixels.
 
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.
 
static void bilinearRedim299_PGM (ImageBase &image, ImageBase &o_image)
 Resizes an image to 299x299 pixels using bilinear interpolation.
 
static void newAverageBlurring_PGM (ImageBase &image, std::vector< ImageBase > &o_images)
 Applies average blurring to an image.
 
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.
 
static void scrambling_PGM (ImageBase &image, ImageBase &o_image, int regionHeight, int regionWidth)
 Scrambles the pixels in an image.
 
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.
 
static void averageByRegion_PGM (ImageBase &image, ImageBase &o_image, int regionHeight, int regionWidth)
 Applies averaging to an image.
 
static void selectiveIndividualEncryption_PGM (ImageBase &image, ImageBase o_images[8])
 Encrypts an image using selective individual encryption.
 
static void selectiveProgressiveEncryption_PGM (ImageBase &image, ImageBase o_images[8], bool MSBtoLSB)
 Encrypts an image using selective progressive encryption.
 
static void selectiveGroupEncryption_PGM (ImageBase &image, ImageBase &o_image, int bitsGroup[8], int groupSize)
 Encrypts an image using selective group encryption.
 
- Static Public Member Functions inherited from obscurationCommon
static void genPRNS (unsigned int seq[8])
 Generate a random sequence of 8 bits.
 
static void genBitsGroups (std::vector< std::vector< int > > &groups, int groupSize)
 Generate groups of bits.
 
static void intVec2intArray (std::vector< int > &vec, int arr[8])
 Convert a vector of integers to an array of integers.
 

Detailed Description

A subclass of obscurationCommon for obscuring images in the PGM format.

This class provides functions to obscure images in the PGM format, inspired by Norman Hutte's methods for PPM images.

Authors
Katia Auxilien, Norman Hutte
Date
April 2024

Member Function Documentation

◆ areaAverager_PGM()

void obscurationPGM::areaAverager_PGM ( ImageBase & image,
ImageBase & o_image,
int start_i,
int start_j,
int area_h,
int area_w )
static

Applies averaging to a specific area of an image.

Inspired by Norman Hutte's method areaAverager.

Parameters
imageThe image to average.
o_imageThe averaged image.
start_iThe starting row of the area to average.
start_jThe starting column of the area to average.
area_hThe height of the area to average.
area_wThe width of the area to average.
Authors
Katia Auxilien, Norman Hutte
Date
12 April 2024

◆ areaScrambling_PGM()

void obscurationPGM::areaScrambling_PGM ( ImageBase & image,
ImageBase & o_image,
int start_i,
int start_j,
int area_h,
int area_w )
static

Scrambles the pixels in a specific area of an image.

Inspired by Norman Hutte's method areaScrambling.

Parameters
imageThe image to scramble.
o_imageThe scrambled image.
start_iThe starting row of the area to scramble.
start_jThe starting column of the area to scramble.
area_hThe height of the area to scramble.
area_wThe width of the area to scramble.
Authors
Katia Auxilien, Norman Hutte
Date
12 April 2024

◆ averageByRegion_PGM()

void obscurationPGM::averageByRegion_PGM ( ImageBase & image,
ImageBase & o_image,
int regionHeight,
int regionWidth )
static

Applies averaging to an image.

Inspired by Norman Hutte's method averageByRegion.

Parameters
imageThe image to average.
o_imageThe averaged image.
regionHeightThe height of the regions to average.
regionWidthThe width of the regions to average.
Authors
Katia Auxilien, Norman Hutte
Date
12 April 2024

◆ bilinearRedim299_PGM()

void obscurationPGM::bilinearRedim299_PGM ( ImageBase & image,
ImageBase & o_image )
static

Resizes an image to 299x299 pixels using bilinear interpolation.

Inspired by Norman Hutte's method bilinearRedim299.

Parameters
imageThe image to resize.
o_imageThe resized image.
Authors
Katia Auxilien, Norman Hutte
Date
12 April 2024

◆ interpolate_bilinear_PGM()

void obscurationPGM::interpolate_bilinear_PGM ( ImageBase & image,
int & valV,
float i,
float j )
static

Interpolates a greyscale value at a specific point in an image using bilinear interpolation.

Inspired by Norman Hutte's method interpolate_bilinear.

Parameters
imageThe image to interpolate.
valVThe interpolated greyscale value.
iThe x-coordinate of the point to interpolate.
jThe y-coordinate of the point to interpolate.
Authors
Katia Auxilien, Norman Hutte
Date
12 April 2024

◆ interpolate_grey()

int obscurationPGM::interpolate_grey ( int p11,
int p21,
int p12,
int p22,
float dx,
float dy )
static

Interpolates a greyscale value between four neighboring pixels.

Inspired by Norman Hutte's method interpolate_color.

Parameters
p11The top-left pixel value.
p21The top-right pixel value.
p12The bottom-left pixel value.
p22The bottom-right pixel value.
dxThe distance between the desired point and the top-left pixel along the x-axis.
dyThe distance between the desired point and the top-left pixel along the y-axis.
Returns
The interpolated greyscale value.
Authors
Katia Auxilien, Norman Hutte
Date
12 April 2024

◆ newAverageBlurring_PGM()

void obscurationPGM::newAverageBlurring_PGM ( ImageBase & image,
std::vector< ImageBase > & o_images )
static

Applies average blurring to an image.

Inspired by Norman Hutte's method newAverageBlurring.

Parameters
imageThe image to blur.
o_imagesThe blurred images.
Authors
Katia Auxilien, Norman Hutte
Date
11 April 2024

◆ scrambling_PGM()

void obscurationPGM::scrambling_PGM ( ImageBase & image,
ImageBase & o_image,
int regionHeight,
int regionWidth )
static

Scrambles the pixels in an image.

Inspired by Norman Hutte's method scrambling.

Parameters
imageThe image to scramble.
o_imageThe scrambled image.
regionHeightThe height of the regions to scramble.
regionWidthThe width of the regions to scramble.
Authors
Katia Auxilien, Norman Hutte
Date
12 April 2024

◆ selectiveGroupEncryption_PGM()

void obscurationPGM::selectiveGroupEncryption_PGM ( ImageBase & image,
ImageBase & o_image,
int bitsGroup[8],
int groupSize )
static

Encrypts an image using selective group encryption.

Inspired by Norman Hutte's method selectiveGroupEncryption.

Parameters
imageThe image to encrypt.
o_imageThe encrypted image.
bitsGroupThe group of bits to encrypt.
groupSizeThe size of the group of bits to encrypt.
Authors
Katia Auxilien, Norman Hutte
Date
15 April 2024

◆ selectiveIndividualEncryption_PGM()

void obscurationPGM::selectiveIndividualEncryption_PGM ( ImageBase & image,
ImageBase o_images[8] )
static

Encrypts an image using selective individual encryption.

Inspired by Norman Hutte's method selectiveIndividualEncryption.

Parameters
imageThe image to encrypt.
o_imagesThe encrypted images.
Authors
Katia Auxilien, Norman Hutte
Date
15 April 2024

◆ selectiveProgressiveEncryption_PGM()

void obscurationPGM::selectiveProgressiveEncryption_PGM ( ImageBase & image,
ImageBase o_images[8],
bool MSBtoLSB )
static

Encrypts an image using selective progressive encryption.

Inspired by Norman Hutte's method selectiveProgressiveEncryption.

Parameters
imageThe image to encrypt.
o_imagesThe encrypted images.
MSBtoLSBWhether to encrypt from MSB to LSB or vice versa.
Authors
Katia Auxilien, Norman Hutte
Date
15 April 2024