Classes | Defines | Functions | Variables
core/vgui/vgui_pixel.cxx File Reference

See vgui_pixel.h for a description of this file. More...

#include "vgui_pixel.h"
#include <vgui/vgui_gl.h>

Go to the source code of this file.

Classes

struct  vgui_pixel_assert< 2, 2 >
struct  vgui_pixel_assert< 3, 3 >
struct  vgui_pixel_assert< 4, 4 >
struct  vgui_pixel_generates_no_code

Defines

#define as(T, sz)   vgui_pixel_assert<sizeof(T), sz> T##_is_##sz
#define SET_FF(x)   x = 0; x = ~x
 Set an int of unknown size to all-bits-one.
#define VGUI_PIXEL_CONVERT_SPAN_DO(S, D, Code)
 This macro is used to generate a "vgui_pixel_convert_span(S*, D*)" function with body "Code".

Functions

 VGUI_PIXEL_CONVERT_SPAN_DO (GLubyte, vgui_pixel_rgb888,{d.R=d.G=d.B=s;})
 VGUI_PIXEL_CONVERT_SPAN_DO (GLubyte, vgui_pixel_bgr888,{d.R=d.G=d.B=s;})
 VGUI_PIXEL_CONVERT_SPAN_DO (GLubyte, vgui_pixel_rgb565,{d.R=d.B=(s >> 3);d.G=(s >> 2);})
 VGUI_PIXEL_CONVERT_SPAN_DO (GLubyte, vgui_pixel_bgra5551,{d.R=d.G=d.B=(s >>3);SET_FF(d.A);})
 VGUI_PIXEL_CONVERT_SPAN_DO (GLubyte, vgui_pixel_rgba8888,{d.R=d.G=d.B=s;SET_FF(d.A);})
 VGUI_PIXEL_CONVERT_SPAN_DO (GLubyte, vgui_pixel_abgr8888,{d.R=d.G=d.B=s;SET_FF(d.A);})
 VGUI_PIXEL_CONVERT_SPAN_DO (GLubyte, vgui_pixel_bgra8888,{d.R=d.G=d.B=s;SET_FF(d.A);})
 VGUI_PIXEL_CONVERT_SPAN_DO (vgui_pixel_rgb888, vgui_pixel_rgb888,{d=s;})
 VGUI_PIXEL_CONVERT_SPAN_DO (float, vgui_pixel_bgra5551,{d.R=d.G=d.B=clamp(s)>>3;SET_FF(d.A);}) VGUI_PIXEL_CONVERT_SPAN_DO(float
 SET_FF (d.A)
 VGUI_PIXEL_CONVERT_SPAN_DO (float, vgui_pixel_abgr8888,{d.R=d.G=d.B=clamp(s);SET_FF(d.A);}) VGUI_PIXEL_CONVERT_SPAN_DO(float

Variables

 vgui_pixel_rgba8888
R = d.G = d.B = clamp(s)
 vgui_pixel_bgra8888

Detailed Description

See vgui_pixel.h for a description of this file.

Author:
fsm

Definition in file vgui_pixel.cxx.


Define Documentation

#define as (   T,
  sz 
)    vgui_pixel_assert<sizeof(T), sz> T##_is_##sz

Definition at line 22 of file vgui_pixel.cxx.

#define SET_FF (   x)    x = 0; x = ~x

Set an int of unknown size to all-bits-one.

Definition at line 41 of file vgui_pixel.cxx.

#define VGUI_PIXEL_CONVERT_SPAN_DO (   S,
  D,
  Code 
)
Value:
void vgui_pixel_convert_span(S const *src, D *dst, unsigned size) { \
    for (unsigned i=0; i<size; ++i) { \
      S const& s = src[i]; \
      D      & d = dst[i]; \
      Code; \
    }\
  }

This macro is used to generate a "vgui_pixel_convert_span(S*, D*)" function with body "Code".

Within Code, s is a reference to the source pixel, d to the destination. Remember, vgui_pixel_convert_span is not a function template -- each overload has rather different code.

Definition at line 56 of file vgui_pixel.cxx.


Function Documentation

SET_FF ( d.  A)
VGUI_PIXEL_CONVERT_SPAN_DO ( GLubyte  ,
vgui_pixel_rgb888   
)
VGUI_PIXEL_CONVERT_SPAN_DO ( GLubyte  ,
vgui_pixel_bgr888   
)
VGUI_PIXEL_CONVERT_SPAN_DO ( GLubyte  ,
vgui_pixel_rgb565   
)
VGUI_PIXEL_CONVERT_SPAN_DO ( GLubyte  ,
vgui_pixel_bgra5551   
)
VGUI_PIXEL_CONVERT_SPAN_DO ( GLubyte  ,
vgui_pixel_rgba8888   
)
VGUI_PIXEL_CONVERT_SPAN_DO ( GLubyte  ,
vgui_pixel_abgr8888   
)
VGUI_PIXEL_CONVERT_SPAN_DO ( GLubyte  ,
vgui_pixel_bgra8888   
)
VGUI_PIXEL_CONVERT_SPAN_DO ( vgui_pixel_rgb888  ,
vgui_pixel_rgb888   
)
VGUI_PIXEL_CONVERT_SPAN_DO ( float  ,
vgui_pixel_bgra5551   
)
VGUI_PIXEL_CONVERT_SPAN_DO ( float  ,
vgui_pixel_abgr8888   
)

Variable Documentation

d R = d.G = d.B = clamp(s)

Definition at line 94 of file vgui_pixel.cxx.

Definition at line 96 of file vgui_pixel.cxx.

Definition at line 94 of file vgui_pixel.cxx.