Efros-Leung
Exemplar-basedtexturesynthesis(Efros-Leung)
|
#include "io_png.h"
#include "mt.h"
Go to the source code of this file.
Classes | |
struct | cimage |
struct | gimage |
struct | pixel |
struct | cand_dist |
Typedefs | |
typedef struct cimage * | Cimage |
typedef struct gimage * | Gimage |
typedef struct pixel * | Pixel |
typedef struct cand_dist * | Cand_dist |
Functions | |
void | error (char *msg) |
Fatal error function. | |
void | write_png_image (Cimage v, char *filename) |
Save a color image as a PNG file. | |
void | write_png_image_gray (Gimage image, char *filename) |
Save a gray level image as a PNG file. | |
void | delete_Cimage (Cimage v) |
Delete a color image. | |
void | delete_Gimage (Gimage v) |
Delete a gray level image. | |
void | print_algo_info (char *in_file_name, int nrows, int ncols, int nchannels, int t, float tolerance, int out_sz) |
Print information about the parameters. | |
Cimage | new_Cimage (int nrow, int ncol) |
Create an empty color image. | |
Gimage | new_Gimage (int nrow, int ncol) |
Create an empty gray level image. | |
Cimage | create_image_map (int nrow, int ncol) |
Create a color map. | |
Cimage | crop_image (Cimage v, int out_img_sz) |
Crop a color image. | |
Gimage | crop_image_gray (Gimage v, int out_img_sz) |
Crop a gray level image. | |
Cimage | add_border (Cimage v, int t) |
Add a border of zeros of width t to the input image. | |
Gimage | add_border_gray (Gimage v, int t) |
Add a border of zeros of width t to the input image. | |
Cimage | create_mask (int nrow, int ncol, int t) |
Create an image of size (nrow+t) times (ncol+t). | |
Gimage | create_mask_gray (int nrow, int ncol, int t) |
Create an image of size (nrow+t) times (ncol+t). | |
int | is_grayscale (Cimage image, long num_pixels) |
Check if an image is a real color image or a 3-channel gray image. | |
Cimage | load_png_image (char *filename) |
Load a color image from a PNG file. |
Cimage add_border | ( | Cimage | v, |
int | t | ||
) |
Add a border of zeros of width t to the input image.
v | input image add the border. |
t | width of the border to be added. |
Gimage add_border_gray | ( | Gimage | v, |
int | t | ||
) |
Add a border of zeros of width t to the input image.
Idem add_border for gray level images.
Cimage create_image_map | ( | int | nrow, |
int | ncol | ||
) |
Create a color map.
nrow | number of rows (dy) |
ncol | number of columns (dx) |
Cimage create_mask | ( | int | nrow, |
int | ncol, | ||
int | t | ||
) |
Create an image of size (nrow+t) times (ncol+t).
The image is filled with ones in the central region of size nrow x ncol and has a border of zeros of width t.
nrow | number of rows of the region filled with ones. |
ncol | number of columns of the region filled with ones. |
t | width of the border filled with zeros. |
Gimage create_mask_gray | ( | int | nrow, |
int | ncol, | ||
int | t | ||
) |
Create an image of size (nrow+t) times (ncol+t).
Idem create_mask for gray level images.
Cimage crop_image | ( | Cimage | v, |
int | out_img_sz | ||
) |
Crop a color image.
v | color image to be cropped |
out_img_sz | size of the new image |
Gimage crop_image_gray | ( | Gimage | v, |
int | out_img_sz | ||
) |
Crop a gray level image.
v | gray level image to be cropped |
out_img_sz | size of the new image |
void delete_Cimage | ( | Cimage | v | ) |
Delete a color image.
Free the memory used by the image.
v | image to be deleted |
void delete_Gimage | ( | Gimage | v | ) |
Delete a gray level image.
Free the memory used by the image.
v | image to be deleted |
void error | ( | char * | msg | ) |
Fatal error function.
Print a message to standard-error output and exit.
msg | String to be printed to standard-error output. |
int is_grayscale | ( | Cimage | image, |
long | num_pixels | ||
) |
Check if an image is a real color image or a 3-channel gray image.
image | input image to be tested. |
num_pixels | total number of pixels in the image (nrows * ncols) |
Cimage load_png_image | ( | char * | filename | ) |
Load a color image from a PNG file.
filename | name (path) of the image |
Cimage new_Cimage | ( | int | nrow, |
int | ncol | ||
) |
Create an empty color image.
Initialize the size of the image and allocate the memory.
nrow | number of rows (dy) |
ncol | number of columns (dx) |
Gimage new_Gimage | ( | int | nrow, |
int | ncol | ||
) |
Create an empty gray level image.
Initialize the size of the image and allocate the memory.
nrow | number of rows (dy) |
ncol | number of columns (dx) |
void print_algo_info | ( | char * | in_file_name, |
int | nrows, | ||
int | ncols, | ||
int | nchannels, | ||
int | t, | ||
float | tolerance, | ||
int | out_sz | ||
) |
Print information about the parameters.
t | Half-size of the patches. |
out_sz | Size of the synthesized image. |
tolerance | Tolerance parameter ![]() |
dims_pca | Number of PCA components used to compute distances between (the known parts of) patches. |
weights | If 'G', use Gaussian-weighted ![]() ![]() |
in_file_name | Example image name. |
nrows | Number of rows (dy) in example image. |
ncols | Number of columns (dx) in example image. |
nchannels | Number of channels in example image. |
void write_png_image | ( | Cimage | image, |
char * | filename | ||
) |
Save a color image as a PNG file.
image | color image to be saves |
filename | name (path) of the file |
void write_png_image_gray | ( | Gimage | image, |
char * | filename | ||
) |
Save a gray level image as a PNG file.
image | gray level image to be saves |
filename | name (path) of the file |