diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2021-10-07 00:04:30 +0200 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2021-10-07 00:04:30 +0200 |
commit | 9cb01c264169b1ced86b1748c9bd467fb65b7dbc (patch) | |
tree | f0498707464224551689329634bf725320db7e9a /libgphoto2 | |
parent | eb0430ab3168e4567c76b143765dbb6ac8947225 (diff) | |
download | libgphoto2-9cb01c264169b1ced86b1748c9bd467fb65b7dbc.tar.gz |
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.
Diffstat (limited to 'libgphoto2')
-rw-r--r-- | libgphoto2/Makefile.am | 2 | ||||
-rw-r--r-- | libgphoto2/bayer-types.h | 44 | ||||
-rw-r--r-- | libgphoto2/bayer.h | 20 |
3 files changed, 49 insertions, 17 deletions
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 <lutz@users.sf.net> + * + * \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 <lutz@users.sf.net> * @@ -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); |