-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation
IntImage allocateIntImage(int width, int height, int minValue, int maxValue);
Allocates an empty image in the domain [0...width) x [0..height) with the specified parameters.
-
width
-- The width of the image in pixels. -
height
-- The height of the image in pixels. -
minValue
-- The minimum possible value this image should be able to contain. -
maxValue
-- The maximum possible value this image should be able to contain.
IntImage allocateDefaultIntImage(int width, int height);
Allocates an empty image in the domain [0...width) x [0..height) with an infinite dynamic range.
-
width
-- The width of the image in pixels. -
height
-- The height of the image in pixels.
IntImage allocateFromIntImage(IntImage image);
Allocates an empty image with the domain and dynamic range of the provided image. Does not copy pixel values.
-
image
-- The image whose properties to copy.
IntImage copyIntImage(IntImage image);
Creates a copy of the provided image.
-
image
-- The image to copy.
IntImage allocateIntImageGrid(int minX, int maxX, int minY, int maxY, int minValue, int maxValue);
Allocates an empty image in the domain [minX...maxX] x [minY..maxY] with the specified parameters.
-
minX
-- The start of the image domain in the x direction. -
maxX
-- The end of the image domain in the x direction. -
minY
-- The start of the image domain in the y direction. -
maxY
-- The end of the image domain in the y direction. -
minValue
-- The minimum possible value this image should be able to contain. -
maxValue
-- The maximum possible value this image should be able to contain.
IntImage allocateIntImageGridDomain(ImageDomain domain, int minValue, int maxValue);
Allocates an empty image in the domain [minX...maxX] x [minY..maxY] with the specified parameters.
-
domain
-- Domain the image should have. -
minValue
-- The minimum possible value this image should be able to contain. -
maxValue
-- The maximum possible value this image should be able to contain.
void freeIntImage(IntImage image);
Frees the memory used by the provided image.
-
image
-- The image for which to free the memory.
ImageDomain getIntImageDomain(IntImage image);
Retrieve the domain information of the provided image.
-
image
-- The image from which to retrieve the domain.
int isInDomain(ImageDomain domain, int x, int y);
Checks whether the provided (x,y) coordinates are in the provided domain.
-
domain
-- The domain of the image. -
x
-- The x coordinate of the pixel to check. -
y
-- The y coordinate of the pixel to check.
int isInDomainI(ImageDomain domain, int x, int y);
Checks whether the provided (x,y) coordinates are in the provided domain without taking into consideration theimage domain. This means that the x and y should fall within the range [0..width) and [0..height) respectively.
-
domain
-- The domain of the image. -
x
-- The x coordinate of the pixel to check. -
y
-- The y coordinate of the pixel to check.
void getImageDomainValues(ImageDomain domain, int *minX, int *maxX, int *minY, int *maxY);
Quality of life function. Puts the properties of the image domain into the provided arguments.
-
domain
-- The domain of the image. -
minX
-- The start of the image domain in the x direction. -
maxX
-- The end of the image domain in the x direction. -
minY
-- The start of the image domain in the y direction. -
maxY
-- The end of the image domain in the y direction.
void getMinMax(IntImage image, int *minimalValue, int *maximalValue);
Puts the minimum value and maximum value found in the provided image into the minimalValue and maximalValuerespectively.
-
image
-- The image in which to find the minimum and maximum values. -
minimalValue
-- The resulting minimal value will be put here. -
maximalValue
-- The resulting maximal value will be put here.
void getDynamicRange(IntImage image, int *minRange, int *maxRange);
Retrieve the dynamic range of the provided image.
-
image
-- The image from which to retrieve the dynamic range. -
minRange
-- The minimum possible value this image is able to contain will be put here. -
maxRange
-- The maximum possible value this image is able to contain will be put here.
int getIntPixel(IntImage image, int x, int y);
Retrieves the pixel value of the image at the provided coordinates. Note that x and y can be negative if theimage domain allows for this.
-
image
-- The image from which to retrieve the pixel value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve.
int getIntPixelI(IntImage image, int x, int y);
Retrieves the pixel value of the image at the provided coordinates without taking into consideration the imagedomain. This means that the x and y should fall within the range [0..width) and [0..height) respectively.
-
image
-- The image from which to retrieve the pixel value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve.
void setIntPixel(IntImage *image, int x, int y, int greyValue);
Set the grey value of the image at the provided coordinateswithout taking into consideration the imagedomain. This means that the x and y should fall within the range [0..width) and [0..height) respectively.Additionally, the grey value should fit in the dynamic range of the image.
-
image
-- The image in which to set the pixel value. -
x
-- The x coordinate of the pixel to set. -
y
-- The y coordinate of the pixel to set. -
greyValue
-- The grey value to put at (x,y).
void setIntPixelI(IntImage *image, int x, int y, int greyValue);
Set the grey value of the image at the provided coordinates. Note that the x and y should fall within therange [0..width) and [0..height) respectively.
-
image
-- The image in which to set the pixel value. -
x
-- The x coordinate of the pixel to set. -
y
-- The y coordinate of the pixel to set. -
greyValue
-- The grey value to put at (x,y).
void setAllIntPixels(IntImage *image, int greyValue);
Sets all the pixels in the provided image to the provided grey value. Note that the grey value should fit inthe dynamic range of the image.
-
image
-- The image in which to set all the pixel values. -
greyValue
-- The grey value to put in the image.
void setDynamicRange(IntImage *image, int newMinRange, int newMaxRange);
Updates the dynamic range of the image
-
image
-- The image to update the dynamic range of. -
newMinRange
-- The new minimum possible value this image should be able to contain. -
newMaxRange
-- The new maximum possible value this image should be able to contain.
void printIntBuffer(IntImage image);
Prints all the pixel values in the provided image to stdout. Every row is put on a new line.
-
image
-- The image to print.
void printIntImageLatexTable(IntImage image);
Prints a LaTeX compatible table representation of the provided image to stdout.
-
image
-- The image to print the LaTeX table of.
void printIntLatexTableToFile(FILE *out, IntImage image);
Prints a LaTeX compatible table representation of the provided image to the provided file stream.
-
out
-- File stream to print the image to. -
image
-- The image to print the LaTeX table of.
void displayIntImage(IntImage image, const char *windowTitle);
Opens a window that allows the user to view the image. Note that this uses OpenGL which in turn allocatesmemory that cannot be freed. If you want to check for memory leaks, make sure that you do not run any image displays.Only prints a warning if the NOVIEW flag is enabled.
-
image
-- The image to view -
windowTitle
-- The title of the window.
IntImage loadIntImage(const char *path);
Loads an image from the provided file. Supported extensions: .pbm, .pgm, .ppm.
-
path
-- The path of the image to load.
void saveIntImage(IntImage image, const char *path);
Saves an image at the provided location. Supported extensions: .pbm, .pgm, .ppm. This will save the netpbmfiles as their binary formats.
-
image
-- The images to save. -
path
-- The location to save the image at.
void saveIntImagePGMRaw(IntImage image, const char *path);
Saves an image at the provided location. The location must be a .pgm file. Pixels values are stored as rawbytes in the file.
-
image
-- The images to save. -
path
-- The location to save the image at.
void saveIntImagePGMAscii(IntImage image, const char *path);
Saves an image at the provided location. The location must be a .pgm file. Pixels values are stored as ascii(human readable) values in the file.
-
image
-- The images to save. -
path
-- The location to save the image at.
void saveIntImagePBMRaw(IntImage image, const char *path);
Saves an image as a binary image at the provided location. The location must be a .pbm file. Pixels values arestored as raw bits in the file.
-
image
-- The images to save. -
path
-- The location to save the image at.
void saveIntImagePBMAscii(IntImage image, const char *path);
Saves an image as a binary image at the provided location. The location must be a .pbm file. Pixels values arestored as ascii (human readable) values in the file.
-
image
-- The images to save. -
path
-- The location to save the image at.
IntImage maxIntImage(IntImage imageA, IntImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = max(f(x,y),g(x,y)).
-
imageA
-- First input image -
imageB
-- Second input image
IntImage minIntImage(IntImage imageA, IntImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = min(f(x,y),g(x,y)).
-
imageA
-- First input image. -
imageB
-- Second input image.
IntImage addIntImage(IntImage imageA, IntImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = f(x,y) + g(x,y).
-
imageA
-- First input image. -
imageB
-- Second input image.
IntImage subtractIntImage(IntImage imageA, IntImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = f(x,y) - g(x,y).
-
imageA
-- First input image. -
imageB
-- Second input image.
IntImage multiplyIntImage(IntImage imageA, IntImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = f(x,y) * g(x,y).
-
imageA
-- First input image. -
imageB
-- Second input image.
IntImage applyLutIntImage(IntImage image, int *LUT, int LUTsize);
Produces an output image that is the result of applying a lookup table (LUT) to the input image. The LUTshould have the same size as the dynamic range of the input image.
-
image
-- Input image. -
LUT
-- The lookup table. Maps a gray value in [minRange..maxRange] of the image to a new gray value. -
LUTSize
-- The size of the lookup table.
IntImage distanceTransform(IntImage image, int metric, int foreground);
Performs a distance transform on the provided image.It calculates for each foreground pixel the distance to the nearest background pixel based on some metric.
-
image
-- The image to perform the distance transform on. -
metric
-- The metric to use for the distance transform. Should be one of the constants: MANHATTAN, CHESSBOARD,EUCLID or SQEUCLID. -
foreground
-- Pixels with this pixel value are assumed as foreground pixels in the distance transforms. Pixelsthat have different values are assumed to be background pixels.
IntImage padIntImage(IntImage image, int top, int right, int bottom, int left, int padValue);
Produces a new, padded image from the provided image. Note that this allocates a new image, which shouldsubsequently be freed.
-
image
-- The image to pad. -
top
-- Number of pixels to pad at the top. -
right
-- Number of pixels to pad to the right. -
bottom
-- Number of pixels to pad at the bottom. -
left
-- Number of pixels to pad to the left. -
padValue
-- Grey value the padded pixels should have.
void translateIntImage(IntImage *image, int x, int y);
Translates the image domain by x, y. Does not affect the underlying pixel values, only the domain of theimage.
-
image
-- The image to translate. -
x
-- Number of pixels to translate in the x direction. -
y
-- Number of pixels to translate in the y direction.
void flipIntImageHorizontal(IntImage *image);
Horizontally flips an image around the origin.
-
image
-- The image to flip.
void flipIntImageVertical(IntImage *image);
Vertically flips an image around the origin.
-
image
-- The image to flip.
IntImage dilateIntImageRect(IntImage image, int kw, int kh);
Perform a grayscale dilation on the input image. The structuring element (kernel) that will be used will be arectangle of width
kw
and heightkh
.
-
image
-- The image that the dilation or erosion will be applied on. -
kw
-- The width of the rectangular structuring element (kernel) -
kh
-- The heigth of the rectangular structuring element (kernel)
IntImage erodeIntImageRect(IntImage image, int kw, int kh);
Perform a grayscale erosion on the input image. The structuring element (kernel) that will be used will be arectangle of width
kw
and heightkh
.
-
image
-- The image that the dilation or erosion will be applied on. -
kw
-- The width of the rectangular structuring element (kernel) -
kh
-- The heigth of the rectangular structuring element (kernel)
Histogram createHistogram(IntImage image);
Creates a histogram from the provided image. Note that this will allocate a lot of memory when the dynamicrange is large, since each bin of the histogram is a single pixel value.
-
image
-- The image to create the histogram of.
void createRgbHistograms(RgbImage image, Histogram *redHist, Histogram *greenHist, Histogram *blueHist);
Creates a histogram for the channels red, green and blue from the provided image. Note that this will allocatea lot of memory when the dynamic range is large, since each bin of the histogram is a single pixel value.
-
image
-- The image to create the histogram of. -
redHist
-- Histogram of the red channel. -
greenHist
-- Histogram of the green channel. -
blueHist
-- Histogram of the blue channel.
Histogram createEmptyHistogram(int minRange, int maxRange);
Creates an empty histogram.
-
minRange
-- Minimum possible pixel value in the histogram. -
maxRange
-- Maximum possible pixel value in the histogram.
void freeHistogram(Histogram histogram);
Frees the memory used by the provided histogram.
-
histogram
-- The histogram for which to free the memory.
int getHistogramFrequency(Histogram histogram, int pixelVal);
Retrieves the frequency of the provided pixel value in the histogram.
-
histogram
-- The histogram. -
pixelVal
-- The pixelvalue for which to retrieve the frequency.
void setHistogramFrequency(Histogram *histogram, int pixelVal, int freq);
Sets the frequency of the provided pixel value to a certain value.
-
histogram
-- The histogram. -
pixelVal
-- The pixel value for which to set the frequency. -
freq
-- The frequency the provided pixel value should have.
void incrementHistogramFrequency(Histogram *histogram, int pixelVal);
Increments the freqyency of the provided pixel value by 1.
-
histogram
-- The histogram. -
pixelVal
-- The pixel value to increment.
void printHistogram(Histogram histogram);
Prints the histogram pixel value-frequency pairs.
-
histogram
-- The histogram to print.
void getHistogramRange(Histogram histogram, int *minRange, int *maxRange);
Retrieves the range of values the provided histogram contains.
-
histogram
-- The histogram to retrieve the dynamic range of. -
minRange
-- The value of the minimum bin in the histogram will be put here. -
maxRange
-- The value of the maximum bin in the histogram will be put here.
RgbImage allocateRgbImage(int width, int height, int minValue, int maxValue);
Allocates an empty image in the domain [0...width) x [0..height) with the specified parameters.
-
width
-- The width of the image in pixels. -
height
-- The height of the image in pixels. -
minValue
-- The minimum possible value a channel in this image should be able to contain. -
maxValue
-- The maximum possible value a channel in this image should be able to contain.
RgbImage allocateDefaultRgbImage(int width, int height);
Allocates an empty image in the domain [0...width) x [0..height) with an infinite dynamic range.
-
width
-- The width of the image in pixels. -
height
-- The height of the image in pixels.
RgbImage allocateFromRgbImage(RgbImage image);
Allocates an empty image with the domain and dynamic range of the provided image. Does not copy pixel values.
-
image
-- The image whose properties to copy.
RgbImage copyRgbImage(RgbImage image);
Creates a copy of the provided image.
-
image
-- The image to copy.
RgbImage allocateRgbImageGrid(int minX, int maxX, int minY, int maxY, int minValue, int maxValue);
Allocates an empty image in the domain [minX...maxX] x [minY..maxY] with the specified parameters.
-
minX
-- The start of the image domain in the x direction. -
maxX
-- The end of the image domain in the x direction. -
minY
-- The start of the image domain in the y direction. -
maxY
-- The end of the image domain in the y direction. -
minValue
-- The minimum possible value this image should be able to contain. -
maxValue
-- The maximum possible value this image should be able to contain.
RgbImage allocateRgbImageGridDomain(ImageDomain domain, int minValue, int maxValue);
Allocates an empty image in the domain [minX...maxX] x [minY..maxY] with the specified parameters.
-
domain
-- The domain the image should have. -
minValue
-- The minimum possible value this image should be able to contain. -
maxValue
-- The maximum possible value this image should be able to contain.
void freeRgbImage(RgbImage image);
Frees the memory used by the provided image.
-
image
-- The image for which to free the memory.
ImageDomain getRgbImageDomain(RgbImage image);
Retrieve the domain information of the provided image.
-
image
-- The image from which to retrieve the domain.
void getRgbDynamicRange(RgbImage image, int *minRange, int *maxRange);
Retrieve the dynamic range of the provided image.
-
image
-- The image from which to retrieve the dynamic range. -
minRange
-- The minimum possible value a channel in this image is able to contain will be put here. -
maxRange
-- The maximum possible value a channel in this image is able to contain will be put here.
void getRgbPixel(RgbImage image, int x, int y, int *r, int *g, int *b);
Retrieves the rgb values of the image at the provided coordinates. Note that x and y can be negative if theimage domain allows for this.
-
image
-- The image from which to retrieve the rgb value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve. -
r
-- The red channel value at (x,y) will be put here. -
g
-- The green channel value at (x,y) will be put here. -
b
-- The blue channel value at (x,y) will be put here.
void getRgbPixelI(RgbImage image, int x, int y, int *r, int *g, int *b);
Retrieves the rgb values of the image at the provided coordinates without taking into consideration the imagedomain. This means that the x and y should fall within the range [0..width) and [0..height) respectively.
-
image
-- The image from which to retrieve the rgb value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve. -
r
-- The red channel value at (x,y) will be put here. -
g
-- The green channel value at (x,y) will be put here. -
b
-- The blue channel value at (x,y) will be put here.
void setRgbPixel(RgbImage *image, int x, int y, int r, int g, int b);
Set the rgb value of the image at the provided coordinates. Note that x and y can be negative if theimage domain allows for this. Additionally, the rgb value should fit in the dynamic range of the image.
-
image
-- The image from which to retrieve the rgb value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve. -
r
-- The red channel value at (x,y). -
g
-- The green channel value at (x,y). -
b
-- The blue channel value at (x,y).
void setRgbPixelI(RgbImage *image, int x, int y, int r, int g, int b);
Set the rgb value of the image at the provided coordinates without taking into consideration the imagedomain. This means that the x and y should fall within the range [0..width) and [0..height) respectively.Additionally, the rgb value should fit in the dynamic range of the image.
-
image
-- The image from which to retrieve the rgb value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve. -
r
-- The red channel value at (x,y). -
g
-- The green channel value at (x,y). -
b
-- The blue channel value at (x,y).
void setAllRgbPixels(RgbImage *image, int r, int g, int b);
Sets all the pixels in the provided image to the provided rgb value. Note that the rgb values should fit inthe dynamic range of the image.
-
image
-- The image in which to set all the rgb values. -
r
-- The red channel value to put in the image. -
g
-- The green channel value to put in the image. -
b
-- The blue channel value to put in the image.
void printRgbBuffer(RgbImage image);
Prints all the pixel values in the provided image to stdout. Every row is put on a new line.Each rgb value is printed as (r,g,b).
-
image
-- The image to print.
void printRgbImageLatexTable(RgbImage image);
Prints a LaTeX compatible table representation of the provided image to stdout.
-
image
-- The image to print the LaTeX table of.
void printRgbLatexTableToFile(FILE *out, RgbImage image);
Prints a LaTeX compatible table representation of the provided image to the provided file stream.
-
out
-- File stream to print the image to. -
image
-- The image to print the LaTeX table of.
void displayRgbImage(RgbImage image, const char *windowTitle);
Opens a window that allows the user to view the image. Note that this uses OpenGL which in turn allocatesmemory that cannot be freed. If you want to check for memory leaks, make sure that you do not run any image displays.Only prints a warning if the NOVIEW flag is enabled.
-
image
-- The image to view. -
windowTitle
-- The title of the window.
RgbImage loadRgbImage(const char *path);
Loads an image from the provided file. Supported extensions: .ppm.
-
path
-- The path of the image to load.
void saveRgbImage(RgbImage image, const char *path);
Saves an image at the provided location. Supported extensions: .ppm. This will save the netpbmfile in its binary format.
-
image
-- The images to save. -
path
-- The location to save the image at.
void saveRgbImagePPMRaw(RgbImage image, const char *path);
Saves an image at the provided location. The location must be a .ppm file. Pixels values are stored as rawbytes in the file.
-
image
-- The images to save. -
path
-- The location to save the image at.
void saveRgbImagePPMAscii(RgbImage image, const char *path);
Saves an image at the provided location. The location must be a .ppm file. Pixels values are stored as ascii(human readable) values in the file.
-
image
-- The images to save. -
path
-- The location to save the image at.
RgbImage maxRgbImage(RgbImage imageA, RgbImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = max(f(x,y),g(x,y)). Performs the operation seperately for each channel.
-
imageA
-- First input image. -
imageB
-- Second input image.
RgbImage minRgbImage(RgbImage imageA, RgbImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = min(f(x,y),g(x,y)). Performs the operation seperately for each channel.
-
imageA
-- First input image. -
imageB
-- Second input image.
RgbImage addRgbImage(RgbImage imageA, RgbImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = f(x,y) + g(x,y).Performs the operation seperately for each channel.
-
imageA
-- First input image. -
imageB
-- Second input image.
RgbImage subtractRgbImage(RgbImage imageA, RgbImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = f(x,y) - g(x,y).Performs the operation seperately for each channel.
-
imageA
-- First input image. -
imageB
-- Second input image.
RgbImage multiplyRgbImage(RgbImage imageA, RgbImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = f(x,y) * g(x,y).Performs the operation seperately for each channel.
-
imageA
-- First input image. -
imageB
-- Second input image.
RgbImage applyLutRgbImage(RgbImage image, int **LUT, int LUTsize);
Produces an output image that is the result of applying a lookup table (LUT) to the input image. The LUTshould have the same size as the dynamic range of the input image. Should have a value for each channel.
-
image
-- Input image. -
LUT
-- The lookup table. Maps a gray value in [minRange..maxRange] of the image to a new gray value. -
LUTSize
-- The size of the lookup table.
RgbImage padRgbImage(RgbImage image, int top, int right, int bottom, int left, int r, int g, int b);
Produces a new, padded image from the provided image. Note that this allocates a new image, which shouldsubsequently be freed.
-
image
-- The image to pad. -
top
-- Number of pixels to pad at the top. -
right
-- Number of pixels to pad to the right. -
bottom
-- Number of pixels to pad at the bottom. -
left
-- Number of pixels to pad to the left. -
r
-- Value the red channel of the padded pixels should have. -
g
-- Value the green channel of the padded pixels should have. -
b
-- Value the blue channel of the padded pixels should have.
void translateRgbImage(RgbImage *image, int x, int y);
Translates the image domain by x, y. Does not affect the underlying pixel values, only the domain of theimage.
-
image
-- The image to translate. -
x
-- Number of pixels to translate in the x direction. -
y
-- Number of pixels to translate in the y direction.
void flipRgbImageHorizontal(RgbImage *image);
Horizontally flips an image around the origin.
-
image
-- The image to flip.
void flipRgbImageVertical(RgbImage *image);
Vertically flips an image around the origin.
-
image
-- The image to flip.
ComplexImage allocateComplexImage(int width, int height);
Allocates an empty complex image in the domain [0...width) x [0..height) with the specified parameters.
-
width
-- The width of the image in pixels. -
height
-- The height of the image in pixels.
ComplexImage allocateFromComplexImage(ComplexImage image);
Allocates an empty image with the domain and dynamic range of the provided image. Does not copy pixel values.
-
image
-- The image whose properties to copy.
ComplexImage copyComplexImage(ComplexImage image);
Creates a copy of the provided image.
-
image
-- The image to copy.
ComplexImage allocateComplexImageGrid(int minX, int maxX, int minY, int maxY);
Allocates an empty complex image in the domain [minX...maxX] x [minY..maxY] with the specified parameters.
-
minX
-- The start of the image domain in the x direction. -
maxX
-- The end of the image domain in the x direction. -
minY
-- The start of the image domain in the y direction. -
maxY
-- The end of the image domain in the y direction.
ComplexImage allocateComplexImageGridDomain(ImageDomain domain);
Allocates an empty complex image in the domain [minX...maxX] x [minY..maxY] with the specified parameters.
-
domain
-- Domain the image should have.
void freeComplexImage(ComplexImage image);
Frees the memory used by the provided image.
-
image
-- The image for which to free the memory.
ImageDomain getComplexImageDomain(ComplexImage image);
Retrieve the domain information of the provided image.
-
image
-- The image from which to retrieve the domain.
void getComplexMinMax(ComplexImage image, double *minimalValue, double *maximalValue);
Puts the minimum real value and maximum real value found in the provided image into the minimalValue andmaximalValue respectively.
-
image
-- The image in which to find the minimum and maximum values. -
minimalValue
-- The resulting minimal value will be put here. -
maximalValue
-- The resulting maximal value will be put here.
double complex getComplexPixel(ComplexImage image, int x, int y);
Retrieves the complex value of the image at the provided coordinates. Note that x and y can be negative if theimage domain allows for this.
-
image
-- The image from which to retrieve the pixel value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve.
double complex getComplexPixelI(ComplexImage image, int x, int y);
Retrieves the complex value of the image at the provided coordinates without taking into consideration theimage domain. This means that the x and y should fall within the range [0..width) and [0..height) respectively.
-
image
-- The image from which to retrieve the pixel value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve.
void setComplexPixel(ComplexImage *image, int x, int y, double complex complexValue);
Set the complex value of the image at the provided coordinates. Note that x and y can be negative if theimage domain allows for this.
-
image
-- The image in which to set the pixel value. -
x
-- The x coordinate of the pixel to set. -
y
-- The y coordinate of the pixel to set. -
complexValue
-- The complex value to put at (x,y).
void setComplexPixelI(ComplexImage *image, int x, int y, double complex complexValue);
Set the complex value of the image at the provided coordinates without taking into consideration the imagedomain. This means that the x and y should fall within the range [0..width) and [0..height) respectively.
-
image
-- The image in which to set the pixel value. -
x
-- The x coordinate of the pixel to set. -
y
-- The y coordinate of the pixel to set. -
complexValue
-- The complex value to put at (x,y).
void setAllComplexPixels(ComplexImage *image, double complex complexValue);
Sets all the pixels in the provided image to the provided complex value.
-
image
-- The image in which to set all the pixel values. -
complexValue
-- The complex value to put in the image.
void printComplexBuffer(ComplexImage image);
Prints all the complex values in the provided image to stdout. Every row is put on a new line.
-
image
-- The image to print.
void printComplexImageLatexTable(ComplexImage image);
Prints a LaTeX compatible table representation of the provided image to stdout.
-
image
-- The image to print the LaTeX table of.
void printComplexLatexTableToFile(FILE *out, ComplexImage image);
Prints a LaTeX compatible table representation of the provided image to the provided file stream.
-
out
-- File stream to print the image to. -
image
-- The image to print the LaTeX table of.
void displayComplexImage(ComplexImage image, const char *windowTitle);
Opens a window that allows the user to view the image. Note that this uses OpenGL which in turn allocatesmemory that cannot be freed. If you want to check for memory leaks, make sure that you do not run any image displays.Only the real values of the complex image are displayed. Only prints a warning if the NOVIEW flag is enabled.
-
image
-- The image to view. -
windowTitle
-- The title of the window.
void saveComplexImage(ComplexImage image, const char *path);
Saves an image at the provided location. Supported extension: .pgm. This will save the netpbmfiles as their binary formats. Note that only (rounded) real values are stored.
-
image
-- The images to save. -
path
-- The location to save the image at.
void saveComplexImagePGMRaw(ComplexImage image, const char *path);
Saves an image at the provided location. The location must be a .pgm file. Pixels values are stored as rawbytes in the file. Note that only (rounded) real values are stored.
-
image
-- The images to save. -
path
-- The location to save the image at.
void saveComplexImagePGMAscii(ComplexImage image, const char *path);
Saves an image at the provided location. The location must be a .pgm file. Pixels values are stored as ascii(human readable) values in the file. Note that only (rounded) real values are stored.
-
image
-- The images to save. -
path
-- The location to save the image at.
ComplexImage fft2D(IntImage image);
Performs the Fast Fourier Transform on the provided input image. Note that the image dimensions must be apower of 2.
-
image
-- The input image.
ComplexImage fft2DDouble(DoubleImage image);
Performs the Fast Fourier Transform on the provided input image. Note that the image dimensions must be apower of 2.
-
image
-- The input image.
IntImage ifft2D(ComplexImage image);
Performs the inverse Fast Fourier Transform on the provided complex image.Note that the resulting image has an infinite domain and you may have to do manual conversion.
-
image
-- The input complex image.
DoubleImage ifft2DDouble(ComplexImage image);
Performs the inverse Fast Fourier Transform on the provided complex image.Note that the resulting image has an infinite domain and you may have to do manual conversion.
-
image
-- The input complex image.
ComplexImage multiplyComplexImage(ComplexImage imageA, ComplexImage imageB);
Creates a new image h from two input images f and g where each pixel is defined as h(x,y) = f(x,y) * g(x,y).
-
imageA
-- First input image. -
imageB
-- Second input image.
void fft2Dshift(ComplexImage *image);
Swaps quadrants 1 & 3 and 2 & 4 to center the DC component in the image.
-
image
-- The input complex image.
void ifft2Dshift(ComplexImage *image);
Reverses the centering of the DC component.
-
image
-- The input complex image.
DoubleImage allocateDoubleImage(int width, int height, double minValue, double maxValue);
Allocates an empty double image in the domain [0...width) x [0..height) with the specified parameters.
-
width
-- The width of the image in pixels. -
height
-- The height of the image in pixels.
DoubleImage copyDoubleImage(DoubleImage image);
Creates a copy of the provided image.
-
image
-- The image to copy.
DoubleImage allocateDoubleImageGrid(int minX, int maxX, int minY, int maxY, double minValue, double maxValue);
Allocates an empty double image in the domain [minX...maxX] x [minY..maxY] with the specified parameters.
-
minX
-- The start of the image domain in the x direction. -
maxX
-- The end of the image domain in the x direction. -
minY
-- The start of the image domain in the y direction. -
maxY
-- The end of the image domain in the y direction.
DoubleImage allocateDoubleImageGridDomain(ImageDomain domain, double minValue, double maxValue);
Allocates an empty double image in the domain [minX...maxX] x [minY..maxY] with the specified parameters.
-
domain
-- Domain the image should have.
DoubleImage allocateDefaultDoubleImage(int width, int height);
Allocates an empty image in the domain [0...width) x [0..height) with an infinite dynamic range.
-
width
-- The width of the image in pixels. -
height
-- The height of the image in pixels.
DoubleImage allocateFromDoubleImage(DoubleImage image);
Allocates an empty image with the domain and dynamic range of the provided image. Does not copy pixel values.
-
image
-- The image whose properties to copy.
void freeDoubleImage(DoubleImage image);
Frees the memory used by the provided image.
-
image
-- The image for which to free the memory.
void getDoubleDynamicRange(DoubleImage image, double *minRange, double *maxRange);
Retrieve the dynamic range of the provided image.
-
image
-- The image from which to retrieve the dynamic range. -
minRange
-- The minimum possible value this image is able to contain will be put here. -
maxRange
-- The maximum possible value this image is able to contain will be put here.
ImageDomain getDoubleImageDomain(DoubleImage image);
Retrieve the domain information of the provided image.
-
image
-- The image from which to retrieve the domain.
void getDoubleMinMax(DoubleImage image, double *minimalValue, double *maximalValue);
Puts the minimum real value and maximum real value found in the provided image into the minimalValue andmaximalValue respectively.
-
image
-- The image in which to find the minimum and maximum values. -
minimalValue
-- The resulting minimal value will be put here. -
maximalValue
-- The resulting maximal value will be put here.
double getDoublePixel(DoubleImage image, int x, int y);
Retrieves the double value of the image at the provided coordinates. Note that x and y can be negative if theimage domain allows for this.
-
image
-- The image from which to retrieve the pixel value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve.
double getDoublePixelI(DoubleImage image, int x, int y);
Retrieves the double value of the image at the provided coordinates without taking into consideration theimage domain. This means that the x and y should fall within the range [0..width) and [0..height) respectively.
-
image
-- The image from which to retrieve the pixel value. -
x
-- The x coordinate of the pixel to retrieve. -
y
-- The y coordinate of the pixel to retrieve.
void setDoublePixel(DoubleImage *image, int x, int y, double val);
Set the double value of the image at the provided coordinates. Note that x and y can be negative if theimage domain allows for this.
-
image
-- The image in which to set the pixel value. -
x
-- The x coordinate of the pixel to set. -
y
-- The y coordinate of the pixel to set. -
val
-- The double value to put at (x,y).
void setDoublePixelI(DoubleImage *image, int x, int y, double val);
Set the double value of the image at the provided coordinates without taking into consideration the imagedomain. This means that the x and y should fall within the range [0..width) and [0..height) respectively.
-
image
-- The image in which to set the pixel value. -
x
-- The x coordinate of the pixel to set. -
y
-- The y coordinate of the pixel to set. -
val
-- The double value to put at (x,y).
void setAllDoublePixels(DoubleImage *image, double val);
Sets all the pixels in the provided image to the provided double value.
-
image
-- The image in which to set all the pixel values. -
val
-- The double value to put in the image.
void printDoubleBuffer(DoubleImage image);
Prints all the double values in the provided image to stdout. Every row is put on a new line.
-
image
-- The image to print.
void printDoubleImageLatexTable(DoubleImage image);
Prints a LaTeX compatible table representation of the provided image to stdout.
-
image
-- The image to print the LaTeX table of.
void printDoubleLatexTableToFile(FILE *out, DoubleImage image);
Prints a LaTeX compatible table representation of the provided image to the provided file stream.
-
out
-- File stream to print the image to. -
image
-- The image to print the LaTeX table of.
DoubleImage int2DoubleImg(IntImage image);
Produces a new DoubleImage from the provided IntImage.
-
image
-- The IntImage to convert.
IntImage double2IntImg(DoubleImage image);
Produces a new IntImage from the provided DoubleImage.
-
image
-- The DoubleImage to convert.