34 char error_status[64];
36 fits_open_file(&fptr, filename, READONLY, &status);
43 fits_movabs_hdu(fptr, 1, IMAGE_HDU, &status);
50 long naxes[3] = { 1, 1, 1 };
51 fits_get_img_param(fptr, 3, &bpp, &dims, naxes, &status);
57 int dim, nelements = 1;
58 for(dim = 0; dim < dims; dim++) {
59 nelements *= naxes[dim];
61 void *array = malloc(((
size_t)abs(bpp) * nelements / 8));
66 fits_read_img(fptr, TBYTE, 1, (
long)nelements, NULL, array, &anynul, &status);
71 fits_read_img(fptr, TUSHORT, 1, (
long)nelements, NULL, array, &anynul, &status);
72 if((
size_t)abs(bpp) > 8*
sizeof(
dsp_t))
77 fits_read_img(fptr, TUSHORT, 1, (
long)nelements, NULL, array, &anynul, &status);
78 if((
size_t)abs(bpp) > 8*
sizeof(
dsp_t))
83 fits_read_img(fptr, TULONG, 1, (
long)nelements, NULL, array, &anynul, &status);
84 if((
size_t)abs(bpp) > 8*
sizeof(
dsp_t))
89 fits_read_img(fptr, TULONG, 1, (
long)nelements, NULL, array, &anynul, &status);
90 if((
size_t)abs(bpp) > 8*
sizeof(
dsp_t))
95 fits_read_img(fptr, TLONGLONG, 1, (
long)nelements, NULL, array, &anynul, &status);
96 if((
size_t)abs(bpp) > 8*
sizeof(
dsp_t))
101 fits_read_img(fptr, TFLOAT, 1, (
long)nelements, NULL, array, &anynul, &status);
102 if((
size_t)abs(bpp) > 8*
sizeof(
dsp_t))
107 fits_read_img(fptr, TDOUBLE, 1, (
long)nelements, NULL, array, &anynul, &status);
108 if((
size_t)abs(bpp) > 8*
sizeof(
dsp_t))
117 ffgkey(fptr,
"XBAYROFF", value, comment, &status);
123 ffgkey(fptr,
"YBAYROFF", value, comment, &status);
127 red |= atoi(value)<<1;
130 fits_close_file(fptr, &status);
136 int sizes[2] = { naxes[0], naxes[1] };
142 *channels = naxes[2];
149 for (x = 0; x < *channels; x++) {
158 fits_get_errstatus(status, error_status);
159 perr(
"FITS Error: %s\n", error_status);
167 int img_type = USHORT_IMG;
168 int byte_type = TUSHORT;
169 char bit_depth[64] =
"16 bits per sample";
170 void* buf = malloc((
size_t)(tmp->
len * (
size_t)abs(bpp) / 8 + 512));
172 int naxis = tmp->
dims;
173 long *naxes = (
long*)malloc(
sizeof(
long) * (size_t)tmp->
dims);
174 long nelements = tmp->
len;
175 char error_status[64];
178 for (i = 0; i < tmp->
dims; i++)
179 naxes[i] = tmp->
sizes[i];
186 strcpy(bit_depth,
"8 bits unsigned integer per sample");
191 img_type = USHORT_IMG;
193 strcpy(bit_depth,
"16 bits unsigned integer per sample");
198 img_type = ULONG_IMG;
200 strcpy(bit_depth,
"32 bits unsigned integer per sample");
204 byte_type = TLONGLONG;
205 img_type = LONGLONG_IMG;
207 strcpy(bit_depth,
"64 bits unsigned integer per sample");
212 img_type = FLOAT_IMG;
214 strcpy(bit_depth,
"32 bits floating point per sample");
219 img_type = DOUBLE_IMG;
221 strcpy(bit_depth,
"64 bits floating point per sample");
225 perr(
"Unsupported bits per sample value %d", bpp);
231 fits_create_file(&fptr, filename, &status);
238 fits_create_img(fptr, img_type, naxis, naxes, &status);
245 fits_write_img(fptr, byte_type, 1, nelements, buf, &status);
252 fits_close_file(fptr, &status);
256 fits_get_errstatus(status, error_status);
257 perr(
"FITS Error: %s\n", error_status);
270 int img_type = USHORT_IMG;
271 int byte_type = TUSHORT;
272 char bit_depth[64] =
"16 bits per sample";
273 void* buf = malloc((
size_t)(tmp->
len * components * (
size_t)abs(bpp) / 8 + 512));
275 int naxis = tmp->
dims + 1;
276 long *naxes = (
long*)malloc(
sizeof(
long) * (size_t)(tmp->
dims + 1));
277 long nelements = tmp->
len * components;
278 char error_status[64];
280 for (i = 0; i < tmp->
dims; i++)
281 naxes[i] = tmp->
sizes[i];
282 naxes[i] = components;
283 dsp_t max = (1<<(
size_t)abs(bpp))/2-1;
284 for(x = 0; x < components; x++) {
293 strcpy(bit_depth,
"8 bits unsigned integer per sample");
298 img_type = USHORT_IMG;
300 strcpy(bit_depth,
"16 bits unsigned integer per sample");
305 img_type = ULONG_IMG;
307 strcpy(bit_depth,
"32 bits unsigned integer per sample");
311 byte_type = TLONGLONG;
312 img_type = LONGLONG_IMG;
314 strcpy(bit_depth,
"64 bits unsigned integer per sample");
319 img_type = FLOAT_IMG;
321 strcpy(bit_depth,
"32 bits floating point per sample");
326 img_type = DOUBLE_IMG;
328 strcpy(bit_depth,
"64 bits floating point per sample");
332 perr(
"Unsupported bits per sample value %d", bpp);
341 fits_create_file(&fptr, filename, &status);
348 fits_create_img(fptr, img_type, naxis, naxes, &status);
355 fits_write_img(fptr, byte_type, 1, nelements, buf, &status);
362 fits_close_file(fptr, &status);
366 fits_get_errstatus(status, error_status);
367 perr(
"FITS Error: %s\n", error_status);
379 int img_type = USHORT_IMG;
380 int byte_type = TUSHORT;
381 char bit_depth[64] =
"16 bits per sample";
383 void* data = malloc((
size_t)(len * (
size_t)abs(bpp) / 8 + 512));
385 int naxis = tmp->
dims;
386 long *naxes = (
long*)malloc(
sizeof(
long) * (size_t)(tmp->
dims));
387 long nelements = tmp->
len;
388 char error_status[64];
390 for (i = 0; i < tmp->
dims; i++)
391 naxes[i] = tmp->
sizes[i];
395 for(x = 0; x < components; x++) {
402 dsp_buffer_copy(buf, ((
unsigned char*)((
unsigned char*)data)), stream[components]->len);
403 strcpy(bit_depth,
"8 bits unsigned integer per sample");
408 img_type = USHORT_IMG;
409 dsp_buffer_copy(buf, ((
unsigned short*)((
unsigned short*)data)), stream[components]->len);
410 strcpy(bit_depth,
"16 bits unsigned integer per sample");
415 img_type = ULONG_IMG;
416 dsp_buffer_copy(buf, ((
unsigned int*)((
unsigned int*)data)), stream[components]->len);
417 strcpy(bit_depth,
"32 bits unsigned integer per sample");
421 byte_type = TLONGLONG;
422 img_type = LONGLONG_IMG;
423 dsp_buffer_copy(buf, ((
unsigned long*)((
unsigned long*)data)), stream[components]->len);
424 strcpy(bit_depth,
"64 bits unsigned integer per sample");
429 img_type = FLOAT_IMG;
430 dsp_buffer_copy(buf, ((
float*)((
float*)data)), stream[components]->len);
431 strcpy(bit_depth,
"32 bits floating point per sample");
436 img_type = DOUBLE_IMG;
437 dsp_buffer_copy(buf, ((
double*)((
double*)data)), stream[components]->len);
438 strcpy(bit_depth,
"64 bits floating point per sample");
442 perr(
"Unsupported bits per sample value %d", bpp);
450 fits_create_file(&fptr, filename, &status);
457 fits_create_img(fptr, img_type, naxis, naxes, &status);
465 int redy = (red>>1)&1;
467 fits_write_key(fptr, TINT,
"XBAYROFF", &redx,
"X Bayer Offset", &status);
473 fits_write_key(fptr, TINT,
"YBAYROFF", &redy,
"Y Bayer Offset", &status);
480 fits_write_key(fptr, TSTRING,
"BAYERPAT",
"RGGB",
"Y Bayer Offset", &status);
483 fits_write_key(fptr, TSTRING,
"BAYERPAT",
"GRGB",
"Y Bayer Offset", &status);
486 fits_write_key(fptr, TSTRING,
"BAYERPAT",
"GBRG",
"Y Bayer Offset", &status);
489 fits_write_key(fptr, TSTRING,
"BAYERPAT",
"BGGR",
"Y Bayer Offset", &status);
497 fits_write_img(fptr, byte_type, 1, nelements, data, &status);
504 fits_close_file(fptr, &status);
508 fits_get_errstatus(status, error_status);
509 perr(
"FITS Error: %s\n", error_status);
520 struct jpeg_decompress_struct info;
521 struct jpeg_error_mgr err;
523 info.err = jpeg_std_error(& err);
524 jpeg_create_decompress(& info);
526 FILE *jpeg = fopen (filename,
"r");
530 jpeg_stdio_src(&info, jpeg);
531 jpeg_read_header(&info,
TRUE);
532 info.dct_method = JDCT_FLOAT;
533 jpeg_start_decompress(&info);
534 width = (int)info.output_width;
535 height = (
int)info.output_height;
536 components = (int)info.num_components;
538 int row_stride = (components * width);
539 buf = (
unsigned char *)malloc((
size_t)(width * height * components));
540 unsigned char *image = buf;
542 for (row = 0; row < height; row++)
544 jpeg_read_scanlines(&info, &image, 1);
547 jpeg_finish_decompress(&info);
548 *channels = components;
554 int width = stream->
sizes[0];
555 int height = stream->
sizes[1];
556 int components = (stream->
red>=0) ? 3 : 1;
557 void *buf = malloc((
size_t)(stream->
len*(stream->
red>=0?3:1)));
558 unsigned char *image = (
unsigned char *)buf;
566 struct jpeg_compress_struct cinfo;
567 struct jpeg_error_mgr jerr;
570 cinfo.err = jpeg_std_error(&jerr);
571 jpeg_create_compress(&cinfo);
572 if ((outfile = fopen(filename,
"wb")) == NULL) {
573 perr(
"can't open %s\n", filename);
576 jpeg_stdio_dest(&cinfo, outfile);
577 cinfo.image_width = (
unsigned int)width;
578 cinfo.image_height = (
unsigned int)height;
579 cinfo.in_color_space = (components == 1 ? JCS_GRAYSCALE : JCS_RGB);
580 cinfo.input_components = components;
581 jpeg_set_defaults(&cinfo);
582 cinfo.dct_method = JDCT_FLOAT;
583 cinfo.optimize_coding =
TRUE;
584 cinfo.restart_in_rows = 1;
586 jpeg_set_quality(&cinfo, quality,
TRUE);
587 jpeg_start_compress(&cinfo,
TRUE);
588 row_stride = width * (stream->
red>=0?3:1);
591 for (row = 0; row < height; row++)
593 jpeg_write_scanlines(&cinfo, &image, 1);
598 jpeg_finish_compress(&cinfo);
600 jpeg_destroy_compress(&cinfo);
606 unsigned int row_stride;
607 int width = stream[components]->
sizes[0];
608 int height = stream[components]->
sizes[1];
609 void *buf = malloc((
size_t)(stream[components]->len*components));
610 unsigned char *image = (
unsigned char *)buf;
613 struct jpeg_compress_struct cinfo;
614 struct jpeg_error_mgr jerr;
616 cinfo.err = jpeg_std_error(&jerr);
617 if ((outfile = fopen(filename,
"wb")) == NULL) {
618 perr(
"can't open %s\n", filename);
621 jpeg_create_compress(&cinfo);
622 jpeg_stdio_dest(&cinfo, outfile);
623 cinfo.image_width = (
unsigned int)width;
624 cinfo.image_height = (
unsigned int)height;
625 cinfo.in_color_space = (components == 1 ? JCS_GRAYSCALE : JCS_RGB);
626 cinfo.input_components = components;
627 cinfo.dct_method = JDCT_FLOAT;
628 cinfo.optimize_coding =
TRUE;
629 cinfo.restart_in_rows = 1;
630 jpeg_set_defaults(&cinfo);
632 jpeg_set_quality(&cinfo, quality,
TRUE);
633 jpeg_start_compress(&cinfo,
TRUE);
634 row_stride = (
unsigned int)width * (
unsigned int)components;
636 for (row = 0; row < height; row++)
638 jpeg_write_scanlines(&cinfo, &image, 1);
642 jpeg_finish_compress(&cinfo);
643 jpeg_destroy_compress(&cinfo);
651 dsp_t *rawpt, *scanpt;
657 size = width * height;
659 for (i = 0; i < size; i++)
661 if ((i / width) % 2 == 0)
666 if ((i > width) && ((i % width) > 0))
669 (*(rawpt - width - 1) + *(rawpt - width + 1) + *(rawpt + width - 1) + *(rawpt + width + 1)) /
671 val += (*(rawpt - 1) + *(rawpt + 1) + *(rawpt + width) + *(rawpt - width)) / 4;
676 val = *(rawpt + width + 1);
677 val += (*(rawpt + 1) + *(rawpt + width)) / 2;
684 if ((i > width) && ((i % width) < (width - 1)))
686 val = (*(rawpt + width) + *(rawpt - width)) / 2;
688 val += (*(rawpt - 1) + *(rawpt + 1)) / 2;
692 val = *(rawpt + width);
703 if ((i < (width * (height - 1))) && ((i % width) > 0))
705 val = (*(rawpt - 1) + *(rawpt + 1)) / 2;
707 val += (*(rawpt + width) + *(rawpt - width)) / 2;
714 val += *(rawpt - width);
720 if (i < (width * (height - 1)) && ((i % width) < (width - 1)))
723 val += (*(rawpt - 1) + *(rawpt + 1) + *(rawpt - width) + *(rawpt + width)) / 4;
725 (*(rawpt - width - 1) + *(rawpt - width + 1) + *(rawpt + width - 1) + *(rawpt + width + 1)) /
732 val += (*(rawpt - 1) + *(rawpt - width)) / 2;
733 val += *(rawpt - width - 1);
747 dsp_t *rawpt, *red, *green, *blue;
754 size = width * height;
755 for (i = 0; i < size; i++)
757 if ((i / width) % 2 == ((r&2)>>1))
759 if ((i % 2) == (r&1))
762 if ((i > width) && ((i % width) > 0))
764 rawpt[i - width - 1] += red[i];
765 rawpt[i - width + 1] += red[i];
766 rawpt[i + width - 1] += red[i];
767 rawpt[i + width + 1] += red[i];
768 rawpt[i - 1] += green[i];
769 rawpt[i + 1] += green[i];
770 rawpt[i + width] += green[i];
771 rawpt[i - width] += green[i];
776 rawpt[i + width + 1] += red[i];
777 rawpt[i + 1] += green[i];
778 rawpt[i + width] += green[i];
785 if ((i > width) && ((i % width) < (width - 1)))
787 rawpt[i + width] += red[i];
788 rawpt[i - width] += red[i];
789 rawpt[i] += green[i];
790 rawpt[i - 1] += blue[i];
791 rawpt[i + 1] += blue[i];
795 rawpt[i + width] += red[i];
796 rawpt[i] += green[i];
797 rawpt[i - 1] += blue[i];
803 if ((i % 2) == (r&1))
806 if ((i < (width * (height - 1))) && ((i % width) > 0))
808 rawpt[i - 1] += red[i];
809 rawpt[i + 1] += red[i];
810 rawpt[i] += green[i];
811 rawpt[i + width] += blue[i];
812 rawpt[i - width] += blue[i];
816 rawpt[i + 1] += red[i];
817 rawpt[i] += green[i];
818 rawpt[i - width] += blue[i];
823 if (i < (width * (height - 1)) && ((i % width) < (width - 1)))
826 rawpt[i - 1] += green[i];
827 rawpt[i + 1] += green[i];
828 rawpt[i - width] += green[i];
829 rawpt[i + width] += green[i];
830 rawpt[i - width - 1] += blue[i];
831 rawpt[i - width + 1] += blue[i];
832 rawpt[i + width + 1] += blue[i];
833 rawpt[i + width + 1] += blue[i];
839 rawpt[i - 1] += green[i];
840 rawpt[i - width] += green[i];
841 rawpt[i - width - 1] += blue[i];
853 dsp_t *rawpt, *red, *green, *blue;
859 green = &dst[width*height];
860 red = &dst[width*height*2];
861 size = width * height;
862 for (i = 0; i < size; i++)
864 if ((i / width) % 2 == ((r&2)>>1))
866 if ((i % 2) == (r&1))
869 if ((i > width) && ((i % width) > 0))
872 (*(rawpt - width - 1) + *(rawpt - width + 1) + *(rawpt + width - 1) + *(rawpt + width + 1)) /
874 *green++ = (*(rawpt - 1) + *(rawpt + 1) + *(rawpt + width) + *(rawpt - width)) / 4;
879 *red++ = *(rawpt + width + 1);
880 *green++ = (*(rawpt + 1) + *(rawpt + width)) / 2;
887 if ((i > width) && ((i % width) < (width - 1)))
889 *red++ = (*(rawpt + width) + *(rawpt - width)) / 2;
891 *blue++ = (*(rawpt - 1) + *(rawpt + 1)) / 2;
895 *red++ = *(rawpt + width);
897 *blue++ = *(rawpt - 1);
903 if ((i % 2) == (r&1))
906 if ((i < (width * (height - 1))) && ((i % width) > 0))
908 *red++ = (*(rawpt - 1) + *(rawpt + 1)) / 2;
910 *blue++ = (*(rawpt + width) + *(rawpt - width)) / 2;
915 *red++ = *(rawpt + 1);
917 *blue++ = *(rawpt - width);
923 if (i < (width * (height - 1)) && ((i % width) < (width - 1)))
926 *green++ = (*(rawpt - 1) + *(rawpt + 1) + *(rawpt - width) + *(rawpt + width)) / 4;
928 (*(rawpt - width - 1) + *(rawpt - width + 1) + *(rawpt + width - 1) + *(rawpt + width + 1)) /
935 *green++ = (*(rawpt - 1) + *(rawpt - width)) / 2;
936 *blue++ = *(rawpt - width - 1);
949 dsp_t *rawpt, *scanpt;
955 size = width * height;
957 for (i = 0; i < size; i++)
959 if ((i / width) % 2 == ((red&2)>>1))
961 if ((i % 2) == (red&1))
964 if ((i > width) && ((i % width) > 0))
967 (*(rawpt - width - 1) + *(rawpt - width + 1) + *(rawpt + width - 1) + *(rawpt + width + 1)) /
969 *scanpt++ = (*(rawpt - 1) + *(rawpt + 1) + *(rawpt + width) + *(rawpt - width)) / 4;
974 *scanpt++ = *(rawpt + width + 1);
975 *scanpt++ = (*(rawpt + 1) + *(rawpt + width)) / 2;
982 if ((i > width) && ((i % width) < (width - 1)))
984 *scanpt++ = (*(rawpt + width) + *(rawpt - width)) / 2;
986 *scanpt++ = (*(rawpt - 1) + *(rawpt + 1)) / 2;
990 *scanpt++ = *(rawpt + width);
992 *scanpt++ = *(rawpt - 1);
998 if ((i % 2) == (red&1))
1001 if ((i < (width * (height - 1))) && ((i % width) > 0))
1003 *scanpt++ = (*(rawpt - 1) + *(rawpt + 1)) / 2;
1005 *scanpt++ = (*(rawpt + width) + *(rawpt - width)) / 2;
1010 *scanpt++ = *(rawpt + 1);
1012 *scanpt++ = *(rawpt - width);
1018 if (i < (width * (height - 1)) && ((i % width) < (width - 1)))
1021 *scanpt++ = (*(rawpt - 1) + *(rawpt + 1) + *(rawpt - width) + *(rawpt + width)) / 4;
1023 (*(rawpt - width - 1) + *(rawpt - width + 1) + *(rawpt + width - 1) + *(rawpt + width + 1)) /
1030 *scanpt++ = (*(rawpt - 1) + *(rawpt - width)) / 2;
1031 *scanpt++ = *(rawpt - width - 1);
1044 for(y = 0; y <= components; y++) {
1046 for(d = 0; d < dims; d++)
1049 if(y < components) {
1052 for(x = 0; x < picture[y]->
len; x++) {
1054 for(d = 0; d < components; d++) {
1055 val += buf[x+d*picture[y]->
len];
1057 picture[y]->
buf[x] = (
dsp_t)val/components;
1069 for(y = 0; y < components; y++) {
1071 for(d = 0; d < dims; d++)
1099 picture[y] = channel;
1102 for(d = 0; d < dims; d++)
1105 for(x = 0; x < channel->
len; x++) {
1109 for(z = 0; z < y; z++) v += ((
unsigned char*)buf)[x*y+z];
1112 for(z = 0; z < y; z++) v += ((
unsigned short*)buf)[x*y+z];
1115 for(z = 0; z < y; z++) v += ((
unsigned int*)buf)[x*y+z];
1118 for(z = 0; z < y; z++) v += ((
unsigned long*)buf)[x*y+z];
1121 for(z = 0; z < y; z++) v += ((
float*)buf)[x*y+z];
1124 for(z = 0; z < y; z++) v += ((
double*)buf)[x*y+z];
1134 picture[y] = channel;
1142 int len = stream[0]->
len * components;
1145 for(y = 0; y < components; y++) {
#define Min(a, b)
if min() is not present you can use this one
int * sizes
Sizes of each dimension.
int dims
Number of dimensions of the buffers.
int len
The buffers length.
#define dsp_buffer_copy(in, out, len)
Fill the output buffer with the values of the elements of the input stream by casting them to the out...
#define dsp_buffer_copy_stepping(in, out, inlen, outlen, instep, outstep)
Fill the output buffer with the values of the elements of the input stream by casting them to the out...
#define dsp_buffer_stretch(buf, len, _mn, _mx)
Stretch minimum and maximum values of the input stream.
void dsp_buffer_pow1(dsp_stream_p stream, double val)
Expose elements of the input stream to the given power.
DLL_EXPORT void dsp_stream_free(dsp_stream_p stream)
Free the DSP stream passed as argument.
DLL_EXPORT dsp_stream_p dsp_stream_copy(dsp_stream_p stream)
Create a copy of the DSP stream passed as argument.
DLL_EXPORT dsp_stream_p dsp_stream_new(void)
Allocate a new DSP stream type.
DLL_EXPORT void dsp_stream_add_dim(dsp_stream_p stream, int len)
Add a dimension with length len to a DSP stream.
DLL_EXPORT void dsp_stream_alloc_buffer(dsp_stream_p stream, int len)
Allocate a buffer with length len on the stream passed as argument.
DLL_EXPORT void dsp_stream_free_buffer(dsp_stream_p stream)
Free the buffer of the DSP Stream passed as argument.
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.
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,.
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 co...
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.
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.
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,.
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.
void dsp_file_write_jpeg(const char *filename, int quality, dsp_stream_p stream)
Write the stream into a JPEG file,.
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 compone...
dsp_t * dsp_file_composite_2_bayer(dsp_stream_p *src, int r, int width, int height)
Convert a component dsp_stream_p array into a bayer dsp_t array.
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 st...
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.
void dsp_file_write_fits(const char *filename, int bpp, dsp_stream_p stream)
Write the dsp_stream_p into a FITS file,.
dsp_t * dsp_file_bayer_2_composite(dsp_t *src, int r, int width, int height)
Convert a bayer pattern dsp_t array into a contiguos component array.
Contains a set of informations and data relative to a buffer and how to use it.