~ubuntu-branches/ubuntu/vivid/rlvm/vivid

« back to all changes in this revision

Viewing changes to src/Systems/Base/ToneCurve.hpp

  • Committer: Package Import Robot
  • Author(s): Ying-Chun Liu (PaulLiu)
  • Date: 2014-10-22 03:24:19 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20141022032419-yqxls9ky4n1w811n
Tags: 0.14-1
* New upstream release
* Bump Standards-Version to 3.9.6: nothing needs to be changed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- Mode: C++; tab-width:2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
 
// vi:tw=80:et:ts=2:sts=2
3
 
//
4
 
// -----------------------------------------------------------------------
5
 
//
6
 
// This file is part of RLVM, a RealLive virtual machine clone.
7
 
//
8
 
// -----------------------------------------------------------------------
9
 
//
10
 
// Copyright (C) 2008 Elliot Glaysher 
11
 
//
12
 
// This program is free software; you can redistribute it and/or modify
13
 
// it under the terms of the GNU General Public License as published by
14
 
// the Free Software Foundation; either version 3 of the License, or
15
 
// (at your option) any later version.
16
 
//
17
 
// This program is distributed in the hope that it will be useful,
18
 
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
// GNU General Public License for more details.
21
 
//
22
 
// You should have received a copy of the GNU General Public License
23
 
// along with this program; if not, write to the Free Software
24
 
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
25
 
//
26
 
// -----------------------------------------------------------------------
27
 
 
28
 
#ifndef SRC_SYSTEMS_BASE_TONECURVE_HPP_
29
 
#define SRC_SYSTEMS_BASE_TONECURVE_HPP_
30
 
 
31
 
#include <boost/array.hpp>
32
 
#include <vector>
33
 
 
34
 
class Gameexe;
35
 
class RLMachine;
36
 
 
37
 
typedef boost::array<unsigned char, 256> ToneCurveColorMap;
38
 
typedef boost::array<ToneCurveColorMap, 3> ToneCurveRGBMap;
39
 
typedef std::vector<ToneCurveRGBMap> ToneCurveEffects;
40
 
 
41
 
// Manages tone curve effects
42
 
//
43
 
// The tcc file is a set of mapping between R, G, and B color values and their
44
 
// corresponding values after the tone curve is applied, where tcc_effect[2][1][200]
45
 
// is the corresponding green value for a green value of 200 in the original image
46
 
// when the tone curve with the "index" of 2 is applied.
47
 
// ToneCurve class is responsible for loading the tcc data and providing an
48
 
// interface for applying tone curve effects.
49
 
class ToneCurve {
50
 
 public:
51
 
  // Initializes an empty tone curve set (for games that don't use this feature).
52
 
  ToneCurve();
53
 
 
54
 
  // Initializes the CG table with the TCC data file specified in the
55
 
  // #TONECURVE_FILENAME gameexe key.
56
 
  explicit ToneCurve(Gameexe& gameexe);
57
 
  ~ToneCurve();
58
 
 
59
 
  // Returns the total number of tone curve effects available in the tone curve file
60
 
  int getEffectCount() const;
61
 
 
62
 
  // Return the effect at the given index (used by Surface in toneCurve()).  The effects are indexed from 0 to effect_count - 1
63
 
  ToneCurveRGBMap getEffect(int index);
64
 
 
65
 
 private:
66
 
 
67
 
  // Array of tone curve effects
68
 
  ToneCurveEffects tcc_info_;
69
 
  int effect_count_;
70
 
 
71
 
};  // end of class ToneCurve
72
 
 
73
 
#endif  // SRC_SYSTEMS_BASE_TONECURVE_HPP_