Skip to content

Documentation

maxverbeek edited this page Jan 16, 2023 · 10 revisions

allocateIntImage

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.

allocateDefaultIntImage

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.

allocateFromIntImage

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.

copyIntImage

IntImage copyIntImage(IntImage image);

Creates a copy of the provided image.

  • image -- The image to copy.

allocateIntImageGrid

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.

allocateIntImageGridDomain

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.

freeIntImage

void freeIntImage(IntImage image);

Frees the memory used by the provided image.

  • image -- The image for which to free the memory.

getIntImageDomain

ImageDomain getIntImageDomain(IntImage image);

Retrieve the domain information of the provided image.

  • image -- The image from which to retrieve the domain.

isInDomain

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.

isInDomainI

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.

getImageDomainValues

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.

getMinMax

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.

getDynamicRange

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.

getIntPixel

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.

getIntPixelI

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.

setIntPixel

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).

setIntPixelI

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).

setAllIntPixels

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.

setDynamicRange

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.

printIntBuffer

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.

printIntImageLatexTable

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.

printIntLatexTableToFile

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.

displayIntImage

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.

loadIntImage

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.

saveIntImage

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.

saveIntImagePGMRaw

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.

saveIntImagePGMAscii

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.

saveIntImagePBMRaw

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.

saveIntImagePBMAscii

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.

maxIntImage

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

minIntImage

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.

addIntImage

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.

subtractIntImage

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.

multiplyIntImage

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.

applyLutIntImage

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.

distanceTransform

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.

padIntImage

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.

translateIntImage

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.

flipIntImageHorizontal

void flipIntImageHorizontal(IntImage *image);

Horizontally flips an image around the origin.

  • image -- The image to flip.

flipIntImageVertical

void flipIntImageVertical(IntImage *image);

Vertically flips an image around the origin.

  • image -- The image to flip.

dilateIntImageRect

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 height kh.

  • 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)

erodeIntImageRect

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 height kh.

  • 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)

createHistogram

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.

createRgbHistograms

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.

createEmptyHistogram

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.

freeHistogram

void freeHistogram(Histogram histogram);

Frees the memory used by the provided histogram.

  • histogram -- The histogram for which to free the memory.

getHistogramFrequency

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.

setHistogramFrequency

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.

incrementHistogramFrequency

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.

printHistogram

void printHistogram(Histogram histogram);

Prints the histogram pixel value-frequency pairs.

  • histogram -- The histogram to print.

getHistogramRange

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.

allocateRgbImage

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.

allocateDefaultRgbImage

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.

allocateFromRgbImage

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.

copyRgbImage

RgbImage copyRgbImage(RgbImage image);

Creates a copy of the provided image.

  • image -- The image to copy.

allocateRgbImageGrid

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.

allocateRgbImageGridDomain

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.

freeRgbImage

void freeRgbImage(RgbImage image);

Frees the memory used by the provided image.

  • image -- The image for which to free the memory.

getRgbImageDomain

ImageDomain getRgbImageDomain(RgbImage image);

Retrieve the domain information of the provided image.

  • image -- The image from which to retrieve the domain.

getRgbDynamicRange

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.

getRgbPixel

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.

getRgbPixelI

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.

setRgbPixel

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).

setRgbPixelI

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).

setAllRgbPixels

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.

printRgbBuffer

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.

printRgbImageLatexTable

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.

printRgbLatexTableToFile

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.

displayRgbImage

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.

loadRgbImage

RgbImage loadRgbImage(const char *path);

Loads an image from the provided file. Supported extensions: .ppm.

  • path -- The path of the image to load.

saveRgbImage

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.

saveRgbImagePPMRaw

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.

saveRgbImagePPMAscii

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.

maxRgbImage

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.

minRgbImage

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.

addRgbImage

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.

subtractRgbImage

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.

multiplyRgbImage

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.

applyLutRgbImage

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.

padRgbImage

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.

translateRgbImage

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.

flipRgbImageHorizontal

void flipRgbImageHorizontal(RgbImage *image);

Horizontally flips an image around the origin.

  • image -- The image to flip.

flipRgbImageVertical

void flipRgbImageVertical(RgbImage *image);

Vertically flips an image around the origin.

  • image -- The image to flip.

allocateComplexImage

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.

allocateFromComplexImage

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.

copyComplexImage

ComplexImage copyComplexImage(ComplexImage image);

Creates a copy of the provided image.

  • image -- The image to copy.

allocateComplexImageGrid

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.

allocateComplexImageGridDomain

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.

freeComplexImage

void freeComplexImage(ComplexImage image);

Frees the memory used by the provided image.

  • image -- The image for which to free the memory.

getComplexImageDomain

ImageDomain getComplexImageDomain(ComplexImage image);

Retrieve the domain information of the provided image.

  • image -- The image from which to retrieve the domain.

getComplexMinMax

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.

complex

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.

complex

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.

setComplexPixel

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).

setComplexPixelI

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).

setAllComplexPixels

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.

printComplexBuffer

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.

printComplexImageLatexTable

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.

printComplexLatexTableToFile

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.

displayComplexImage

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.

saveComplexImage

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.

saveComplexImagePGMRaw

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.

saveComplexImagePGMAscii

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.

fft2D

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.

fft2DDouble

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.

ifft2D

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.

ifft2DDouble

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.

multiplyComplexImage

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.

fft2Dshift

void fft2Dshift(ComplexImage *image);

Swaps quadrants 1 & 3 and 2 & 4 to center the DC component in the image.

  • image -- The input complex image.

ifft2Dshift

void ifft2Dshift(ComplexImage *image);

Reverses the centering of the DC component.

  • image -- The input complex image.

allocateDoubleImage

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.

copyDoubleImage

DoubleImage copyDoubleImage(DoubleImage image);

Creates a copy of the provided image.

  • image -- The image to copy.

allocateDoubleImageGrid

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.

allocateDoubleImageGridDomain

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.

allocateDefaultDoubleImage

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.

allocateFromDoubleImage

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.

freeDoubleImage

void freeDoubleImage(DoubleImage image);

Frees the memory used by the provided image.

  • image -- The image for which to free the memory.

getDoubleDynamicRange

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.

getDoubleImageDomain

ImageDomain getDoubleImageDomain(DoubleImage image);

Retrieve the domain information of the provided image.

  • image -- The image from which to retrieve the domain.

getDoubleMinMax

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.

getDoublePixel

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.

getDoublePixelI

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.

setDoublePixel

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).

setDoublePixelI

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).

setAllDoublePixels

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.

printDoubleBuffer

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.

printDoubleImageLatexTable

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.

printDoubleLatexTableToFile

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.

int2DoubleImg

DoubleImage int2DoubleImg(IntImage image);

Produces a new DoubleImage from the provided IntImage.

  • image -- The IntImage to convert.

double2IntImg

IntImage double2IntImg(DoubleImage image);

Produces a new IntImage from the provided DoubleImage.

  • image -- The DoubleImage to convert.
Clone this wiki locally