Top |
Image File FormatsImage File Formats — Loading and saving image data to standard formats (JPEG, PNG, PNM) |
These functions are used to load data from disk and store data to disk using standard file formats.
gboolean grx_context_save_to_pbm (GrxContext *context
,const gchar *filename
,const gchar *comment
,GError **error
);
Dump a context in a PBM file (black and white)
This routine works both in RGB and palette modes If the pixel color isn't Black it asumes White
gboolean grx_context_save_to_pgm (GrxContext *context
,const gchar *filename
,const gchar *comment
,GError **error
);
Dump a context in a PGM file (gray scale)
This routine works both in RGB and palette modes The colors are quantized to gray scale using .299r + .587g + .114b
gboolean grx_context_save_to_ppm (GrxContext *context
,const gchar *filename
,const gchar *comment
,GError **error
);
Dump a context in a PPM file (real color)
This routine works both in RGB and palette modes
gboolean grx_context_load_from_pnm (GrxContext *context
,const gchar *filename
,GError **error
);
Load a context from a PNM file.
Support only PBM, PGM and PPM binary files with maxval < 256
If context dimensions are less than pnm dimensions, the routine loads as much as it can
If color mode is not in RGB mode, the routine allocates as many colors as it can
gboolean grx_query_pnm_file (const gchar *filename
,GrxPnmFormat *format
,gint *width
,gint *height
,gint *maxval
);
Query format, width and height data from a PNM file
filename |
Name of pnm file. |
[type filename] |
format |
the GrxPnmFormat of the file. |
[out] |
width |
return pnm width. |
[out] |
height |
return pnm height. |
[out] |
maxval |
max color component value. |
[out] |
gboolean grx_context_load_from_pnm_data (GrxContext *context
,const guint8 *buffer
);
Load a context from a PNM buffer
Support only PBM, PGM and PPM binary buffers with maxval < 256
If context dimensions are lesser than pnm dimensions, the routine loads as much as it can
If color mode is not in RGB mode, the routine allocates as much colors as it can
context |
Context to be loaded or |
[nullable] |
buffer |
Buffer that holds data |
gboolean grx_query_pnm_data (GByteArray *data
,GrxPnmFormat *format
,gint *width
,gint *height
,gint *maxval
);
Query format, width and height data from a PNM buffer
data |
The image data |
|
format |
the GrxPnmFormat of the file. |
[out] |
width |
return pnm width. |
[out] |
height |
return pnm height. |
[out] |
maxval |
max color component value. |
[out] |
gboolean grx_context_save_to_png (GrxContext *context
,const gchar *filename
,GError **error
);
Dump a context in a PNG file
This routine works both in RGB and palette modes
gboolean grx_context_load_from_png (GrxContext *context
,const gchar *filename
,gboolean use_alpha
,GError **error
);
Load a context from a PNG file
If context dimensions are less than png dimensions, the routine loads as much as it can
If color mode is not in RGB mode, the routine allocates as many colors as it can
gboolean grx_query_png_file (const gchar *filename
,gint *width
,gint *height
);
Query width and height data from a PNG file
gboolean grx_context_load_from_jpeg (GrxContext *context
,const gchar *filename
,gint scale
,GError **error
);
Load a context from a JPEG file.
If context dimensions are less than jpeg dimensions, the function loads as much of the image as it can.
If color mode is not in RGB mode, the functions allocates as many colors as it can.
gboolean grx_context_load_from_jpeg_data (GrxContext *context
,GByteArray *data
,gint scale
,GError **error
);
Load a context from JPEG data.
If context dimensions are less than jpeg dimensions, the function loads as much of the image as it can.
If color mode is not in RGB mode, the functions allocates as many colors as it can.
gboolean grx_query_jpeg_file (const gchar *filename
,gint *width
,gint *height
);
Query width and height data from a JPEG file
gboolean grx_query_jpeg_data (GByteArray *data
,gint *width
,gint *height
);
Query width and height data from a JPEG file
gboolean grx_context_save_to_jpeg (GrxContext *context
,const gchar *filename
,gint quality
,GError **error
);
Dump a context in a JPEG file
This routine works both in RGB and palette modes
gboolean grx_context_save_to_jpeg_grayscale (GrxContext *context
,const gchar *filename
,gint quality
,GError **error
);
Dump a context in a Gray JPEG file
This routine works both in RGB and palette modes
PNM file formats.
Note: GRX supports load/save of binaries formats (4,5,6) only.