ImageAccessorBase< ChannelType, nch > Class Template Reference


Detailed Description

template<class ChannelType, cu_int nch>
class mudbox::ImageAccessorBase< ChannelType, nch >

The ImageAccessorBase class gives you very fast access to pixels when the data type and channel count of an image are known at compile time (and this is very often the case.)

Definition at line 2225 of file image.h.

#include <image.h>

Inheritance diagram for ImageAccessorBase< ChannelType, nch >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  ImageAccessorBase (Image *parent)
u_int  Width () const
u_int  Height () const
u_int  ChannelCount () const
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
  Set value for a specified texel.
float  ValueAt (u_int X, u_int Y, u_int Ch) const
  Get the value at a given coordinate.
void  SetColorAt (u_int X, u_int Y, const Color &cColor)
  Set value for a specified texel.
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void *  AddrAt (u_int X, u_int Y, u_int Ch)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
float  ValueAt (u_int X, u_int Y, u_int Ch) const
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetValueAt (u_int X, u_int Y, u_int Ch, float fVal)
template<>
void  SetColorAt (u_int X, u_int Y, const Color &c)
template<>
void  SetColorAt (u_int X, u_int Y, const Color &c)
template<>
void  SetColorAt (u_int X, u_int Y, const Color &c)
template<>
void  SetColorAt (u_int X, u_int Y, const Color &c)
template<>
void  SetColorAt (u_int X, u_int Y, const Color &c)
template<>
void  SetColorAt (u_int X, u_int Y, const Color &c)
template<>
void  SetColorAt (u_int X, u_int Y, const Color &c)
template<>
void  SetColorAt (u_int X, u_int Y, const Color &c)

Constructor & Destructor Documentation

ImageAccessorBase ( Image parent ) [inline]

Definition at line 2235 of file image.h.

    {
        m_Stride = parent->Width();
        m_Height = parent->Height();
        m_chans  = parent->ChannelCount();
        m_Image  = parent;
        m_pData  = (ChannelType *)parent->Data();
    }

Member Function Documentation

u_int Width ( void  ) const [inline]

Definition at line 2244 of file image.h.

{ return m_Stride; }
u_int Height ( void  ) const [inline]

Definition at line 2245 of file image.h.

{ return m_Height; }
u_int ChannelCount ( void  ) const [inline]

Definition at line 2246 of file image.h.

{ return m_chans;  }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Set value for a specified texel.

For integer maps 1 should be mapped for the maximum value (255 for 8 bit images and 65535 for 16 bit images)

float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Get the value at a given coordinate.

void SetColorAt ( u_int  X,
u_int  Y,
const Color cColor 
) [inline]

Set value for a specified texel.

For integer maps 1 should be mapped for the maximum value (255 for 8 bit images and 65535 for 16 bit images)

void* AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2279 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y)    )]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2282 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 2)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2285 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 3)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2288 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 4)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2292 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y)    )]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2295 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 2)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2298 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 3)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2301 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 4)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2306 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y)    )]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2309 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 2)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2312 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 3)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2315 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 4)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2319 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y)    )]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2322 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 2)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2325 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 3)]; }
void * AddrAt ( u_int  X,
u_int  Y,
u_int  Ch 
) [inline]

Definition at line 2328 of file image.h.

{ return (void *)&m_pData[Ch + ((X + m_Stride * Y) * 4)]; }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2333 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y)    )] = (u_char)(255.0f * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2336 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 2)] = (u_char)(255.0f * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2339 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 3)] = (u_char)(255.0f * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2342 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 4)] = (u_char)(255.0f * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2346 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y)    )] = (u_short)(65535.0f * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2349 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 2)] = (u_short)(65535.0f * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2352 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 3)] = (u_short)(65535.0f * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2355 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 4)] = (u_short)(65535.0f * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2360 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y)    )] = (u_int)(0xffffffff * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2363 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 2)] = (u_int)(0xffffffff * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2366 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 3)] = (u_int)(0xffffffff * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2369 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 4)] = (u_int)(0xffffffff * fVal); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2373 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y)    )] = fVal; }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2376 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 2)] = fVal; }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2379 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 3)] = fVal; }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2382 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 4)] = fVal; }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2386 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y)    )] * (1.0f/255.0f); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2389 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 2)] * (1.0f/255.0f); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2392 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 3)] * (1.0f/255.0f); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2395 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 4)] * (1.0f/255.0f); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2399 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y)    )] * (1.0f/65535.0f); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2402 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 2)] * (1.0f/65535.0f); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2405 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 3)] * (1.0f/65535.0f); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2408 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 4)] * (1.0f/65535.0f); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2412 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y)    )] * (1.0f/float(0xffffffff)); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2415 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 2)] * (1.0f/float(0xffffffff)); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2418 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 3)] * (1.0f/float(0xffffffff)); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2421 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 4)] * (1.0f/float(0xffffffff)); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2425 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y)    )]; }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2428 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 2)]; }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2431 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 3)]; }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2434 of file image.h.

{ return m_pData[Ch + ((X + m_Stride * Y) * 4)]; }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2483 of file image.h.

{ return float(m_pData[Ch + ((X + m_Stride * Y) * 3)]); }
float ValueAt ( u_int  X,
u_int  Y,
u_int  Ch 
) const [inline]

Definition at line 2488 of file image.h.

{ return float(m_pData[Ch + ((X + m_Stride * Y) * 4)]); }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2493 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 3)] = fVal; }
void SetValueAt ( u_int  X,
u_int  Y,
u_int  Ch,
float  fVal 
) [inline]

Definition at line 2498 of file image.h.

{ m_pData[Ch + ((X + m_Stride * Y) * 4)] = fVal; }
void SetColorAt ( u_int  X,
u_int  Y,
const Color c 
) [inline]

Definition at line 2519 of file image.h.

{
    SetValueAt(X, Y, 0, c.r);
    SetValueAt(X, Y, 1, c.g);
    SetValueAt(X, Y, 2, c.b);
    SetValueAt(X, Y, 3, c.a);
};
void SetColorAt ( u_int  X,
u_int  Y,
const Color c 
) [inline]

Definition at line 2529 of file image.h.

{
    SetValueAt(X, Y, 0, c.r);
    SetValueAt(X, Y, 1, c.g);
    SetValueAt(X, Y, 2, c.b);
};
void SetColorAt ( u_int  X,
u_int  Y,
const Color c 
) [inline]

Definition at line 2538 of file image.h.

{
    SetValueAt(X, Y, 0, c.r);
    SetValueAt(X, Y, 1, c.g);
    SetValueAt(X, Y, 2, c.b);
    SetValueAt(X, Y, 3, c.a);
};
void SetColorAt ( u_int  X,
u_int  Y,
const Color c 
) [inline]

Definition at line 2548 of file image.h.

{
    SetValueAt(X, Y, 0, c.r);
    SetValueAt(X, Y, 1, c.g);
    SetValueAt(X, Y, 2, c.b);
};
void SetColorAt ( u_int  X,
u_int  Y,
const Color c 
) [inline]

Definition at line 2557 of file image.h.

{
    SetValueAt(X, Y, 0, c.r);
    SetValueAt(X, Y, 1, c.g);
    SetValueAt(X, Y, 2, c.b);
    SetValueAt(X, Y, 3, c.a);
};
void SetColorAt ( u_int  X,
u_int  Y,
const Color c 
) [inline]

Definition at line 2567 of file image.h.

{
    SetValueAt(X, Y, 0, c.r);
    SetValueAt(X, Y, 1, c.g);
    SetValueAt(X, Y, 2, c.b);
};
void SetColorAt ( u_int  X,
u_int  Y,
const Color c 
) [inline]

Definition at line 2576 of file image.h.

{
    SetValueAt(X, Y, 0, c.r);
    SetValueAt(X, Y, 1, c.g);
    SetValueAt(X, Y, 2, c.b);
    SetValueAt(X, Y, 3, c.a);
};
void SetColorAt ( u_int  X,
u_int  Y,
const Color c 
) [inline]

Definition at line 2586 of file image.h.

{
    SetValueAt(X, Y, 0, c.r);
    SetValueAt(X, Y, 1, c.g);
    SetValueAt(X, Y, 2, c.b);
};

The documentation for this class was generated from the following file: