/usr/include/astrometry/qfits_image.h is in libastrometry-dev 0.73+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | /* Note: this file has been modified from its original form by the
Astrometry.net team. For details see http://astrometry.net */
/* $Id: qfits_image.h,v 1.9 2006/02/23 11:04:17 yjung Exp $
*
* This file is part of the ESO QFITS Library
* Copyright (C) 2001-2004 European Southern Observatory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* $Author: yjung $
* $Date: 2006/02/23 11:04:17 $
* $Revision: 1.9 $
* $Name: qfits-6_2_0 $
*/
#ifndef QFITS_IMAGE_H
#define QFITS_IMAGE_H
/*-----------------------------------------------------------------------------
Includes
-----------------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/*-----------------------------------------------------------------------------
Defines
-----------------------------------------------------------------------------*/
/** C pixel types. */
#define PTYPE_FLOAT 0
#define PTYPE_INT 1
#define PTYPE_DOUBLE 2
#define PTYPE_UINT8 3 /** Astrometry.net only */
#define PTYPE_INT16 4 /** Astrometry.net only */
/* FITS pixel depths */
/* FITS BITPIX=8 */
#define BPP_8_UNSIGNED (8)
/* FITS BITPIX=16 */
#define BPP_16_SIGNED (16)
/* FITS BITPIX=32 */
#define BPP_32_SIGNED (32)
/* FITS BITPIX=-32 */
#define BPP_IEEE_FLOAT (-32)
/* FITS BITPIX=-64 */
#define BPP_IEEE_DOUBLE (-64)
/* Default BITPIX for output */
#define BPP_DEFAULT BPP_IEEE_FLOAT
/* Compute the number of bytes per pixel for a given BITPIX value */
#define BYTESPERPIXEL(x) ( ((x) == BPP_8_UNSIGNED) ? 1 : \
((x) == BPP_16_SIGNED) ? 2 : \
((x) == BPP_32_SIGNED) ? 4 : \
((x) == BPP_IEEE_FLOAT) ? 4 : \
((x) == BPP_IEEE_DOUBLE) ? 8 : 0 )
/*-----------------------------------------------------------------------------
New types
-----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/**
@brief Alias for unsigned char
A 'byte' is just an alias for an unsigned char. It is only defined
for readability.
*/
/*----------------------------------------------------------------------------*/
typedef unsigned char byte;
/*----------------------------------------------------------------------------*/
/**
@brief qfits dumper control object
This structure offers various control parameters to dump a pixel
buffer to a FITS file. The buffer will be dumped as requested
to the requested file in append mode. Of course, the requested file
must be writeable for the operation to succeed.
The following example demonstrates how to save a linear ramp sized
100x100 to a FITS file with BITPIX=16. Notice that this code only
dumps the pixel buffer, no header information is provided in this
case.
@code
int i, j;
int * ibuf;
qfitsdumper qd;
// Fill a buffer with 100x100 int pixels
ibuf = malloc(100 * 100 * sizeof(int));
for (j=0; j<100; j++) {
for (i=0; i<100; i++) {
ibuf[i+j*100] = i+j;
}
}
qd.filename = "out.fits"; // Output file name
qd.npix = 100 * 100; // Number of pixels
qd.ptype = PTYPE_INT; // Input buffer type
qd.ibuf = ibuf; // Set buffer pointer
qd.out_ptype = BPP_16_SIGNED; // Save with BITPIX=16
// Dump buffer to file (error checking omitted for clarity)
qfits_pixdump(&qd);
free(ibuf);
@endcode
If the provided output file name is "STDOUT" (all capitals), the
function will dump the pixels to the stdout steam (usually the console,
could have been re-directed).
*/
/*----------------------------------------------------------------------------*/
typedef struct qfitsdumper {
/** Name of the file to dump to, "STDOUT" to dump to stdout */
const char * filename;
/** Number of pixels in the buffer to dump */
int npix;
/** Buffer type: PTYPE_FLOAT, PTYPE_INT or PTYPE_DOUBLE */
int ptype;
/** Pointer to input integer pixel buffer */
const int * ibuf;
/** Pointer to input float pixel buffer */
const float * fbuf;
/** Pointer to input double pixel buffer */
const double * dbuf;
/** Pointer to generic pixel buffer. */
const void* vbuf;
/** Requested BITPIX in output FITS file */
int out_ptype;
} qfitsdumper;
/*-----------------------------------------------------------------------------
Function prototypes
-----------------------------------------------------------------------------*/
int qfits_pixdump(const qfitsdumper *);
#endif
|