/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include <math.h>
HistogramMain::HistogramMain(PluginServer *server)
: PluginVClient(server)
{
-
+
engine = 0;
for(int i = 0; i < HISTOGRAM_MODES; i++)
{
HistogramMain::~HistogramMain()
{
-
+
for(int i = 0; i < HISTOGRAM_MODES;i++)
{
delete [] lookup[i];
{
thread->window->lock_window("HistogramMain::update_gui");
int reconfigure = load_configuration();
- if(reconfigure)
+ if(reconfigure)
{
HistogramWindow *window = (HistogramWindow *)thread->window;
window->update(0);
if(current_input_mode < HISTOGRAM_MODES)
{
HistogramPoints *points = &config.points[current_input_mode];
- while(points->last)
+ while(points->last)
delete points->last;
while(!result)
{
points->insert(
input.tag.get_property("X", 0.0),
input.tag.get_property("Y", 0.0));
- points->last->gradient =
+ points->last->gradient =
input.tag.get_property("GRADIENT", 1.0);
- points->last->xoffset_left =
+ points->last->xoffset_left =
input.tag.get_property("XOFFSET_LEFT", -0.02);
points->last->xoffset_right =
input.tag.get_property("XOFFSET_RIGHT", 0.02);
}
-float HistogramMain::calculate_linear(float input,
+float HistogramMain::calculate_linear(float input,
int subscript,
int use_value)
{
if(!EQUIV(x2 - x1, 0))
- {
+ {
if (config.smoothMode == HISTOGRAM_LINEAR)
output = (input - x1) * (y2 - y1) / (x2 - x1) + y1;
else if (config.smoothMode == HISTOGRAM_POLYNOMINAL)
case BC_RGB888:
case BC_RGBA8888:
for(i = 0; i < 0x100; i++)
- lookup[subscript][i] =
+ lookup[subscript][i] =
(int)(calculate_smooth((float)i / 0xff, subscript) * 0xff);
break;
// All other integer colormodels are converted to 16 bit RGB
default:
for(i = 0; i < 0x10000; i++)
- lookup[subscript][i] =
+ lookup[subscript][i] =
(int)(calculate_smooth((float)i / 0xffff, subscript) * 0xffff);
break;
}
{
}
-HistogramUnit::HistogramUnit(HistogramEngine *server,
+HistogramUnit::HistogramUnit(HistogramEngine *server,
HistogramMain *plugin)
: LoadClient(server)
{
-HistogramEngine::HistogramEngine(HistogramMain *plugin,
- int total_clients,
+HistogramEngine::HistogramEngine(HistogramMain *plugin,
+ int total_clients,
int total_packages)
: LoadServer(total_clients, total_packages)
{