From 9cb01c264169b1ced86b1748c9bd467fb65b7dbc Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Thu, 7 Oct 2021 00:04:30 +0200 Subject: Use a single definition of BayerTile enum Use a single definition of BayerTile enum inside a new include file bayer-types.h instead of (conditionally!) duplicating the definition from libgphoto2/bayer.h to camlibs/stv680-demosaic-sharpen.h. --- libgphoto2/Makefile.am | 2 +- libgphoto2/bayer-types.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ libgphoto2/bayer.h | 20 ++++---------------- 3 files changed, 49 insertions(+), 17 deletions(-) create mode 100644 libgphoto2/bayer-types.h (limited to 'libgphoto2') diff --git a/libgphoto2/Makefile.am b/libgphoto2/Makefile.am index 090ff7cab..dde166998 100644 --- a/libgphoto2/Makefile.am +++ b/libgphoto2/Makefile.am @@ -26,7 +26,7 @@ libgphoto2_la_LDFLAGS = \ libgphoto2_la_SOURCES = \ gphoto2-abilities-list.c\ ahd_bayer.c \ - bayer.c bayer.h \ + bayer.c bayer.h bayer-types.h \ gphoto2-camera.c \ gphoto2-context.c \ exif.c exif.h \ diff --git a/libgphoto2/bayer-types.h b/libgphoto2/bayer-types.h new file mode 100644 index 000000000..8190bc014 --- /dev/null +++ b/libgphoto2/bayer-types.h @@ -0,0 +1,44 @@ +/** \file bayer-types.h + * \brief bayer type definitions common to camlibs and libgphoto2 + * + * \author Copyright 2001 Lutz Mueller + * + * \note + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * \note + * This library 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 + * Lesser General Public License for more details. + * + * \note + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +#ifndef LIBGPHOTO2_BAYER_TYPES_H +#define LIBGPHOTO2_BAYER_TYPES_H + +/** + * \brief how the bayer CCD array is laid out + * + * This enumeration defines how the CCD bayer array is laid out. + */ +typedef enum { + BAYER_TILE_RGGB = 0, /**< \brief raster is RG,GN */ + BAYER_TILE_GRBG = 1, /**< \brief raster is GR,BG */ + BAYER_TILE_BGGR = 2, /**< \brief raster is BG,GR */ + BAYER_TILE_GBRG = 3, /**< \brief raster is RG,GB */ + BAYER_TILE_RGGB_INTERLACED = 4, /**< \brief scanline order: R1,G1,R2,G2,...,G1,B1,G2,B2,... */ + BAYER_TILE_GRBG_INTERLACED = 5, /**< \brief scanline order: G1,R1,R2,G2,...,B1,G1,B2,G2,... */ + BAYER_TILE_BGGR_INTERLACED = 6, /**< \brief scanline order: B1,G1,R2,G2,...,G1,R1,G2,R2,... */ + BAYER_TILE_GBRG_INTERLACED = 7, /**< \brief scanline order: G1,B1,G2,B2,...,R1,G1,R2,G2,... */ +} BayerTile; + +#endif /* !defined(LIBGPHOTO2_BAYER_TYPES_H) */ diff --git a/libgphoto2/bayer.h b/libgphoto2/bayer.h index 0b5bd1e4d..890e6ec8c 100644 --- a/libgphoto2/bayer.h +++ b/libgphoto2/bayer.h @@ -1,4 +1,4 @@ -/** \file +/** \file bayer.h * * \author Copyright 2001 Lutz Mueller * @@ -24,21 +24,9 @@ #ifndef LIBGPHOTO2_BAYER_H #define LIBGPHOTO2_BAYER_H -/** - * \brief how the bayer CCD array is laid out - * - * This enumeration defines how the CCD bayer array is laid out. - */ -typedef enum { - BAYER_TILE_RGGB = 0, /**< \brief raster is RG,GN */ - BAYER_TILE_GRBG = 1, /**< \brief raster is GR,BG */ - BAYER_TILE_BGGR = 2, /**< \brief raster is BG,GR */ - BAYER_TILE_GBRG = 3, /**< \brief raster is RG,GB */ - BAYER_TILE_RGGB_INTERLACED = 4, /**< \brief scanline order: R1,G1,R2,G2,...,G1,B1,G2,B2,... */ - BAYER_TILE_GRBG_INTERLACED = 5, /**< \brief scanline order: G1,R1,R2,G2,...,B1,G1,B2,G2,... */ - BAYER_TILE_BGGR_INTERLACED = 6, /**< \brief scanline order: B1,G1,R2,G2,...,G1,R1,G2,R2,... */ - BAYER_TILE_GBRG_INTERLACED = 7, /**< \brief scanline order: G1,B1,G2,B2,...,R1,G1,R2,G2,... */ -} BayerTile; + +#include "bayer-types.h" + int gp_bayer_expand (unsigned char *input, int w, int h, unsigned char *output, BayerTile tile); -- cgit v1.2.1