The stick2xyz Documentation 1.14.1
output2dpng.c File Reference
#include "output2dpngpriv.h"
#include "output2dpng.h"
#include "output2djpeg.h"
#include "output2dbmp.h"
Include dependency graph for output2dpng.c:

Go to the source code of this file.

Functions

stick2xyz_pctchar mod_output2d_name (void)
 
stick2xyz_pctchar mod_output2d_desc (void)
 
void mod_output2d_version (int *dest)
 
int mod_output2d_type (void)
 
int mod_output2d_multithread_safe (void)
 
void mod_output2d_set_tty (void *fildescout, void *fildescerr)
 
int mod_output2d_quality_range (struct output2d_qualityinfo *dest)
 
uint32_t mod_output2d_quality_valid (const int value)
 
size_t mod_output2d_bpp_list (int *array)
 
int mod_output2d_bpp_supported (const int value)
 
int mod_output2d_bpp_default (void)
 
output2d_handle mod_pane_to_output2d (pane2d_handle pane, pane2d_dupdata dupdata, pane2d_dupxy dupxy, int use_rgb)
 
output2d_handle mod_paneimage_to_output2d (pane2d_handle pane, pane2d_dupimage dupimage, pane2d_freeimage freedata, pane2d_dupxy dupxy, int use_rgb)
 
output2d_handle mod_pane16bytype_to_output2d (pane2d_handle pane, pane2d_dupfunc_getlist duplist, int use_rgb, unsigned int filnum)
 
output2d_handle mod_panebytype_to_output2d (pane2d_handle pane, pane2d_dupfunc_getlist duplist, int use_rgb, unsigned int filnum)
 
void mod_output2d_free_handle (output2d_handle handle)
 
int mod_output2d_getnewdata (output2d_handle handle, unsigned int filnum)
 
int mod_output2d_write (output2d_handle handle, const char *filnam, unsigned int filnum, int compression)
 
int mod_output2d_write_w (output2d_handle handle, const wchar_t *filnam, unsigned int filnum, int compression)
 
void mod_output2d_lang (stick2xyz_print_ptr newval)
 
void mod_output2d_read (const char *filetoread)
 
int mod_output2d_init (int multithread)
 
int mod_output2d_release (void)
 
int mod_output2d_sigterm (output2d_sigterm_ready func, int modnumber)
 

Function Documentation

◆ mod_output2d_bpp_default()

int mod_output2d_bpp_default ( void  )

This function returns the default bits per pixel (bpp) value of the module.

Return values
intThe default bpp value.

Definition at line 709 of file output2dpng.c.

References output2dbmp_bpp_default(), output2djpeg_bpp_default(), and output2dpng_bpp_default().

Here is the call graph for this function:

◆ mod_output2d_bpp_list()

size_t mod_output2d_bpp_list ( int *  array)

This function sets up an integer array with bits per pixel (bpp) numbers that are supported by the module.

Parameters
[out]arrayAn array of integers for the function to set up. If parameter is NULL, the array will not be set up.
Return values
size_tThe number of elements that the array must be allocated for.

Definition at line 675 of file output2dpng.c.

References output2dbmp_bpp_list(), output2djpeg_bpp_list(), and output2dpng_bpp_list().

Here is the call graph for this function:

◆ mod_output2d_bpp_supported()

int mod_output2d_bpp_supported ( const int  value)

This function will check to see if a bits per pixel (bpp) value is supported by the module.

Parameters
[in]valueThe bpp value to be checked.
Return values
1If value is supported.
0If value is not supported.

Definition at line 694 of file output2dpng.c.

References output2dbmp_bpp_supported(), output2djpeg_bpp_supported(), and output2dpng_bpp_supported().

Here is the call graph for this function:

◆ mod_output2d_desc()

stick2xyz_pctchar mod_output2d_desc ( void  )

Returns the the internally stored module short description.

Return values
stick2xyz_pctcharThe constant module short description.

Definition at line 525 of file output2dpng.c.

References output2dbmp_desc(), output2djpeg_desc(), and output2dpng_desc().

Here is the call graph for this function:

◆ mod_output2d_free_handle()

void mod_output2d_free_handle ( output2d_handle  handle)

Deallocates an Output 2-D handle.

Parameters
[in]handleThe handle to deallocate.

Definition at line 845 of file output2dpng.c.

References output2dbmp_free(), output2djpeg_free(), and output2dpng_free().

Here is the call graph for this function:

◆ mod_output2d_getnewdata()

int mod_output2d_getnewdata ( output2d_handle  handle,
unsigned int  filnum 
)

This is an optional function to ask the connected Pane 2-D module for another copy of the image data. This function is useful when multithreading.

Parameters
[in]handleThe handle to operate on.
[in]filnumIf greater than zero, the number becomes the next file number. Otherwise, the file number in the handle is incremented.
Return values
1On success.
0On failure.

Definition at line 869 of file output2dpng.c.

References output2dbmp_getnewdata(), output2djpeg_getnewdata(), and output2dpng_getnewdata().

Here is the call graph for this function:

◆ mod_output2d_init()

int mod_output2d_init ( int  multithread)

This optional function is called when the module is initialized. This function allows you to return a count of references to the module.

Parameters
[in]multithread1 if program is running with multiple threads, 0 if program is running single threaded.
Return values
0on error.
1any positive integer means success.

Definition at line 981 of file output2dpng.c.

References output2dpng_init().

Here is the call graph for this function:

◆ mod_output2d_lang()

void mod_output2d_lang ( stick2xyz_print_ptr  newval)

Changes the pointer type of the language pack calling function.

Parameters
[in]newvalThe new function pointer to store.

Definition at line 944 of file output2dpng.c.

References output2dbmp_lang(), output2djpeg_lang(), and output2dpng_lang().

Here is the call graph for this function:

◆ mod_output2d_multithread_safe()

int mod_output2d_multithread_safe ( void  )

Tells you whether or not the module's write functions are multi-thread safe.

Return values
1If write functions are multi-thread safe.
0If write functions are not multi-thread safe.

Definition at line 585 of file output2dpng.c.

References output2dbmp_multithread_safe(), output2djpeg_multithread_safe(), and output2dpng_multithread_safe().

Here is the call graph for this function:

◆ mod_output2d_name()

stick2xyz_pctchar mod_output2d_name ( void  )

Returns the internally stored UNIX module name.

Return values
stick2xyz_pctcharThe constant UNIX module name.

Definition at line 511 of file output2dpng.c.

References output2dbmp_name(), output2djpeg_name(), and output2dpng_name().

Here is the call graph for this function:

◆ mod_output2d_quality_range()

int mod_output2d_quality_range ( struct output2d_qualityinfo dest)

Fills a structure with image quality information. The information is to be used in the compression value of mod_output2d_write (and mod_output2d_write_w on Windows).

Parameters
destThe structure to fill with data.
Return values
1On success.
0On failure.
Note
You need to set the version member of the structure before calling this function if you are the caller. If you are coding the module, be sure to check the value of version so you do not overrun a buffer.

Definition at line 629 of file output2dpng.c.

References output2dbmp_qualityrange(), output2djpeg_qualityrange(), and output2dpng_quality_range().

Here is the call graph for this function:

◆ mod_output2d_quality_valid()

uint32_t mod_output2d_quality_valid ( const int  value)

An OPTIONAL function that allows the module to check if the given integer is a valid quality value.

Parameters
[in]valueThe value to check.
Return values
STICK2XYZ_OUTPUT2D_QUALITY_VALIDIf value is valid.
STICK2XYZ_OUTPUT2D_QUALITY_INVALIDIf value is invalid.
STICK2XYZ_OUTPUT2D_QUALITY_TOOLOWIf value is invalid and too low.
STICK2XYZ_OUTPUT2D_QUALITY_TOOHIGHIf value is invalid and too high.

Definition at line 654 of file output2dpng.c.

References output2dbmp_qualityvalid(), output2djpeg_qualityvalid(), and output2dpng_quality_valid().

Here is the call graph for this function:

◆ mod_output2d_read()

void mod_output2d_read ( const char *  filetoread)

Reads a file and prints the file information to stdout.

Parameters
[in]filetoreadThe file to read.
Note
This function is completely optional.

Definition at line 962 of file output2dpng.c.

References output2dpng_read().

Here is the call graph for this function:

◆ mod_output2d_release()

int mod_output2d_release ( void  )

This optional function is called when the module is being unloaded. This function allows you to run any cleanup code independent of the operating system's way of notifying the module.

Return values
0when module is ready to be unloaded.
1any positive integer means module is not ready to be unloaded.

Definition at line 996 of file output2dpng.c.

References output2dpng_release().

Here is the call graph for this function:

◆ mod_output2d_set_tty()

void mod_output2d_set_tty ( void *  fildescout,
void *  fildescerr 
)

This function sets the file descriptors for writing to the terminal.

By default, the library uses stdout and stderr.

This function was introduced in version 1.5.0.

Parameters
[in]fildescoutThe file descriptor for stdout.
[in]fildescerrThe file descriptor for stderr.

Definition at line 605 of file output2dpng.c.

References output2dbmp_set_tty(), output2djpeg_set_tty(), and output2dpng_set_tty().

Here is the call graph for this function:

◆ mod_output2d_sigterm()

int mod_output2d_sigterm ( output2d_sigterm_ready  func,
int  modnumber 
)

This optional function is called when the program receives signal SIGTERM.

Note
One use of this function is to let all output to a file, pipe, or socket finish before letting the program terminate itself.
Warning
This function will be called inside a signal handler. Also, do not attempt to directly catch SIGTERM in a module. This function is the way for a module to catch SIGTERM. The code needs to be written as light as possible. Remember that the signal handler will freeze the entire program and the modules until the handler returns. This function is not implemented on Windows because TerminateProcess() is equivalent to SIGKILL. There is no equivalent SIGTERM on Windows, even though the C runtime defines SIGTERM.
Parameters
[in]funcThe function for the module to call when ready for program exit, if 0 is returned by the module.
[in]modnumberThe module number in the dynamic or static array. This number is the parameter when calling func.
Return values
1module is ready to be unloaded.
0module is not ready to be unloaded.

Definition at line 1030 of file output2dpng.c.

References output2dbmp_sigterm(), output2djpeg_sigterm(), and output2dpng_sigterm().

Here is the call graph for this function:

◆ mod_output2d_type()

int mod_output2d_type ( void  )

Returns the integer describing the module type.

The possible values are:

ASCII Modules:

STICK2XYZ_MODTYPE_OUTPUT2D

STICK2XYZ_MODTYPE_OUTPUT2D_DEBUG

UNICODE Modules:

STICK2XYZ_MODTYPE_OUTPUT2D_UNICODE

STICK2XYZ_MODTYPE_OUTPUT2D_UNICODE_DEBUG

Return values
intThe module type as described above.

Definition at line 568 of file output2dpng.c.

References output2dbmp_type(), output2djpeg_type(), and output2dpng_type().

Here is the call graph for this function:

◆ mod_output2d_version()

void mod_output2d_version ( int *  dest)

Sets up the major, minor, and revision numbers into three integers.

Parameters
[out]destAn array of three integers to receive the module data.

Definition at line 540 of file output2dpng.c.

References output2dbmp_version(), output2djpeg_version(), and output2dpng_version().

Here is the call graph for this function:

◆ mod_output2d_write()

int mod_output2d_write ( output2d_handle  handle,
const char *  filnam,
unsigned int  filnum,
int  compression 
)

Writes information in a Output 2-D handle to a file.

Parameters
[in]handleThe handle to work on.
[in]filnamThe file name prefix to open.
[in]filnumThe file number to write after the prefix.
[in]compressionThe compression ratio, if applicable, to use.
Return values
int1 on success, 0 on failure.

Definition at line 894 of file output2dpng.c.

References output2dbmp_write(), output2djpeg_write(), and output2dpng_write().

Here is the call graph for this function:

◆ mod_output2d_write_w()

int mod_output2d_write_w ( output2d_handle  handle,
const wchar_t *  filnam,
unsigned int  filnum,
int  compression 
)

Writes information in a Output 2-D handle to a file.

Parameters
[in]handleThe handle to work on.
[in]filnamThe file name prefix to open.
[in]filnumThe file number to write after the prefix.
[in]compressionThe compression ratio, if applicable, to use.
Return values
int1 on success, 0 on failure.

Definition at line 922 of file output2dpng.c.

References output2dbmp_write_w(), output2djpeg_write_w(), and output2dpng_write_w().

Here is the call graph for this function:

◆ mod_pane16bytype_to_output2d()

output2d_handle mod_pane16bytype_to_output2d ( pane2d_handle  pane,
pane2d_dupfunc_getlist  duplist,
int  use_rgb,
unsigned int  filnum 
)

Converts a Pane 2-D 16-bit handle into an Output 2-D handle.

Parameters
[in]paneThe Pane 2-D handle to convert.
[in]duplistThe Pane 2-D's function for duplicating the image data.
[in]use_rgb1 if output is to be done in color, 0 otherwise.
[in]filnumThe initial file number to use. If 0, it will be set to 1.
Return values
output2d_handleThe new Output 2-D handle.
Note
Not all Output 2-D modules support 16-bit samples. Modules that do not support 16-bit samples do not have to implement this function.

Definition at line 801 of file output2dpng.c.

References output2dpng_bypng16type().

Here is the call graph for this function:

◆ mod_pane_to_output2d()

output2d_handle mod_pane_to_output2d ( pane2d_handle  pane,
pane2d_dupdata  dupdata,
pane2d_dupxy  dupxy,
int  use_rgb 
)

Converts a Pane 2-D handle into an Output 2-D handle.

Parameters
[in]paneThe Pane 2-D handle to convert.
[in]dupdataThe Pane 2-D's function for duplicating the image data.
[in]dupxyThe Pane 2-D's function for duplicating the maximum X and Y coordinates.
[in]use_rgb1 if output is to be done in color, 0 otherwise.
Return values
output2d_handleThe new Output 2-D handle.
Deprecated:
This function uses a decrecated Pane 2-D function. Use mod_paneimage_to_output2d instead.
Warning
Do not pass in handles that were allocated with multithreading support. Doing so will cause a deadlock. Use the bytype functions instead in this situation.

Definition at line 741 of file output2dpng.c.

References output2dpng_to_png().

Here is the call graph for this function:

◆ mod_panebytype_to_output2d()

output2d_handle mod_panebytype_to_output2d ( pane2d_handle  pane,
pane2d_dupfunc_getlist  duplist,
int  use_rgb,
unsigned int  filnum 
)

Converts a Pane 2-D 8-bit handle into an Output 2-D handle.

Parameters
[in]paneThe Pane 2-D handle to convert.
[in]duplistThe Pane 2-D's function for duplicating the image data.
[in]use_rgb1 if output is to be done in color, 0 otherwise.
[in]filnumThe initial file number to use. If 0, it will be set to 1.
Return values
output2d_handleThe new Output 2-D handle.

Definition at line 826 of file output2dpng.c.

References output2dbmp_bybmptype(), output2djpeg_byjpegtype(), and output2dpng_bypngtype().

Here is the call graph for this function:

◆ mod_paneimage_to_output2d()

output2d_handle mod_paneimage_to_output2d ( pane2d_handle  pane,
pane2d_dupimage  dupimage,
pane2d_freeimage  freedata,
pane2d_dupxy  dupxy,
int  use_rgb 
)

Converts a Pane 2-D handle into an Output 2-D handle.

Parameters
[in]paneThe Pane 2-D handle to convert.
[in]dupimageThe Pane 2-D's function for duplicating the image data.
[in]freedataThe Pane 2-D's function for freeing image data.
[in]dupxyThe Pane 2-D's function for duplicating the maximum X and Y coordinates.
[in]use_rgb1 if output is to be done in color, 0 otherwise.
Return values
output2d_handleThe new Output 2-D handle.
Warning
Do not pass in handles that were allocated with multithreading support. Doing so may cause a deadlock. Use the bytype functions instead in this situation.

Definition at line 772 of file output2dpng.c.

References output2dpng_image_to_png().

Here is the call graph for this function:

SourceForge.net Logo  stick2xyz Project Page