#include <TransferFunction.h>
Public Member Functions | |
TransferFunction (void) | |
~TransferFunction (void) | |
bool | load (const std::string file) |
bool | save (const std::string file) |
void | OnDrawOpacity (CDC *pDC, const CRect *window, const CRect *zoom) |
void | OnDrawColor (CDC *pDC, const CRect *window, const CRect *zoom) |
void | GetInterpolatedTextureArray (BYTE tex[]) |
void | AddOrUpdatePoint (int index, CoreColor &color) |
void | AddOrUpdateAlphaPoint (int index, float alpha) |
void | RemovePoint (int index) |
void | RemovePointAlpha (int index) |
void | MovePoint (int index, int newPos) |
void | MovePointAlpha (int index, int newPos, float alphaPos) |
int | IsAlphaPointNearby (int xpos, float ypos, int rangeX, float rangeY) |
int | IsColorPointNearby (int xpos, int range) |
float | GetAlphaPoint (int index) |
CoreColor | GetColorPoint (int index) |
Static Public Attributes | |
static const int | maxDensity = 4095 |
static const int | minDensity = 0 |
Private Member Functions | |
void | InterpolateColor (CoreColor colorArray[]) |
void | InterpolateAlpha (CoreColor colorArray[]) |
void | DrawHistogramm (Gdiplus::Graphics *pCanvas, const CRect *window, const CRect *zoom) |
Private Attributes | |
std::map< int, CoreColor > | m_ControlPoints |
std::map< int, float > | m_ControlPointsAlpha |
TransferFunction::TransferFunction | ( | void | ) |
TransferFunction::~TransferFunction | ( | void | ) |
void TransferFunction::AddOrUpdateAlphaPoint | ( | int | index, | |
float | alpha | |||
) |
void TransferFunction::AddOrUpdatePoint | ( | int | index, | |
CoreColor & | color | |||
) |
void TransferFunction::DrawHistogramm | ( | Gdiplus::Graphics * | pCanvas, | |
const CRect * | window, | |||
const CRect * | zoom | |||
) | [private] |
float TransferFunction::GetAlphaPoint | ( | int | index | ) |
CoreColor TransferFunction::GetColorPoint | ( | int | index | ) |
void TransferFunction::GetInterpolatedTextureArray | ( | BYTE | tex[] | ) |
Fills the BYTE array with the interpolated texture. Array must be already allocated and memory for 4096 * 4 BYTES must be reserved. Format is DXGI_FORMAT_R8G8B8A8_UNORM
void TransferFunction::InterpolateAlpha | ( | CoreColor | colorArray[] | ) | [private] |
void TransferFunction::InterpolateColor | ( | CoreColor | colorArray[] | ) | [private] |
int TransferFunction::IsAlphaPointNearby | ( | int | xpos, | |
float | ypos, | |||
int | rangeX, | |||
float | rangeY | |||
) |
int TransferFunction::IsColorPointNearby | ( | int | xpos, | |
int | range | |||
) |
bool TransferFunction::load | ( | const std::string | file | ) |
void TransferFunction::MovePoint | ( | int | index, | |
int | newPos | |||
) |
void TransferFunction::MovePointAlpha | ( | int | index, | |
int | newPos, | |||
float | alphaPos | |||
) |
void TransferFunction::OnDrawColor | ( | CDC * | pDC, | |
const CRect * | window, | |||
const CRect * | zoom | |||
) |
void TransferFunction::OnDrawOpacity | ( | CDC * | pDC, | |
const CRect * | window, | |||
const CRect * | zoom | |||
) |
void TransferFunction::RemovePoint | ( | int | index | ) |
void TransferFunction::RemovePointAlpha | ( | int | index | ) |
bool TransferFunction::save | ( | const std::string | file | ) |
std::map<int, CoreColor> TransferFunction::m_ControlPoints [private] |
std::map<int, float> TransferFunction::m_ControlPointsAlpha [private] |
const int TransferFunction::maxDensity = 4095 [static] |
const int TransferFunction::minDensity = 0 [static] |