Go to the documentation of this file.
4 #ifndef tools_sg_base_tex
5 #define tools_sg_base_tex
9 #include "../lina/line"
10 #include "../lina/vec3f"
23 virtual void*
cast(
const std::string& a_class)
const {
24 if(
void* p = cmp_cast<base_tex>(
this,a_class))
return p;
83 unsigned int bpp = _img.
bpp();
84 if((bpp!=1)&&(bpp!=3)&&(bpp!=4)) {
85 a_out <<
"tools::sg::tex_rect::update_sg :"
86 <<
" bpp " << bpp <<
" not handled."
117 a_out <<
"tools::sg::tex_rect::update_sg :"
118 <<
" rgb2rgba failed."
125 a_out <<
"tools::sg::tex_rect::update_sg :"
126 <<
" problem with inlib::tex_rect::to_texture."
134 a_out <<
"tools::sg::tex_rect::update_sg :"
135 <<
" problem with inlib::tex_rect::to_texture."
148 unsigned int fac = 2;
150 unsigned int pw = tw/fac;
151 unsigned int ph = th/fac;
153 unsigned int sx = (tw-pw)/2;
154 unsigned int sy = (th-ph)/2;
173 static void dump(std::ostream& a_out,
const std::string& a_cmt,
const img_byte& a_img) {
174 if(a_cmt.size()) a_out << a_cmt << std::endl;
175 a_out <<
" width " << a_img.
width()
176 <<
" height " << a_img.
height()
177 <<
" bpp " << a_img.
bpp()
182 if(a_cmt.size()) a_out << a_cmt << std::endl;
183 unsigned int w = a_img.
width();
184 unsigned int h = a_img.
height();
185 unsigned int n = a_img.
bpp();
186 a_out <<
"img_byte : width " << w <<
" height " << h <<
" bpp " << n << std::endl;
187 byte* pos = (
byte*)a_img.
buffer();
190 for(
unsigned int j=0;j<h;j++) {
191 for(
unsigned int i=0;i<w;i++) {
196 a_out <<
" " << i <<
" " << j
197 <<
" : " << (
unsigned int)r <<
" " << (
unsigned int)g <<
" " << (
unsigned int)b
207 a_tcs[0] = 0;a_tcs[1] = 0;
208 a_tcs[2] = 1;a_tcs[3] = 0;
209 a_tcs[4] = 1;a_tcs[5] = 1;
210 a_tcs[6] = 0;a_tcs[7] = 1;
216 {
unsigned int iw = _img.
width();
217 unsigned int ih = _img.
height();
221 float part = float(iw)/float(rw);
226 float part = float(ih)/float(rh);
231 {
unsigned int num = 12/3;
232 for(
unsigned int index=0;index<num;index++) {
233 a_tcs[2*index] = ax*a_tcs[2*index] +bx;
234 a_tcs[2*index+1] = ay*a_tcs[2*index+1]+by;
#define TOOLS_SCLASS(a_name)