Changeset View
Changeset View
Standalone View
Standalone View
kstars/fitsviewer/bayer.c
Context not available. | |||||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
---|---|---|---|---|---|
22 | */ | 22 | */ | ||
23 | 23 | | |||
24 | #include "bayer.h" | ||||
25 | | ||||
24 | #include <limits.h> | 26 | #include <limits.h> | ||
25 | #include <math.h> | 27 | #include <math.h> | ||
26 | #include <stdlib.h> | 28 | #include <stdlib.h> | ||
27 | #include <string.h> | 29 | #include <string.h> | ||
28 | #include "bayer.h" | | |||
29 | 30 | | |||
30 | #define CLIP(in, out) \ | 31 | #define CLIP(in, out) \ | ||
31 | in = in < 0 ? 0 : in; \ | 32 | in = in < 0 ? 0 : in; \ | ||
Context not available. | |||||
1764 | weight = *cp++; | 1765 | weight = *cp++; | ||
1765 | grads = *cp++; | 1766 | grads = *cp++; | ||
1766 | color = FC(row + y1, col + x1); | 1767 | color = FC(row + y1, col + x1); | ||
1767 | if (FC(row + y2, col + x2) != color) | 1768 | if ((int)FC(row + y2, col + x2) != color) | ||
1768 | continue; | 1769 | continue; | ||
1769 | diag = (FC(row, col + 1) == color && FC(row + 1, col) == color) ? 2 : 1; | 1770 | diag = ((int)FC(row, col + 1) == color && (int)FC(row + 1, col) == color) ? 2 : 1; | ||
1770 | if (abs(y1 - y2) == diag && abs(x1 - x2) == diag) | 1771 | if (abs(y1 - y2) == diag && abs(x1 - x2) == diag) | ||
1771 | continue; | 1772 | continue; | ||
1772 | *ip++ = (y1 * width + x1) * 3 + color; /* [FD] */ | 1773 | *ip++ = (y1 * width + x1) * 3 + color; /* [FD] */ | ||
Context not available. | |||||
1784 | x = *cp++; | 1785 | x = *cp++; | ||
1785 | *ip++ = (y * width + x) * 3; /* [FD] */ | 1786 | *ip++ = (y * width + x) * 3; /* [FD] */ | ||
1786 | color = FC(row, col); | 1787 | color = FC(row, col); | ||
1787 | if (FC(row + y, col + x) != color && FC(row + y * 2, col + x * 2) == color) | 1788 | if ((int)FC(row + y, col + x) != color && (int)FC(row + y * 2, col + x * 2) == color) | ||
1788 | *ip++ = (y * width + x) * 6 + color; /* [FD] */ | 1789 | *ip++ = (y * width + x) * 6 + color; /* [FD] */ | ||
1789 | else | 1790 | else | ||
1790 | *ip++ = 0; | 1791 | *ip++ = 0; | ||
Context not available. | |||||
1909 | weight = *cp++; | 1910 | weight = *cp++; | ||
1910 | grads = *cp++; | 1911 | grads = *cp++; | ||
1911 | color = FC(row + y1, col + x1); | 1912 | color = FC(row + y1, col + x1); | ||
1912 | if (FC(row + y2, col + x2) != color) | 1913 | if ((int)FC(row + y2, col + x2) != color) | ||
1913 | continue; | 1914 | continue; | ||
1914 | diag = (FC(row, col + 1) == color && FC(row + 1, col) == color) ? 2 : 1; | 1915 | diag = ((int)FC(row, col + 1) == color && (int)FC(row + 1, col) == color) ? 2 : 1; | ||
1915 | if (abs(y1 - y2) == diag && abs(x1 - x2) == diag) | 1916 | if (abs(y1 - y2) == diag && abs(x1 - x2) == diag) | ||
1916 | continue; | 1917 | continue; | ||
1917 | *ip++ = (y1 * width + x1) * 3 + color; /* [FD] */ | 1918 | *ip++ = (y1 * width + x1) * 3 + color; /* [FD] */ | ||
Context not available. | |||||
1929 | x = *cp++; | 1930 | x = *cp++; | ||
1930 | *ip++ = (y * width + x) * 3; /* [FD] */ | 1931 | *ip++ = (y * width + x) * 3; /* [FD] */ | ||
1931 | color = FC(row, col); | 1932 | color = FC(row, col); | ||
1932 | if (FC(row + y, col + x) != color && FC(row + y * 2, col + x * 2) == color) | 1933 | if ((int)FC(row + y, col + x) != color && (int)FC(row + y * 2, col + x * 2) == color) | ||
1933 | *ip++ = (y * width + x) * 6 + color; /* [FD] */ | 1934 | *ip++ = (y * width + x) * 6 + color; /* [FD] */ | ||
1934 | else | 1935 | else | ||
1935 | *ip++ = 0; | 1936 | *ip++ = 0; | ||
Context not available. |