Blame gst-libs/gst/video/video-dither.h

Packit 0652a1
/* GStreamer
Packit 0652a1
 * Copyright (C) <2014> Wim Taymans <wim.taymans@gmail.com>
Packit 0652a1
 *
Packit 0652a1
 * This library is free software; you can redistribute it and/or
Packit 0652a1
 * modify it under the terms of the GNU Library General Public
Packit 0652a1
 * License as published by the Free Software Foundation; either
Packit 0652a1
 * version 2 of the License, or (at your option) any later version.
Packit 0652a1
 *
Packit 0652a1
 * This library is distributed in the hope that it will be useful,
Packit 0652a1
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 0652a1
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 0652a1
 * Library General Public License for more details.
Packit 0652a1
 *
Packit 0652a1
 * You should have received a copy of the GNU Library General Public
Packit 0652a1
 * License along with this library; if not, write to the
Packit 0652a1
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 0652a1
 * Boston, MA 02110-1301, USA.
Packit 0652a1
 */
Packit 0652a1
Packit 0652a1
#ifndef __GST_VIDEO_DITHER_H__
Packit 0652a1
#define __GST_VIDEO_DITHER_H__
Packit 0652a1
Packit 0652a1
#include <gst/gst.h>
Packit 0652a1
#include <gst/video/video-prelude.h>
Packit 0652a1
Packit 0652a1
G_BEGIN_DECLS
Packit 0652a1
Packit 0652a1
/**
Packit 0652a1
 * GstVideoDitherMethod:
Packit 0652a1
 * @GST_VIDEO_DITHER_NONE: no dithering
Packit 0652a1
 * @GST_VIDEO_DITHER_VERTERR: propagate rounding errors downwards
Packit 0652a1
 * @GST_VIDEO_DITHER_FLOYD_STEINBERG: Dither with floyd-steinberg error diffusion
Packit 0652a1
 * @GST_VIDEO_DITHER_SIERRA_LITE: Dither with Sierra Lite error diffusion
Packit 0652a1
 * @GST_VIDEO_DITHER_BAYER: ordered dither using a bayer pattern
Packit 0652a1
 *
Packit 0652a1
 * Different dithering methods to use.
Packit 0652a1
 */
Packit 0652a1
typedef enum {
Packit 0652a1
  GST_VIDEO_DITHER_NONE,
Packit 0652a1
  GST_VIDEO_DITHER_VERTERR,
Packit 0652a1
  GST_VIDEO_DITHER_FLOYD_STEINBERG,
Packit 0652a1
  GST_VIDEO_DITHER_SIERRA_LITE,
Packit 0652a1
  GST_VIDEO_DITHER_BAYER,
Packit 0652a1
} GstVideoDitherMethod;
Packit 0652a1
Packit 0652a1
/**
Packit 0652a1
 * GstVideoDitherFlags:
Packit 0652a1
 * @GST_VIDEO_DITHER_FLAG_NONE: no flags
Packit 0652a1
 * @GST_VIDEO_DITHER_FLAG_INTERLACED: the input is interlaced
Packit 0652a1
 * @GST_VIDEO_DITHER_FLAG_QUANTIZE: quantize values in addition to adding dither.
Packit 0652a1
 *
Packit 0652a1
 * Extra flags that influence the result from gst_video_chroma_resample_new().
Packit 0652a1
 */
Packit 0652a1
typedef enum {
Packit 0652a1
  GST_VIDEO_DITHER_FLAG_NONE       = 0,
Packit 0652a1
  GST_VIDEO_DITHER_FLAG_INTERLACED = (1 << 0),
Packit 0652a1
  GST_VIDEO_DITHER_FLAG_QUANTIZE   = (1 << 1),
Packit 0652a1
} GstVideoDitherFlags;
Packit 0652a1
Packit 0652a1
typedef struct _GstVideoDither GstVideoDither;
Packit 0652a1
Packit 0652a1
/* circular dependency, need to include this after defining the enums */
Packit 0652a1
#include <gst/video/video-format.h>
Packit 0652a1
Packit 0652a1
GST_VIDEO_API
Packit 0652a1
GstVideoDither    * gst_video_dither_new      (GstVideoDitherMethod method,
Packit 0652a1
                                               GstVideoDitherFlags flags,
Packit 0652a1
                                               GstVideoFormat format,
Packit 0652a1
                                               guint quantizer[GST_VIDEO_MAX_COMPONENTS],
Packit 0652a1
                                               guint width);
Packit 0652a1
Packit 0652a1
GST_VIDEO_API
Packit 0652a1
void                gst_video_dither_free     (GstVideoDither *dither);
Packit 0652a1
Packit 0652a1
GST_VIDEO_API
Packit 0652a1
void                gst_video_dither_line     (GstVideoDither *dither,
Packit 0652a1
                                               gpointer line, guint x, guint y, guint width);
Packit 0652a1
Packit 0652a1
G_END_DECLS
Packit 0652a1
Packit 0652a1
#endif /* __GST_VIDEO_DITHER_H__ */