Instrument Neutral Distributed Interface INDI 2.2.5
Functions
DSP API File read/write functions

Functions

DLL_EXPORT dsp_stream_p * dsp_file_read_fits (const char *filename, int *channels, int stretch)
 Read a FITS file and fill a dsp_stream_p with its content.
 
DLL_EXPORT void dsp_file_write_fits (const char *filename, int bpp, dsp_stream_p stream)
 Write the dsp_stream_p into a FITS file,.
 
DLL_EXPORT void dsp_file_write_fits_composite (const char *filename, int components, int bpp, dsp_stream_p *stream)
 Write the components dsp_stream_p array into a JPEG file,.
 
DLL_EXPORT dsp_stream_p * dsp_file_read_jpeg (const char *filename, int *channels, int stretch)
 Read a JPEG file and fill a array of dsp_stream_p with its content, each color channel has its own stream in this array and an additional grayscale at end will be added.
 
DLL_EXPORT void dsp_file_write_jpeg (const char *filename, int quality, dsp_stream_p stream)
 Write the stream into a JPEG file,.
 
DLL_EXPORT void dsp_file_write_jpeg_composite (const char *filename, int components, int quality, dsp_stream_p *stream)
 Write the components dsp_stream_p array into a JPEG file,.
 
DLL_EXPORT dsp_stream_p * dsp_file_read_png (const char *filename, int *channels, int stretch)
 Read a PNG file and fill a array of dsp_stream_p with its content, each color channel has its own stream in this array and an additional grayscale at end will be added.
 
DLL_EXPORT void dsp_file_write_png_composite (const char *filename, int components, int compression, dsp_stream_p *stream)
 Write the components dsp_stream_p array into a PNG file,.
 
DLL_EXPORT dsp_t * dsp_file_bayer_2_gray (dsp_t *src, int width, int height)
 Convert a bayer pattern dsp_t array into a grayscale array.
 
DLL_EXPORT dsp_t * dsp_file_bayer_2_rgb (dsp_t *src, int red, int width, int height)
 Convert a bayer pattern dsp_t array into a ordered 3 RGB array.
 
DLL_EXPORT dsp_stream_p * dsp_stream_from_components (dsp_t *buf, int dims, int *sizes, int components)
 Convert a color component dsp_t array into a dsp_stream_p array each element containing the single components.
 
DLL_EXPORT dsp_stream_p * dsp_buffer_rgb_to_components (void *buf, int dims, int *sizes, int components, int bpp, int stretch)
 Convert an RGB color dsp_t array into a dsp_stream_p array each element containing the single components.
 
DLL_EXPORT void dsp_buffer_components_to_rgb (dsp_stream_p *stream, void *rgb, int components, int bpp)
 Convert a component dsp_stream_p array into an RGB dsp_t array.
 
DLL_EXPORT dsp_t * dsp_file_composite_2_bayer (dsp_stream_p *src, int red, int width, int height)
 Convert a component dsp_stream_p array into a bayer dsp_t array.
 
DLL_EXPORT void dsp_file_write_fits_bayer (const char *filename, int components, int bpp, dsp_stream_p *stream)
 Write a FITS file from a dsp_stream_p array.
 
DLL_EXPORT dsp_t * dsp_file_bayer_2_composite (dsp_t *src, int red, int width, int height)
 Convert a bayer pattern dsp_t array into a contiguous component array.
 
DLL_EXPORT dsp_align_info * dsp_align_fill_info (dsp_triangle t1, dsp_triangle t2)
 Fill a dsp_align_info struct by comparing two triangles.
 
DLL_EXPORT dsp_triangle * dsp_align_calc_triangle (dsp_star *stars, int num_stars)
 Create a dsp_triangle struct.
 
DLL_EXPORT void dsp_align_free_triangle (dsp_triangle *triangle)
 Free a dsp_triangle struct pointer.
 
DLL_EXPORT int dsp_align_get_offset (dsp_stream_p ref, dsp_stream_p to_align, double tolerance, double target_score, int num_stars)
 Calculate offsets, rotation and scaling of two streams giving reference alignment point.
 

Detailed Description

Function Documentation

◆ dsp_align_calc_triangle()

DLL_EXPORT dsp_triangle * dsp_align_calc_triangle ( dsp_star *  stars,
int  num_stars 
)

Create a dsp_triangle struct.

Parameters
starsthe stars array needed to build the triangle struct
num_starsthe count of the stars
Returns
A new dsp_triangle struct pointer

Definition at line 197 of file align.c.

◆ dsp_align_fill_info()

DLL_EXPORT dsp_align_info * dsp_align_fill_info ( dsp_triangle  t1,
dsp_triangle  t2 
)

Fill a dsp_align_info struct by comparing two triangles.

Parameters
t1the reference triangle
t2the triangle taken for comparison
Returns
The dsp_align_info struct pointer filled with the offsets

Definition at line 147 of file align.c.

◆ dsp_align_free_triangle()

DLL_EXPORT void dsp_align_free_triangle ( dsp_triangle *  triangle)

Free a dsp_triangle struct pointer.

Parameters
trianglepointer to an allocated dsp_triangle struct

Definition at line 184 of file align.c.

◆ dsp_align_get_offset()

DLL_EXPORT int dsp_align_get_offset ( dsp_stream_p  ref,
dsp_stream_p  to_align,
double  tolerance,
double  target_score,
int  num_stars 
)

Calculate offsets, rotation and scaling of two streams giving reference alignment point.

Parameters
refthe reference stream
to_alignthe stream to be aligned
tolerancenumber of decimals allowed
target_scorethe minimum matching score to reach
num_starsnumber of stars for each triangle
Returns
The alignment mask (bit1: translated, bit2: scaled, bit3: rotated)

Definition at line 259 of file align.c.

◆ dsp_buffer_components_to_rgb()

DLL_EXPORT void dsp_buffer_components_to_rgb ( dsp_stream_p *  stream,
void *  rgb,
int  components,
int  bpp 
)

Convert a component dsp_stream_p array into an RGB dsp_t array.

Parameters
streamthe component dsp_stream_p array
rgbthe output buffer
componentsthe number of the color components
bppthe color depth of the color components

Definition at line 1139 of file file.c.

◆ dsp_buffer_rgb_to_components()

DLL_EXPORT dsp_stream_p * dsp_buffer_rgb_to_components ( void *  buf,
int  dims,
int *  sizes,
int  components,
int  bpp,
int  stretch 
)

Convert an RGB color dsp_t array into a dsp_stream_p array each element containing the single components.

Parameters
bufthe input buffer
dimsthe number of dimension
sizesthe sizes of each dimension
componentsthe number of the color components
bppthe color depth of the color components
stretchwhether to stretch within 0 and dsp_t_max
Returns
The new dsp_stream_p array

Definition at line 1064 of file file.c.

◆ dsp_file_bayer_2_composite()

DLL_EXPORT dsp_t * dsp_file_bayer_2_composite ( dsp_t *  src,
int  red,
int  width,
int  height 
)

Convert a bayer pattern dsp_t array into a contiguous component array.

Parameters
srcthe input buffer
redthe location of the red pixel within the bayer pattern
widththe picture width
heightthe picture height
Returns
The new dsp_t array

Definition at line 850 of file file.c.

◆ dsp_file_bayer_2_gray()

DLL_EXPORT dsp_t * dsp_file_bayer_2_gray ( dsp_t *  src,
int  width,
int  height 
)

Convert a bayer pattern dsp_t array into a grayscale array.

Parameters
srcthe input buffer
widththe picture width
heightthe picture height
Returns
The new dsp_t array

Definition at line 648 of file file.c.

◆ dsp_file_bayer_2_rgb()

DLL_EXPORT dsp_t * dsp_file_bayer_2_rgb ( dsp_t *  src,
int  red,
int  width,
int  height 
)

Convert a bayer pattern dsp_t array into a ordered 3 RGB array.

Parameters
srcthe input buffer
redthe location of the red pixel within the bayer pattern
widththe picture width
heightthe picture height
Returns
The new dsp_t array

Definition at line 946 of file file.c.

◆ dsp_file_composite_2_bayer()

DLL_EXPORT dsp_t * dsp_file_composite_2_bayer ( dsp_stream_p *  src,
int  red,
int  width,
int  height 
)

Convert a component dsp_stream_p array into a bayer dsp_t array.

Parameters
srcthe component dsp_stream_p array
redthe red offset within the bayer quad
widththe width of the output array
heightthe height of the output array
Returns
The new dsp_stream_p array

Definition at line 744 of file file.c.

◆ dsp_file_read_fits()

DLL_EXPORT dsp_stream_p * dsp_file_read_fits ( const char *  filename,
int *  channels,
int  stretch 
)

Read a FITS file and fill a dsp_stream_p with its content.

Parameters
filenamethe file name.
channelswill be filled with the number of components
stretch1 if the buffer intensities have to be stretched
Returns
The new dsp_stream_p structure pointer

Definition at line 27 of file file.c.

◆ dsp_file_read_jpeg()

DLL_EXPORT dsp_stream_p * dsp_file_read_jpeg ( const char *  filename,
int *  channels,
int  stretch 
)

Read a JPEG file and fill a array of dsp_stream_p with its content, each color channel has its own stream in this array and an additional grayscale at end will be added.

Parameters
filenamethe file name.
channelsthis value will be updated with the channel quantity into the picture.
stretch1 if the buffer intensities have to be stretched
Returns
The new dsp_stream_p structure pointers array

Definition at line 514 of file file.c.

◆ dsp_file_read_png()

DLL_EXPORT dsp_stream_p * dsp_file_read_png ( const char *  filename,
int *  channels,
int  stretch 
)

Read a PNG file and fill a array of dsp_stream_p with its content, each color channel has its own stream in this array and an additional grayscale at end will be added.

Parameters
filenamethe file name.
channelsthis value will be updated with the channel quantity into the picture.
stretch1 if the buffer intensities have to be stretched
Returns
The new dsp_stream_p structure pointers array

◆ dsp_file_write_fits()

DLL_EXPORT void dsp_file_write_fits ( const char *  filename,
int  bpp,
dsp_stream_p  stream 
)

Write the dsp_stream_p into a FITS file,.

Parameters
filenamethe file name.
bppthe bit depth of the output FITS file.
streamthe input stream to be saved

Definition at line 164 of file file.c.

◆ dsp_file_write_fits_bayer()

DLL_EXPORT void dsp_file_write_fits_bayer ( const char *  filename,
int  components,
int  bpp,
dsp_stream_p *  stream 
)

Write a FITS file from a dsp_stream_p array.

Parameters
filenamethe output file name
componentsthe number of the color components
bppthe color depth of the color components
streamthe component dsp_stream_p array

Definition at line 374 of file file.c.

◆ dsp_file_write_fits_composite()

DLL_EXPORT void dsp_file_write_fits_composite ( const char *  filename,
int  components,
int  bpp,
dsp_stream_p *  stream 
)

Write the components dsp_stream_p array into a JPEG file,.

Parameters
filenamethe file name.
componentsthe number of streams in the array to be used as components 1 or 3.
bppthe bit depth of the output JPEG file [8,16,32,64,-32,-64].
streamthe input stream to be saved

Definition at line 266 of file file.c.

◆ dsp_file_write_jpeg()

DLL_EXPORT void dsp_file_write_jpeg ( const char *  filename,
int  quality,
dsp_stream_p  stream 
)

Write the stream into a JPEG file,.

Parameters
filenamethe file name.
qualitythe quality of the output JPEG file 0-100.
streamthe input stream to be saved

Definition at line 552 of file file.c.

◆ dsp_file_write_jpeg_composite()

DLL_EXPORT void dsp_file_write_jpeg_composite ( const char *  filename,
int  components,
int  quality,
dsp_stream_p *  stream 
)

Write the components dsp_stream_p array into a JPEG file,.

Parameters
filenamethe file name.
componentsthe number of streams in the array to be used as components 1 or 3.
qualitythe quality of the output JPEG file 0-100.
streamthe input stream to be saved

Definition at line 603 of file file.c.

◆ dsp_file_write_png_composite()

DLL_EXPORT void dsp_file_write_png_composite ( const char *  filename,
int  components,
int  compression,
dsp_stream_p *  stream 
)

Write the components dsp_stream_p array into a PNG file,.

Parameters
filenamethe file name.
componentsthe number of streams in the array to be used as components 1 or 3.
compressionthe compression of the output PNG 0-9.
streamthe input stream array to be saved

◆ dsp_stream_from_components()

DLL_EXPORT dsp_stream_p * dsp_stream_from_components ( dsp_t *  buf,
int  dims,
int *  sizes,
int  components 
)

Convert a color component dsp_t array into a dsp_stream_p array each element containing the single components.

Parameters
bufthe input buffer
dimsthe number of dimension
sizesthe sizes of each dimension
componentsthe number of the color components
Returns
The new dsp_stream_p array

Definition at line 1040 of file file.c.