2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2018-08-08 11:49:51 +10:00
|
|
|
#pragma once
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2021-07-19 17:55:46 +02:00
|
|
|
#include "COM_BufferArea.h"
|
|
|
|
|
#include "COM_BufferRange.h"
|
|
|
|
|
#include "COM_BuffersIterator.h"
|
2021-10-13 23:00:24 +02:00
|
|
|
#include "COM_Enums.h"
|
2012-07-10 06:31:16 +00:00
|
|
|
|
2024-02-05 12:00:00 +01:00
|
|
|
#include "BLI_math_base.hh"
|
2024-01-15 16:38:41 +01:00
|
|
|
#include "BLI_math_interp.hh"
|
2023-08-13 10:50:52 +03:00
|
|
|
#include "BLI_math_vector.h"
|
2024-03-07 16:56:02 +02:00
|
|
|
#include "BLI_math_vector_types.hh"
|
2013-12-22 14:11:10 +11:00
|
|
|
#include "BLI_rect.h"
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
|
2024-04-23 09:44:33 +02:00
|
|
|
#include <cstdint>
|
2024-01-09 16:52:56 +01:00
|
|
|
#include <cstring>
|
|
|
|
|
|
2023-08-13 10:50:52 +03:00
|
|
|
struct ColormanageProcessor;
|
2021-10-13 23:00:24 +02:00
|
|
|
struct ImBuf;
|
|
|
|
|
|
2021-03-23 17:12:27 +01:00
|
|
|
namespace blender::compositor {
|
|
|
|
|
|
2021-03-19 17:00:53 +01:00
|
|
|
enum class MemoryBufferExtend {
|
|
|
|
|
Clip,
|
|
|
|
|
Extend,
|
|
|
|
|
Repeat,
|
|
|
|
|
};
|
2013-09-05 10:45:19 +00:00
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2024-02-28 16:59:16 +01:00
|
|
|
* \brief a MemoryBuffer contains access to the data
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
class MemoryBuffer {
|
2021-05-10 10:56:07 +02:00
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* Offset between elements.
|
|
|
|
|
*
|
|
|
|
|
* Should always be used for the x dimension when calculating buffer offsets.
|
|
|
|
|
* It will be 0 when is_a_single_elem=true.
|
|
|
|
|
* e.g: buffer_index = y * buffer.row_stride + x * buffer.elem_stride
|
|
|
|
|
*/
|
|
|
|
|
int elem_stride;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Offset between rows.
|
|
|
|
|
*
|
|
|
|
|
* Should always be used for the y dimension when calculating buffer offsets.
|
|
|
|
|
* It will be 0 when is_a_single_elem=true.
|
|
|
|
|
* e.g: buffer_index = y * buffer.row_stride + x * buffer.elem_stride
|
|
|
|
|
*/
|
|
|
|
|
int row_stride;
|
|
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
private:
|
|
|
|
|
/**
|
2021-03-19 14:26:24 +01:00
|
|
|
* \brief the type of buffer DataType::Value, DataType::Vector, DataType::Color
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
2021-10-13 23:01:04 +02:00
|
|
|
DataType datatype_;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2024-02-28 16:59:16 +01:00
|
|
|
* \brief region of this buffer inside
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
2021-10-13 23:01:04 +02:00
|
|
|
rcti rect_;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2018-09-05 14:56:29 +10:00
|
|
|
* \brief the actual float buffer/data
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
2021-10-13 23:01:04 +02:00
|
|
|
float *buffer_;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-19 18:13:26 +01:00
|
|
|
/**
|
2018-09-05 14:56:29 +10:00
|
|
|
* \brief the number of channels of a single value in the buffer.
|
2015-01-19 18:13:26 +01:00
|
|
|
* For value buffers this is 1, vector 3 and color 4
|
|
|
|
|
*/
|
2021-10-13 23:01:04 +02:00
|
|
|
uint8_t num_channels_;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-05-10 10:56:07 +02:00
|
|
|
/**
|
|
|
|
|
* Whether buffer is a single element in memory.
|
|
|
|
|
*/
|
2021-10-13 23:01:04 +02:00
|
|
|
bool is_a_single_elem_;
|
2021-05-10 10:56:07 +02:00
|
|
|
|
2021-06-23 17:21:17 +02:00
|
|
|
/**
|
|
|
|
|
* Whether MemoryBuffer owns buffer data.
|
|
|
|
|
*/
|
|
|
|
|
bool owns_data_;
|
|
|
|
|
|
2021-09-28 19:33:06 +02:00
|
|
|
/** Stride to make any x coordinate within buffer positive (non-zero). */
|
|
|
|
|
int to_positive_x_stride_;
|
|
|
|
|
|
|
|
|
|
/** Stride to make any y coordinate within buffer positive (non-zero). */
|
|
|
|
|
int to_positive_y_stride_;
|
|
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
public:
|
2024-03-21 17:35:19 +02:00
|
|
|
/**
|
|
|
|
|
* \brief construct new temporarily MemoryBuffer for a width and height.
|
|
|
|
|
*/
|
|
|
|
|
MemoryBuffer(DataType data_type, int width, int height);
|
|
|
|
|
|
2015-01-19 18:13:26 +01:00
|
|
|
/**
|
2018-09-05 14:56:29 +10:00
|
|
|
* \brief construct new temporarily MemoryBuffer for an area
|
2015-01-19 18:13:26 +01:00
|
|
|
*/
|
2021-10-13 23:01:15 +02:00
|
|
|
MemoryBuffer(DataType data_type, const rcti &rect, bool is_a_single_elem = false);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-12-09 20:01:49 +11:00
|
|
|
/**
|
|
|
|
|
* Construct MemoryBuffer from a float buffer. MemoryBuffer is not responsible for
|
|
|
|
|
* freeing it.
|
|
|
|
|
*/
|
2021-06-23 17:21:17 +02:00
|
|
|
MemoryBuffer(
|
|
|
|
|
float *buffer, int num_channels, int width, int height, bool is_a_single_elem = false);
|
|
|
|
|
|
2021-12-09 20:01:49 +11:00
|
|
|
/**
|
|
|
|
|
* Construct MemoryBuffer from a float buffer area. MemoryBuffer is not responsible for
|
|
|
|
|
* freeing given buffer.
|
|
|
|
|
*/
|
2021-06-23 17:21:17 +02:00
|
|
|
MemoryBuffer(float *buffer, int num_channels, const rcti &rect, bool is_a_single_elem = false);
|
|
|
|
|
|
2021-03-19 16:07:32 +01:00
|
|
|
/**
|
|
|
|
|
* Copy constructor
|
|
|
|
|
*/
|
|
|
|
|
MemoryBuffer(const MemoryBuffer &src);
|
|
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2018-09-05 14:56:29 +10:00
|
|
|
* \brief destructor
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
~MemoryBuffer();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-05-10 10:56:07 +02:00
|
|
|
/**
|
|
|
|
|
* Whether buffer is a single element in memory independently of its resolution. True for set
|
|
|
|
|
* operations buffers.
|
|
|
|
|
*/
|
|
|
|
|
bool is_a_single_elem() const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return is_a_single_elem_;
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float &operator[](int index)
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
BLI_assert(is_a_single_elem_ ? index < num_channels_ :
|
2021-10-13 23:01:15 +02:00
|
|
|
index < get_coords_offset(get_width(), get_height()));
|
2021-10-13 23:01:04 +02:00
|
|
|
return buffer_[index];
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const float &operator[](int index) const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
BLI_assert(is_a_single_elem_ ? index < num_channels_ :
|
2021-10-13 23:01:15 +02:00
|
|
|
index < get_coords_offset(get_width(), get_height()));
|
2021-10-13 23:01:04 +02:00
|
|
|
return buffer_[index];
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get offset needed to jump from buffer start to given coordinates.
|
|
|
|
|
*/
|
2021-09-28 19:33:06 +02:00
|
|
|
intptr_t get_coords_offset(int x, int y) const
|
2021-05-10 10:56:07 +02:00
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return ((intptr_t)y - rect_.ymin) * row_stride + ((intptr_t)x - rect_.xmin) * elem_stride;
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get buffer element at given coordinates.
|
|
|
|
|
*/
|
|
|
|
|
float *get_elem(int x, int y)
|
|
|
|
|
{
|
2021-09-28 19:33:06 +02:00
|
|
|
BLI_assert(has_coords(x, y));
|
2021-10-13 23:01:04 +02:00
|
|
|
return buffer_ + get_coords_offset(x, y);
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get buffer element at given coordinates.
|
|
|
|
|
*/
|
|
|
|
|
const float *get_elem(int x, int y) const
|
|
|
|
|
{
|
2021-09-28 19:33:06 +02:00
|
|
|
BLI_assert(has_coords(x, y));
|
2021-10-13 23:01:04 +02:00
|
|
|
return buffer_ + get_coords_offset(x, y);
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
2024-02-05 08:48:20 +01:00
|
|
|
/**
|
|
|
|
|
* Get buffer element at given coordinates, clamped to border.
|
|
|
|
|
*/
|
|
|
|
|
const float *get_elem_clamped(int x, int y) const
|
|
|
|
|
{
|
|
|
|
|
const int clamped_x = math::clamp(x, 0, this->get_width() - 1);
|
|
|
|
|
const int clamped_y = math::clamp(y, 0, this->get_height() - 1);
|
|
|
|
|
return buffer_ + get_coords_offset(clamped_x, clamped_y);
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-26 19:07:08 +02:00
|
|
|
void read_elem(int x, int y, float *out) const
|
|
|
|
|
{
|
2021-08-23 15:29:34 +02:00
|
|
|
memcpy(out, get_elem(x, y), get_elem_bytes_len());
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-05 08:48:20 +01:00
|
|
|
void read_elem_clamped(int x, int y, float *out) const
|
|
|
|
|
{
|
|
|
|
|
memcpy(out, get_elem_clamped(x, y), get_elem_bytes_len());
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-23 15:29:34 +02:00
|
|
|
void read_elem_checked(int x, int y, float *out) const
|
|
|
|
|
{
|
2021-09-28 19:33:06 +02:00
|
|
|
if (!has_coords(x, y)) {
|
2021-08-23 15:29:34 +02:00
|
|
|
clear_elem(out);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
read_elem(x, y, out);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void read_elem_checked(float x, float y, float *out) const
|
|
|
|
|
{
|
2021-09-28 19:33:06 +02:00
|
|
|
read_elem_checked(floor_x(x), floor_y(y), out);
|
2021-08-23 15:29:34 +02:00
|
|
|
}
|
|
|
|
|
|
2024-03-07 16:56:02 +02:00
|
|
|
/* Equivalent to the GLSL texture() function with bilinear interpolation and extended boundary
|
2024-03-21 12:00:30 +02:00
|
|
|
* conditions. The coordinates are thus expected to have half-pixels offsets. A float4 is always
|
|
|
|
|
* returned regardless of the number of channels of the buffer, the remaining channels will be
|
|
|
|
|
* initialized with the template float4(0, 0, 0, 1). */
|
2024-03-07 16:56:02 +02:00
|
|
|
float4 texture_bilinear_extend(float2 coordinates) const
|
|
|
|
|
{
|
2024-06-04 15:48:48 +02:00
|
|
|
if (is_a_single_elem_) {
|
|
|
|
|
float4 result = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
|
|
|
|
memcpy(result, buffer_, get_elem_bytes_len());
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-07 16:56:02 +02:00
|
|
|
const int2 size = int2(get_width(), get_height());
|
|
|
|
|
const float2 texel_coordinates = (coordinates * float2(size)) - 0.5f;
|
|
|
|
|
|
|
|
|
|
float4 result = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
|
|
|
|
math::interpolate_bilinear_fl(
|
|
|
|
|
buffer_, result, size.x, size.y, num_channels_, texel_coordinates.x, texel_coordinates.y);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-21 17:26:33 +02:00
|
|
|
/* Equivalent to the GLSL texture() function with nearest interpolation and extended boundary
|
|
|
|
|
* conditions. The coordinates are thus expected to have half-pixels offsets. A float4 is always
|
|
|
|
|
* returned regardless of the number of channels of the buffer, the remaining channels will be
|
|
|
|
|
* initialized with the template float4(0, 0, 0, 1). */
|
|
|
|
|
float4 texture_nearest_extend(float2 coordinates) const
|
|
|
|
|
{
|
2024-06-04 15:48:48 +02:00
|
|
|
if (is_a_single_elem_) {
|
|
|
|
|
float4 result = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
|
|
|
|
memcpy(result, buffer_, get_elem_bytes_len());
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-21 17:26:33 +02:00
|
|
|
const int2 size = int2(get_width(), get_height());
|
|
|
|
|
const float2 texel_coordinates = coordinates * float2(size);
|
|
|
|
|
|
|
|
|
|
float4 result = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
|
|
|
|
math::interpolate_nearest_fl(
|
|
|
|
|
buffer_, result, size.x, size.y, num_channels_, texel_coordinates.x, texel_coordinates.y);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-23 15:29:34 +02:00
|
|
|
void read_elem_bilinear(float x, float y, float *out) const
|
|
|
|
|
{
|
2024-08-01 14:20:50 +03:00
|
|
|
read(out, x, y, PixelSampler::Bilinear);
|
2021-07-26 19:07:08 +02:00
|
|
|
}
|
|
|
|
|
|
2024-04-22 20:58:43 +02:00
|
|
|
void read_elem_bicubic_bspline(float x, float y, float *out) const
|
|
|
|
|
{
|
2024-05-30 17:38:41 +02:00
|
|
|
if (is_a_single_elem_) {
|
|
|
|
|
memcpy(out, buffer_, get_elem_bytes_len());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
math::interpolate_cubic_bspline_fl(buffer_,
|
|
|
|
|
out,
|
|
|
|
|
this->get_width(),
|
|
|
|
|
this->get_height(),
|
|
|
|
|
num_channels_,
|
|
|
|
|
get_relative_x(x),
|
|
|
|
|
get_relative_y(y));
|
2024-04-22 20:58:43 +02:00
|
|
|
}
|
|
|
|
|
|
2021-07-26 19:07:08 +02:00
|
|
|
void read_elem_sampled(float x, float y, PixelSampler sampler, float *out) const
|
|
|
|
|
{
|
2024-08-01 14:01:42 +03:00
|
|
|
read(out, x, y, sampler);
|
2021-07-26 19:07:08 +02:00
|
|
|
}
|
|
|
|
|
|
2024-02-29 12:30:16 +01:00
|
|
|
void read_elem_filtered(
|
|
|
|
|
float x, float y, float dx[2], float dy[2], bool extend_boundary, float *out) const;
|
2021-08-23 15:29:34 +02:00
|
|
|
|
2021-05-10 10:56:07 +02:00
|
|
|
/**
|
|
|
|
|
* Get channel value at given coordinates.
|
|
|
|
|
*/
|
|
|
|
|
float &get_value(int x, int y, int channel)
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
BLI_assert(has_coords(x, y) && channel >= 0 && channel < num_channels_);
|
|
|
|
|
return buffer_[get_coords_offset(x, y) + channel];
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get channel value at given coordinates.
|
|
|
|
|
*/
|
|
|
|
|
const float &get_value(int x, int y, int channel) const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
BLI_assert(has_coords(x, y) && channel >= 0 && channel < num_channels_);
|
|
|
|
|
return buffer_[get_coords_offset(x, y) + channel];
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the buffer row end.
|
|
|
|
|
*/
|
|
|
|
|
const float *get_row_end(int y) const
|
|
|
|
|
{
|
2021-09-28 19:33:06 +02:00
|
|
|
BLI_assert(has_y(y));
|
2021-10-13 23:01:15 +02:00
|
|
|
return buffer_ + (is_a_single_elem() ? num_channels_ : get_coords_offset(get_width(), y));
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the number of elements in memory for a row. For single element buffers it will always
|
|
|
|
|
* be 1.
|
|
|
|
|
*/
|
|
|
|
|
int get_memory_width() const
|
|
|
|
|
{
|
2021-10-13 23:01:15 +02:00
|
|
|
return is_a_single_elem() ? 1 : get_width();
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get number of elements in memory for a column. For single element buffers it will
|
|
|
|
|
* always be 1.
|
|
|
|
|
*/
|
|
|
|
|
int get_memory_height() const
|
|
|
|
|
{
|
2021-10-13 23:01:15 +02:00
|
|
|
return is_a_single_elem() ? 1 : get_height();
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
|
2021-06-23 17:21:17 +02:00
|
|
|
uint8_t get_num_channels() const
|
2015-01-19 18:13:26 +01:00
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return num_channels_;
|
2015-01-19 18:13:26 +01:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-08-10 15:24:28 +02:00
|
|
|
uint8_t get_elem_bytes_len() const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return num_channels_ * sizeof(float);
|
2021-08-10 15:24:28 +02:00
|
|
|
}
|
|
|
|
|
|
2021-07-19 17:55:46 +02:00
|
|
|
/**
|
|
|
|
|
* Get all buffer elements as a range with no offsets.
|
|
|
|
|
*/
|
|
|
|
|
BufferRange<float> as_range()
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return BufferRange<float>(buffer_, 0, buffer_len(), elem_stride);
|
2021-07-19 17:55:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BufferRange<const float> as_range() const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return BufferRange<const float>(buffer_, 0, buffer_len(), elem_stride);
|
2021-07-19 17:55:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BufferArea<float> get_buffer_area(const rcti &area)
|
|
|
|
|
{
|
2021-10-13 23:01:15 +02:00
|
|
|
return BufferArea<float>(buffer_, get_width(), area, elem_stride);
|
2021-07-19 17:55:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BufferArea<const float> get_buffer_area(const rcti &area) const
|
|
|
|
|
{
|
2021-10-13 23:01:15 +02:00
|
|
|
return BufferArea<const float>(buffer_, get_width(), area, elem_stride);
|
2021-07-19 17:55:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BuffersIterator<float> iterate_with(Span<MemoryBuffer *> inputs);
|
|
|
|
|
BuffersIterator<float> iterate_with(Span<MemoryBuffer *> inputs, const rcti &area);
|
|
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2018-09-05 14:56:29 +10:00
|
|
|
* \brief get the data of this MemoryBuffer
|
|
|
|
|
* \note buffer should already be available in memory
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
2021-10-13 23:01:15 +02:00
|
|
|
float *get_buffer()
|
2012-06-26 07:09:49 +00:00
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return buffer_;
|
2012-06-26 07:09:49 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-12-09 20:01:49 +11:00
|
|
|
/**
|
|
|
|
|
* Converts a single elem buffer to a full size buffer (allocates memory for all
|
|
|
|
|
* elements in resolution).
|
|
|
|
|
*/
|
2021-07-05 23:32:19 +02:00
|
|
|
MemoryBuffer *inflate() const;
|
|
|
|
|
|
2015-01-19 18:13:26 +01:00
|
|
|
inline void wrap_pixel(float &x,
|
|
|
|
|
float &y,
|
|
|
|
|
MemoryBufferExtend extend_x,
|
2021-07-26 19:07:08 +02:00
|
|
|
MemoryBufferExtend extend_y) const
|
2015-01-19 18:13:26 +01:00
|
|
|
{
|
2021-10-13 23:01:15 +02:00
|
|
|
const float w = (float)get_width();
|
|
|
|
|
const float h = (float)get_height();
|
2021-10-13 23:01:04 +02:00
|
|
|
x = x - rect_.xmin;
|
|
|
|
|
y = y - rect_.ymin;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-19 18:13:26 +01:00
|
|
|
switch (extend_x) {
|
2021-03-19 17:00:53 +01:00
|
|
|
case MemoryBufferExtend::Clip:
|
2015-01-19 18:13:26 +01:00
|
|
|
break;
|
2021-03-19 17:00:53 +01:00
|
|
|
case MemoryBufferExtend::Extend:
|
2019-04-23 11:21:22 +10:00
|
|
|
if (x < 0) {
|
2015-01-19 18:13:26 +01:00
|
|
|
x = 0.0f;
|
2019-04-23 11:21:22 +10:00
|
|
|
}
|
|
|
|
|
if (x >= w) {
|
2021-07-13 20:30:07 +02:00
|
|
|
x = w - 1;
|
2019-04-23 11:21:22 +10:00
|
|
|
}
|
2015-01-19 18:13:26 +01:00
|
|
|
break;
|
2021-03-19 17:00:53 +01:00
|
|
|
case MemoryBufferExtend::Repeat:
|
ImBuf: Refactor pixel interpolation functions
There exist a bunch of "give me a (filtered) image pixel at this location"
functions, some with duplicated functionality, some with almost the same but
not quite, some that look similar but behave slightly differently, etc.
Some of them were in BLI, some were in ImBuf.
This commit tries to improve the situation by:
* Adding low level interpolation functions to `BLI_math_interp.hh`
- With documentation on their behavior,
- And with more unit tests.
* At `ImBuf` level, there are only convenience inline wrappers to the above BLI
functions (split off into a separate header `IMB_interp.hh`). However, since
these wrappers are inline, some things get a tiny bit faster as a side
effect. E.g. VSE image strip, scaling to 4K resolution (Windows/Ryzen5950X):
- Nearest filter: 2.33 -> 1.94ms
- Bilinear filter: 5.83 -> 5.69ms
- Subsampled3x3 filter: 28.6 -> 22.4ms
Details on the functions:
- All of them have `_byte` and `_fl` suffixes.
- They exist in 4-channel byte (uchar4) and float (float4), as well as
explicitly passed amount of channels for other float images.
- New functions in BLI `blender::math` namespace:
- `interpolate_nearest`
- `interpolate_bilinear`
- `interpolate_bilinear_wrap`. Note that unlike previous "wrap" function,
this one no longer requires the caller to do their own wrapping.
- `interpolate_cubic_bspline`. Previous similar function was called just
"bicubic" which could mean many different things.
- Same functions exist in `IMB_interp.hh`, they are just convenience that takes
ImBuf and uses data pointer, width, height from that.
Other bits:
- Renamed `mod_f_positive` to `floored_fmod` (better matches `safe_floored_modf`
and `floored_modulo` that exist elsewhere), made it branchless and added more
unit tests.
- `interpolate_bilinear_wrap_fl` no longer clamps result to 0..1 range. Instead,
moved the clamp to be outside of the call in `paint_image_proj.cc` and
`paint_utils.cc`. Though the need for clamping in there is also questionable.
Pull Request: https://projects.blender.org/blender/blender/pulls/117387
2024-01-25 11:45:24 +01:00
|
|
|
x = floored_fmod(x, w);
|
2015-01-19 18:13:26 +01:00
|
|
|
break;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-01-19 18:13:26 +01:00
|
|
|
switch (extend_y) {
|
2021-03-19 17:00:53 +01:00
|
|
|
case MemoryBufferExtend::Clip:
|
2015-01-19 18:13:26 +01:00
|
|
|
break;
|
2021-03-19 17:00:53 +01:00
|
|
|
case MemoryBufferExtend::Extend:
|
2019-04-23 11:21:22 +10:00
|
|
|
if (y < 0) {
|
2015-01-19 18:13:26 +01:00
|
|
|
y = 0.0f;
|
2019-04-23 11:21:22 +10:00
|
|
|
}
|
|
|
|
|
if (y >= h) {
|
2021-07-13 20:30:07 +02:00
|
|
|
y = h - 1;
|
2019-04-23 11:21:22 +10:00
|
|
|
}
|
2015-01-19 18:13:26 +01:00
|
|
|
break;
|
2021-03-19 17:00:53 +01:00
|
|
|
case MemoryBufferExtend::Repeat:
|
ImBuf: Refactor pixel interpolation functions
There exist a bunch of "give me a (filtered) image pixel at this location"
functions, some with duplicated functionality, some with almost the same but
not quite, some that look similar but behave slightly differently, etc.
Some of them were in BLI, some were in ImBuf.
This commit tries to improve the situation by:
* Adding low level interpolation functions to `BLI_math_interp.hh`
- With documentation on their behavior,
- And with more unit tests.
* At `ImBuf` level, there are only convenience inline wrappers to the above BLI
functions (split off into a separate header `IMB_interp.hh`). However, since
these wrappers are inline, some things get a tiny bit faster as a side
effect. E.g. VSE image strip, scaling to 4K resolution (Windows/Ryzen5950X):
- Nearest filter: 2.33 -> 1.94ms
- Bilinear filter: 5.83 -> 5.69ms
- Subsampled3x3 filter: 28.6 -> 22.4ms
Details on the functions:
- All of them have `_byte` and `_fl` suffixes.
- They exist in 4-channel byte (uchar4) and float (float4), as well as
explicitly passed amount of channels for other float images.
- New functions in BLI `blender::math` namespace:
- `interpolate_nearest`
- `interpolate_bilinear`
- `interpolate_bilinear_wrap`. Note that unlike previous "wrap" function,
this one no longer requires the caller to do their own wrapping.
- `interpolate_cubic_bspline`. Previous similar function was called just
"bicubic" which could mean many different things.
- Same functions exist in `IMB_interp.hh`, they are just convenience that takes
ImBuf and uses data pointer, width, height from that.
Other bits:
- Renamed `mod_f_positive` to `floored_fmod` (better matches `safe_floored_modf`
and `floored_modulo` that exist elsewhere), made it branchless and added more
unit tests.
- `interpolate_bilinear_wrap_fl` no longer clamps result to 0..1 range. Instead,
moved the clamp to be outside of the call in `paint_image_proj.cc` and
`paint_utils.cc`. Though the need for clamping in there is also questionable.
Pull Request: https://projects.blender.org/blender/blender/pulls/117387
2024-01-25 11:45:24 +01:00
|
|
|
y = floored_fmod(y, h);
|
2015-01-19 18:13:26 +01:00
|
|
|
break;
|
|
|
|
|
}
|
2021-07-13 20:30:07 +02:00
|
|
|
|
2021-10-13 23:01:04 +02:00
|
|
|
x = x + rect_.xmin;
|
|
|
|
|
y = y + rect_.ymin;
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
|
2015-01-19 18:13:26 +01:00
|
|
|
inline void read(float *result,
|
2024-05-01 14:44:01 +02:00
|
|
|
float x,
|
|
|
|
|
float y,
|
|
|
|
|
PixelSampler sampler = PixelSampler::Nearest,
|
2021-03-19 17:00:53 +01:00
|
|
|
MemoryBufferExtend extend_x = MemoryBufferExtend::Clip,
|
2024-05-01 14:44:01 +02:00
|
|
|
MemoryBufferExtend extend_y = MemoryBufferExtend::Clip) const
|
2013-09-05 10:45:19 +00:00
|
|
|
{
|
2024-08-01 14:01:42 +03:00
|
|
|
// Extend is completely ignored for constants. This may need to be fixed in the future.
|
|
|
|
|
if (is_a_single_elem_) {
|
|
|
|
|
memcpy(result, buffer_, get_elem_bytes_len());
|
|
|
|
|
return;
|
2012-07-10 06:31:16 +00:00
|
|
|
}
|
2024-08-01 14:01:42 +03:00
|
|
|
|
|
|
|
|
this->wrap_pixel(x, y, extend_x, extend_y);
|
|
|
|
|
|
|
|
|
|
if (sampler == PixelSampler::Nearest) {
|
|
|
|
|
read_elem_checked(int(floorf(x + 0.5f)), int(floorf(y + 0.5f)), result);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
x = get_relative_x(x);
|
|
|
|
|
y = get_relative_y(y);
|
|
|
|
|
const float w = get_width();
|
|
|
|
|
const float h = get_height();
|
|
|
|
|
|
|
|
|
|
// compute (linear interpolation) intersection with Clip
|
|
|
|
|
float mult = 1.0f;
|
|
|
|
|
if (extend_x == MemoryBufferExtend::Clip) {
|
|
|
|
|
mult = std::min(x + 1.0f, w - x);
|
|
|
|
|
}
|
|
|
|
|
if (extend_y == MemoryBufferExtend::Clip) {
|
|
|
|
|
mult = std::min(mult, std::min(y + 1.0f, h - y));
|
|
|
|
|
}
|
|
|
|
|
if (mult <= 0.0f) {
|
|
|
|
|
clear_elem(result);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sampler == PixelSampler::Bilinear) {
|
|
|
|
|
// Sample using Extend or Repeat
|
|
|
|
|
math::interpolate_bilinear_wrap_fl(buffer_,
|
|
|
|
|
result,
|
|
|
|
|
w,
|
|
|
|
|
h,
|
|
|
|
|
num_channels_,
|
|
|
|
|
x,
|
|
|
|
|
y,
|
|
|
|
|
extend_x == MemoryBufferExtend::Repeat,
|
|
|
|
|
extend_y == MemoryBufferExtend::Repeat);
|
|
|
|
|
}
|
|
|
|
|
else { // PixelSampler::Bicubic
|
|
|
|
|
// Sample using Extend (Repeat is not implemented by interpolate_cubic_bspline)
|
|
|
|
|
math::interpolate_cubic_bspline_fl(buffer_, result, w, h, num_channels_, x, y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Multiply by Clip intersection
|
|
|
|
|
if (mult < 1.0f) {
|
|
|
|
|
for (int i = 0; i < num_channels_; ++i) {
|
|
|
|
|
result[i] *= mult;
|
|
|
|
|
}
|
2013-09-05 10:45:19 +00:00
|
|
|
}
|
2012-07-10 06:31:16 +00:00
|
|
|
}
|
2021-10-13 23:01:15 +02:00
|
|
|
void write_pixel(int x, int y, const float color[4]);
|
|
|
|
|
void add_pixel(int x, int y, const float color[4]);
|
|
|
|
|
inline void read_bilinear(float *result,
|
|
|
|
|
float x,
|
|
|
|
|
float y,
|
|
|
|
|
MemoryBufferExtend extend_x = MemoryBufferExtend::Clip,
|
|
|
|
|
MemoryBufferExtend extend_y = MemoryBufferExtend::Clip) const
|
2012-07-21 22:58:08 +00:00
|
|
|
{
|
2015-01-19 18:13:26 +01:00
|
|
|
float u = x;
|
|
|
|
|
float v = y;
|
|
|
|
|
this->wrap_pixel(u, v, extend_x, extend_y);
|
2021-10-13 23:01:15 +02:00
|
|
|
if ((extend_x != MemoryBufferExtend::Repeat && (u < 0.0f || u >= get_width())) ||
|
|
|
|
|
(extend_y != MemoryBufferExtend::Repeat && (v < 0.0f || v >= get_height())))
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
copy_vn_fl(result, num_channels_, 0.0f);
|
2016-02-21 13:16:00 +01:00
|
|
|
return;
|
|
|
|
|
}
|
2021-10-13 23:01:04 +02:00
|
|
|
if (is_a_single_elem_) {
|
|
|
|
|
memcpy(result, buffer_, sizeof(float) * num_channels_);
|
2021-05-10 10:56:07 +02:00
|
|
|
}
|
|
|
|
|
else {
|
ImBuf: Refactor pixel interpolation functions
There exist a bunch of "give me a (filtered) image pixel at this location"
functions, some with duplicated functionality, some with almost the same but
not quite, some that look similar but behave slightly differently, etc.
Some of them were in BLI, some were in ImBuf.
This commit tries to improve the situation by:
* Adding low level interpolation functions to `BLI_math_interp.hh`
- With documentation on their behavior,
- And with more unit tests.
* At `ImBuf` level, there are only convenience inline wrappers to the above BLI
functions (split off into a separate header `IMB_interp.hh`). However, since
these wrappers are inline, some things get a tiny bit faster as a side
effect. E.g. VSE image strip, scaling to 4K resolution (Windows/Ryzen5950X):
- Nearest filter: 2.33 -> 1.94ms
- Bilinear filter: 5.83 -> 5.69ms
- Subsampled3x3 filter: 28.6 -> 22.4ms
Details on the functions:
- All of them have `_byte` and `_fl` suffixes.
- They exist in 4-channel byte (uchar4) and float (float4), as well as
explicitly passed amount of channels for other float images.
- New functions in BLI `blender::math` namespace:
- `interpolate_nearest`
- `interpolate_bilinear`
- `interpolate_bilinear_wrap`. Note that unlike previous "wrap" function,
this one no longer requires the caller to do their own wrapping.
- `interpolate_cubic_bspline`. Previous similar function was called just
"bicubic" which could mean many different things.
- Same functions exist in `IMB_interp.hh`, they are just convenience that takes
ImBuf and uses data pointer, width, height from that.
Other bits:
- Renamed `mod_f_positive` to `floored_fmod` (better matches `safe_floored_modf`
and `floored_modulo` that exist elsewhere), made it branchless and added more
unit tests.
- `interpolate_bilinear_wrap_fl` no longer clamps result to 0..1 range. Instead,
moved the clamp to be outside of the call in `paint_image_proj.cc` and
`paint_utils.cc`. Though the need for clamping in there is also questionable.
Pull Request: https://projects.blender.org/blender/blender/pulls/117387
2024-01-25 11:45:24 +01:00
|
|
|
math::interpolate_bilinear_wrap_fl(buffer_,
|
2021-05-10 10:56:07 +02:00
|
|
|
result,
|
2021-10-13 23:01:15 +02:00
|
|
|
get_width(),
|
|
|
|
|
get_height(),
|
2021-10-13 23:01:04 +02:00
|
|
|
num_channels_,
|
2021-05-10 10:56:07 +02:00
|
|
|
u,
|
|
|
|
|
v,
|
|
|
|
|
extend_x == MemoryBufferExtend::Repeat,
|
|
|
|
|
extend_y == MemoryBufferExtend::Repeat);
|
|
|
|
|
}
|
2012-07-21 22:58:08 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-01-10 08:57:53 +01:00
|
|
|
/**
|
|
|
|
|
* \brief Apply a color processor on the given area.
|
|
|
|
|
*/
|
|
|
|
|
void apply_processor(ColormanageProcessor &processor, const rcti area);
|
|
|
|
|
|
2021-06-23 17:21:17 +02:00
|
|
|
void copy_from(const MemoryBuffer *src, const rcti &area);
|
|
|
|
|
void copy_from(const MemoryBuffer *src, const rcti &area, int to_x, int to_y);
|
|
|
|
|
void copy_from(const MemoryBuffer *src,
|
|
|
|
|
const rcti &area,
|
|
|
|
|
int channel_offset,
|
|
|
|
|
int elem_size,
|
|
|
|
|
int to_channel_offset);
|
|
|
|
|
void copy_from(const MemoryBuffer *src,
|
|
|
|
|
const rcti &area,
|
|
|
|
|
int channel_offset,
|
|
|
|
|
int elem_size,
|
|
|
|
|
int to_x,
|
|
|
|
|
int to_y,
|
|
|
|
|
int to_channel_offset);
|
|
|
|
|
void copy_from(const uchar *src, const rcti &area);
|
|
|
|
|
void copy_from(const uchar *src,
|
|
|
|
|
const rcti &area,
|
|
|
|
|
int channel_offset,
|
|
|
|
|
int elem_size,
|
|
|
|
|
int elem_stride,
|
2021-08-23 15:30:56 +02:00
|
|
|
int row_stride,
|
2021-06-23 17:21:17 +02:00
|
|
|
int to_channel_offset);
|
|
|
|
|
void copy_from(const uchar *src,
|
|
|
|
|
const rcti &area,
|
|
|
|
|
int channel_offset,
|
|
|
|
|
int elem_size,
|
|
|
|
|
int elem_stride,
|
2021-08-23 15:30:56 +02:00
|
|
|
int row_stride,
|
2021-06-23 17:21:17 +02:00
|
|
|
int to_x,
|
|
|
|
|
int to_y,
|
|
|
|
|
int to_channel_offset);
|
2023-11-06 15:15:22 +01:00
|
|
|
void copy_from(const struct ImBuf *src,
|
|
|
|
|
const rcti &area,
|
|
|
|
|
bool ensure_premultiplied = false,
|
|
|
|
|
bool ensure_linear_space = false);
|
2021-06-23 17:21:17 +02:00
|
|
|
void copy_from(const struct ImBuf *src,
|
|
|
|
|
const rcti &area,
|
|
|
|
|
int channel_offset,
|
|
|
|
|
int elem_size,
|
|
|
|
|
int to_channel_offset,
|
2023-11-06 15:15:22 +01:00
|
|
|
bool ensure_premultiplied = false,
|
2021-06-23 17:21:17 +02:00
|
|
|
bool ensure_linear_space = false);
|
|
|
|
|
void copy_from(const struct ImBuf *src,
|
|
|
|
|
const rcti &src_area,
|
|
|
|
|
int channel_offset,
|
|
|
|
|
int elem_size,
|
|
|
|
|
int to_x,
|
|
|
|
|
int to_y,
|
|
|
|
|
int to_channel_offset,
|
2023-11-06 15:15:22 +01:00
|
|
|
bool ensure_premultiplied = false,
|
2021-06-23 17:21:17 +02:00
|
|
|
bool ensure_linear_space = false);
|
|
|
|
|
|
|
|
|
|
void fill(const rcti &area, const float *value);
|
|
|
|
|
void fill(const rcti &area, int channel_offset, const float *value, int value_size);
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2021-10-13 23:01:15 +02:00
|
|
|
* \brief add the content from other_buffer to this MemoryBuffer
|
|
|
|
|
* \param other_buffer: source buffer
|
2012-08-03 09:51:10 +00:00
|
|
|
*
|
2021-06-22 10:42:32 -07:00
|
|
|
* \note take care when running this on a new buffer since it won't fill in
|
2012-08-03 09:51:10 +00:00
|
|
|
* uninitialized values in areas where the buffers don't overlap.
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
2021-03-19 16:15:08 +01:00
|
|
|
void fill_from(const MemoryBuffer &src);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2018-09-05 14:56:29 +10:00
|
|
|
* \brief get the rect of this MemoryBuffer
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
2021-03-19 15:40:36 +01:00
|
|
|
const rcti &get_rect() const
|
2012-06-26 07:09:49 +00:00
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return rect_;
|
2012-06-26 07:09:49 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2018-09-05 14:56:29 +10:00
|
|
|
* \brief get the width of this MemoryBuffer
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
2021-10-13 23:01:15 +02:00
|
|
|
const int get_width() const
|
2021-03-19 16:45:29 +01:00
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return BLI_rcti_size_x(&rect_);
|
2021-03-19 16:45:29 +01:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2018-09-05 14:56:29 +10:00
|
|
|
* \brief get the height of this MemoryBuffer
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
2021-10-13 23:01:15 +02:00
|
|
|
const int get_height() const
|
2021-03-19 16:45:29 +01:00
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return BLI_rcti_size_y(&rect_);
|
2021-03-19 16:45:29 +01:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
/**
|
2018-09-05 14:56:29 +10:00
|
|
|
* \brief clear the buffer. Make all pixels black transparent.
|
2012-06-13 23:31:47 +00:00
|
|
|
*/
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
void clear();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-03-19 16:45:29 +01:00
|
|
|
float get_max_value() const;
|
|
|
|
|
float get_max_value(const rcti &rect) const;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
private:
|
2021-05-10 10:56:07 +02:00
|
|
|
void set_strides();
|
2024-04-23 09:44:33 +02:00
|
|
|
const int64_t buffer_len() const
|
2021-03-19 16:45:29 +01:00
|
|
|
{
|
2024-04-23 09:44:33 +02:00
|
|
|
return int64_t(get_memory_width()) * int64_t(get_memory_height());
|
2021-03-19 16:45:29 +01:00
|
|
|
}
|
2012-06-25 09:14:37 +00:00
|
|
|
|
2021-08-23 15:29:34 +02:00
|
|
|
void clear_elem(float *out) const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
memset(out, 0, num_channels_ * sizeof(float));
|
2021-08-23 15:29:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename T> T get_relative_x(T x) const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return x - rect_.xmin;
|
2021-08-23 15:29:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename T> T get_relative_y(T y) const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return y - rect_.ymin;
|
2021-08-23 15:29:34 +02:00
|
|
|
}
|
|
|
|
|
|
2021-09-28 19:33:06 +02:00
|
|
|
template<typename T> bool has_coords(T x, T y) const
|
|
|
|
|
{
|
|
|
|
|
return has_x(x) && has_y(y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename T> bool has_x(T x) const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return x >= rect_.xmin && x < rect_.xmax;
|
2021-09-28 19:33:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<typename T> bool has_y(T y) const
|
|
|
|
|
{
|
2021-10-13 23:01:04 +02:00
|
|
|
return y >= rect_.ymin && y < rect_.ymax;
|
2021-09-28 19:33:06 +02:00
|
|
|
}
|
|
|
|
|
|
2021-09-29 07:29:15 +10:00
|
|
|
/* Fast `floor(..)` functions. The caller should check result is within buffer bounds.
|
|
|
|
|
* It `ceil(..)` in near cases and when given coordinate
|
|
|
|
|
* is negative and less than buffer rect `min - 1`. */
|
2021-09-28 19:33:06 +02:00
|
|
|
int floor_x(float x) const
|
|
|
|
|
{
|
|
|
|
|
return (int)(x + to_positive_x_stride_) - to_positive_x_stride_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int floor_y(float y) const
|
|
|
|
|
{
|
|
|
|
|
return (int)(y + to_positive_y_stride_) - to_positive_y_stride_;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-23 17:21:17 +02:00
|
|
|
void copy_single_elem_from(const MemoryBuffer *src,
|
|
|
|
|
int channel_offset,
|
|
|
|
|
int elem_size,
|
2022-01-07 11:38:08 +11:00
|
|
|
int to_channel_offset);
|
|
|
|
|
void copy_rows_from(const MemoryBuffer *src, const rcti &src_area, int to_x, int to_y);
|
2021-06-23 17:21:17 +02:00
|
|
|
void copy_elems_from(const MemoryBuffer *src,
|
|
|
|
|
const rcti &area,
|
2022-01-07 11:38:08 +11:00
|
|
|
int channel_offset,
|
|
|
|
|
int elem_size,
|
|
|
|
|
int to_x,
|
|
|
|
|
int to_y,
|
|
|
|
|
int to_channel_offset);
|
2021-06-23 17:21:17 +02:00
|
|
|
|
2012-06-25 09:14:37 +00:00
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
|
|
|
|
MEM_CXX_CLASS_ALLOC_FUNCS("COM:MemoryBuffer")
|
|
|
|
|
#endif
|
____
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
2012-05-17 12:49:33 +00:00
|
|
|
};
|
2021-03-23 17:12:27 +01:00
|
|
|
|
|
|
|
|
} // namespace blender::compositor
|