35#ifndef ANA_COLOR_OBJECTPALETTE_H
36#define ANA_COLOR_OBJECTPALETTE_H
39#include <cartodata/volume/volume.h>
40#include <aims/rgb/rgb.h>
41#include <cartobase/object/object.h>
61 unsigned x,
unsigned y,
88 void create(
unsigned dimx,
unsigned dimy = 1,
unsigned dimz = 1,
95 double min(
int dim = 0 )
const {
return dim == 1 ?
min2() :
min1(); }
96 double max(
int dim = 0 )
const {
return dim == 1 ?
max2() :
max1(); }
101 {
_min = x;
if( isnan( x ) || isinf( x ) )
_min = 0; }
103 {
_max = x;
if( isnan( x ) || isinf( x ) )
_max = 0; }
170 unsigned x,
unsigned y,
174 unsigned x,
unsigned y,
178 unsigned x,
unsigned y,
215 double zero1 = 0.5,
double min2 = 0.,
double max2 = 1.,
216 double zero2 = 0.5 )
const;
218 toVolume(
int w = 0,
int h = 0,
bool scaled =
true )
const;
carto::rc_ptr< APalette > _refPal2
int palette1DMapping() const
bool zeroCenteredAxis2() const
int glMaxSizeX() const
Maximum size of the OpenGL palette image, after scaling.
void create(unsigned dimx, unsigned dimy=1, unsigned dimz=1, unsigned dimt=1)
AObjectPalette(const AObjectPalette &x)
void setMaxSize(int maxsizex, int maxsizey)
QImage * toQImage(int w=0, int h=0, double min1=0., double max1=1., double zero1=0.5, double min2=0., double max2=1., double zero2=0.5) const
Get the palette image in a QImage.
void setAbsMax2(const AObject *obj, double x)
set the max from an absolute value for a given object
bool set(const carto::GenericObject &)
double relValue2(const AObject *obj, double absval) const
void setAbsMax(int dim, const AObject *obj, double x)
static AimsRGBA linearMixMethod(const carto::Volume< AimsRGBA > &map1, const carto::Volume< AimsRGBA > *map2, unsigned x, unsigned y, const AObjectPalette &pal)
double absValue1(const AObject *obj, double relval) const
carto::rc_ptr< carto::Volume< AimsRGBA > > toVolume(int w=0, int h=0, bool scaled=true) const
bool zeroCenteredAxis(int dim=0) const
virtual AObjectPalette * clone() const
Palette1DMapping _palette1DMapping
void setAbsMin2(const AObject *obj, double x)
set the min from an absolute value for a given object
void setRefPalette2(carto::rc_ptr< APalette > pal)
void setMax(int dim, double x)
double absMax(int dim, const AObject *obj) const
void setZeroCenteredAxis1(bool x)
static std::map< std::string, MixMethod > mixMethods
bool isTransparent() const
bool zeroCenteredAxis1() const
void setZeroCenteredAxis(int dim, bool x)
double linearMixFactor() const
void setAbsMin1(const AObject *obj, double x)
set the min from an absolute value for a given object
double relValue(int dim, const AObject *obj, double absval) const
virtual ~AObjectPalette()
void setAbsMin(int dim, const AObject *obj, double x)
carto::rc_ptr< APalette > refPalette(int dim=0) const
void setPalette1DMapping(Palette1DMapping palette1DMapping)
std::string palette1DMappingName() const
void copyColors(const AObjectPalette &pal)
if pal colors size is compatible, just copy it
void setRefPalette1(carto::rc_ptr< APalette > pal)
AObjectPalette(carto::rc_ptr< APalette > pal)
static std::map< std::string, MixMethod > defaultMixMethods()
void setPalette1DMappingName(std::string palette1DMappingName)
AimsRGBA normColor(double x, double y=0) const
void setRefPalette(int dim, carto::rc_ptr< APalette > pal)
void setAbsMax1(const AObject *obj, double x)
set the max from an absolute value for a given object
carto::VolumeRef< AimsRGBA > _colors
void glSetMaxSize(int glmaxsizex, int glmaxsizey)
void setLinearMixFactor(double x)
double absMax1(const AObject *obj) const
get the absolute max for a given object
double absMin(int dim, const AObject *obj) const
carto::rc_ptr< APalette > refPalette2() const
static AimsRGBA geometricMixMethod(const carto::Volume< AimsRGBA > &map1, const carto::Volume< AimsRGBA > *map2, unsigned x, unsigned y, const AObjectPalette &pal)
carto::Volume< AimsRGBA > * colors()
int maxSizeX() const
Maximum size of the internal palette image.
void copyOrFillColors(const AObjectPalette &pal)
if pal colors size is compatible, just copy it; otherwise call fill()
carto::Object genericDescription() const
const carto::Volume< AimsRGBA > * colors() const
AimsRGBA normColor(const Point2df &pos) const
double absValue2(const AObject *obj, double relval) const
double relValue1(const AObject *obj, double absval) const
void setMin(int dim, double x)
double max(int dim=0) const
double absMin2(const AObject *obj) const
get the absolute min for a given object
virtual AObjectPalette & operator=(const AObjectPalette &x)
std::string _mixMethodName
double absValue(int dim, const AObject *obj, double relval) const
double absMax2(const AObject *obj) const
get the absolute max for a given object
AimsRGBA(* MixMethod)(const carto::Volume< AimsRGBA > &map1, const carto::Volume< AimsRGBA > *map2, unsigned x, unsigned y, const AObjectPalette &pal)
std::string mixMethodName() const
double min(int dim=0) const
void setMixMethod(const std::string &name)
double absMin1(const AObject *obj) const
get the absolute min for a given object
carto::rc_ptr< APalette > _refPal
void setZeroCenteredAxis2(bool x)
static AimsRGBA palette2DMixMethod(const carto::Volume< AimsRGBA > &map1, const carto::Volume< AimsRGBA > *map2, unsigned x, unsigned y, const AObjectPalette &pal)
void setRefPalette(carto::rc_ptr< APalette > pal)
Base Anatomist object (abstract)
carto::VoxelRGBA AimsRGBA
AimsVector< float, 2 > Point2df