bugs: suggest Irani-Peleg take invariants from underlying reference rendering.
[Ale.git] / d2 / image_weighted_avg.h
blob7ff52c4c8f8edba01e25752e78639578d01decfc
1 // Copyright 2002, 2003, 2004 David Hilvert <dhilvert@auricle.dyndns.org>,
2 // <dhilvert@ugcs.caltech.edu>
4 /* This file is part of the Anti-Lamenessing Engine.
6 The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with the Anti-Lamenessing Engine; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * image_weighted_avg.h: Image representing a weighted average of inputs.
25 #ifndef __image_weighted_avg_h__
26 #define __image_weighted_avg_h__
28 #include "image_ale_real.h"
29 #include "exposure/exposure.h"
30 #include "point.h"
31 #include "image.h"
33 #define ALE_GLSL_IMAGE_WEIGHTED_AVG_INCLUDE \
34 ALE_GLSL_IMAGE_INCLUDE \
35 "struct image_weighted_avg {\n"\
36 " int type;\n"\
37 " vec2 offset;\n"\
38 "};\n"\
39 "bool image_weighted_avg_accumulate_norender(inout image_weighted_avg _this, vec4 pos);\n"\
40 "void image_weighted_avg_accumulate(inout image_weighted_avg _this, vec4 pos, int frame, vec3 value, vec3 confidence);\n"\
41 "image image_weighted_avg_get_weights(inout image_weighted_avg _this);\n"\
42 "vec3 image_weighted_avg_get_pixel(inout image_weighted_avg _this, vec4 pos);\n"
44 class image_weighted_avg : public image, public gpu::program::library {
45 private:
46 void trigger(pixel multiplier) {
47 assert(0);
50 public:
51 image_weighted_avg (unsigned int dimy, unsigned int dimx, unsigned int
52 depth, const char *name = "anonymous")
53 : image(dimy, dimx, depth, name, NULL) {
56 virtual ~image_weighted_avg() {
59 void set_pixel(unsigned int y, unsigned int x, spixel p) {
60 assert(0);
63 spixel get_pixel(unsigned int y, unsigned int x) const {
64 assert(0);
66 return spixel(0, 0, 0);
69 void set_chan(unsigned int y, unsigned int x, unsigned int k, ale_sreal c) {
70 assert(0);
73 ale_sreal get_chan(unsigned int y, unsigned int x, unsigned int k) const {
74 assert(0);
76 return 0;
80 * Make a new image suitable for receiving scaled values.
82 virtual image *scale_generator(int height, int width, int depth, const char *name) const {
83 return new_image_ale_real(height, width, depth, name, _exp);
87 * Pre-transformation check for whether an area should be skipped.
88 * Takes image weights as an argument.
90 virtual int accumulate_norender(int i, int j) = 0;
93 * Accumulate pixels
95 virtual void accumulate(int i, int j, int f, pixel new_value, pixel new_weight) = 0;
97 virtual void accumulate_accel(const gpu::program *p) {
98 assert(0);
102 * Get color map
104 virtual image *get_colors() = 0;
107 * Get weight map
109 virtual image *get_weights() = 0;
112 #endif