Changeset 38489
- Timestamp:
- 09/03/16 09:31:41 (6 years ago)
- Location:
- titan/titan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/header.h
r38487 r38489 734 734 int convertxmlentry(char *value, uint8_t *proz); 735 735 unsigned char* savejpg(char* filename, int width, int height, int channels, int newwidth, int newheight, int quality, unsigned char *buf); 736 externinline void drawpixelfastfb(struct fb* node, int posx, int posy, unsigned long color);737 externinline void drawpixelfb(struct fb* node, int posx, int posy, unsigned long color);736 inline void drawpixelfastfb(struct fb* node, int posx, int posy, unsigned long color); 737 inline void drawpixelfb(struct fb* node, int posx, int posy, unsigned long color); 738 738 unsigned char * resize(unsigned char *origin, int ox, int oy, int dx, int dy, int type, unsigned char * dst, int flag); 739 739 -
titan/titan/skin.h
r38437 r38489 77 77 return &getoledchannelresolution576; 78 78 } 79 79 80 80 if(ostrcmp("getoledchannelresolution720", value) == 0) 81 81 { … … 83 83 return &getoledchannelresolution720; 84 84 } 85 85 86 86 if(ostrcmp("getoledchannelresolution1080", value) == 0) 87 87 { … … 95 95 return &getoledhd; 96 96 } 97 97 98 98 if(ostrcmp("getoleddolby", value) == 0) 99 99 { … … 175 175 if(ostrcmp("getreccount", value) == 0) 176 176 return &getreccount; 177 177 178 178 if(ostrcmp("getrec", value) == 0) 179 179 { … … 583 583 { 584 584 char* tmpstr = NULL; 585 585 586 586 if(picname == NULL || picname[0] == '\0') return NULL; 587 587 … … 634 634 newnode->titlebgcol = -1; 635 635 newnode->deaktivcol = -1; 636 636 637 637 newnode->nodestyle = 0; 638 638 … … 947 947 { 948 948 if(getconfig("oledskin_path", NULL) != NULL) 949 { 949 { 950 950 newnode->pic = ostrcat(getconfig("oledskin_path", NULL),"/", 0, 0); 951 951 newnode->pic = ostrcat(newnode->pic, ret, 1, 0); … … 967 967 968 968 if(getpic(newnode->pic) == NULL && newnode->pic != NULL) 969 { 969 { 970 970 length = strlen(newnode->pic); 971 971 if(newnode->pic[length - 1] == 'g' && newnode->pic[length - 2] == 'n' && newnode->pic[length - 3] == 'p') … … 1146 1146 1147 1147 buf = readfiletomem(filename, 1); 1148 1148 1149 1149 /* 1150 1150 if(debug_level == 9999) … … 1162 1162 free(buf); 1163 1163 } 1164 1164 1165 1165 return 0; 1166 1166 } … … 1233 1233 free(node->font); 1234 1234 node->font = NULL; 1235 1235 1236 1236 free(node->selectpic); 1237 1237 node->selectpic = NULL; … … 1469 1469 } 1470 1470 1471 inline void drawpixelfastfb(struct fb* node, int posx, int posy, unsigned long color)1471 extern inline void drawpixelfastfb(struct fb* node, int posx, int posy, unsigned long color) 1472 1472 { 1473 1473 node->fblong[posy + posx] = color; 1474 1474 } 1475 1475 1476 inline void drawpixelfb(struct fb* node, int posx, int posy, unsigned long color)1476 extern inline void drawpixelfb(struct fb* node, int posx, int posy, unsigned long color) 1477 1477 { 1478 1478 node->fblong[(node->width * posy) + posx] = color; … … 1591 1591 1592 1592 jpeg_start_decompress(ciptr); 1593 1593 1594 1594 *width = ciptr->output_width; 1595 1595 *height = ciptr->output_height; 1596 1596 *channels = ciptr->output_components; 1597 *rowbytes = ciptr->output_width * ciptr->output_components; 1597 *rowbytes = ciptr->output_width * ciptr->output_components; 1598 1598 1599 1599 if(ciptr->output_components == 3) … … 1694 1694 } 1695 1695 else 1696 row_stride = width * colbytes; 1696 row_stride = width * colbytes; 1697 1697 1698 1698 if(accelfb != NULL && accelfb->varfbsize > width8 && (scalewidth != 0 || scaleheight != 0) && (scalewidth != width || scaleheight != height)) … … 1706 1706 else if(valign == BOTTOM) 1707 1707 posy += mheight - scaleheight; 1708 1708 1709 1709 int nposy = posy; 1710 1710 py = -1; … … 1816 1816 else if(valign == BOTTOM) 1817 1817 posy += mheight - scaleheight; 1818 1818 1819 1819 int i = 0; 1820 1820 int location = 0; 1821 tmpbuf = (unsigned char*)malloc(width*height*3); 1821 tmpbuf = (unsigned char*)malloc(width*height*3); 1822 1822 aktline = cinfo->output_scanline; 1823 1823 while(aktline < height) … … 1825 1825 jpeg_read_scanlines(cinfo, buffer, 1); 1826 1826 aktline = cinfo->output_scanline; 1827 for(i=0; i<width*3; i++) 1827 for(i=0; i<width*3; i++) 1828 1828 tmpbuf[location++] = buffer[0][i]; 1829 1829 } … … 1831 1831 if(getconfigint("extended_scale", NULL) == 1 || getconfigint("extendet_scale", NULL) == 1) 1832 1832 scalebuf = resize(tmpbuf, width, height, scalewidth, scaleheight, 2, NULL, 1); 1833 else 1833 else 1834 1834 scalebuf = resize(tmpbuf, width, height, scalewidth, scaleheight, 1, NULL, 1); 1835 1835 1836 1836 aktline = 0; 1837 1837 while(aktline < scaleheight) … … 1852 1852 else 1853 1853 color = (255 << 24) | (red << 16) | (red << 8) | red; 1854 1854 1855 1855 drawpixelfast(posx + x, py, color); 1856 1856 } … … 1858 1858 } 1859 1859 free(scalebuf); 1860 } 1860 } 1861 1861 else 1862 1862 { … … 1883 1883 else 1884 1884 aktline++; 1885 1885 1886 1886 aktline1 = (aktline - 1) * row_stride; 1887 1887 … … 2064 2064 free(sig); 2065 2065 fclose(fd); 2066 return NULL; 2066 return NULL; 2067 2067 } 2068 2068 … … 2193 2193 else if(scalewidth == 2 && scaleheight == 2) 2194 2194 calcautoscale(width, height, mwidth, mheight - 25, &scalewidth, &scaleheight); 2195 2195 2196 2196 if(scalewidth == 0) scalewidth = width; 2197 2197 if(scaleheight == 0) scaleheight = height; … … 2278 2278 else 2279 2279 { 2280 ralpha = 255 - src[3]; 2280 ralpha = 255 - src[3]; 2281 2281 alpha_composite(r, src[0], src[3], ralpha, (skinfb->fblong[x] & 0xff0000) >> 16); 2282 2282 alpha_composite(g, src[1], src[3], ralpha, (skinfb->fblong[x] & 0x00ff00) >> 8); … … 2492 2492 min = 100; 2493 2493 } 2494 2494 2495 2495 red = (color & 0xff0000) >> 16; 2496 2496 green = (color & 0x00ff00) >> 8; … … 2500 2500 posy = posy + height - sbit->top; 2501 2501 posx = posx + sbit->left + kerning.x; 2502 2502 2503 2503 py = (posy * skinfb->width) + posx; 2504 2504 pyh = py + (sbit->height * skinfb->width); 2505 2505 src = sbit->buffer; 2506 2506 2507 2507 for(y = py; y < pyh; y += skinfb->width) 2508 2508 { … … 2517 2517 else 2518 2518 { 2519 ralpha = 255 - src[0]; 2519 ralpha = 255 - src[0]; 2520 2520 alpha_composite(r, red, src[0], ralpha, (skinfb->fblong[x] & 0xff0000) >> 16); 2521 2521 alpha_composite(g, green, src[0], ralpha, (skinfb->fblong[x] & 0x00ff00) >> 8); … … 2637 2637 2638 2638 if(posx > mwidth && tmpstr > origstr) 2639 { 2639 { 2640 2640 tmpstr--; 2641 2641 *tmpstr = '\n'; … … 2661 2661 2662 2662 if(string == NULL || color == -1) return 1; 2663 2663 2664 2664 if(flag == 1) 2665 2665 { 2666 2666 string = mask(NULL, strlen(string), "*"); 2667 2667 tmpstr = string; 2668 } 2668 } 2669 2669 2670 2670 if(flag == 2) 2671 2671 { 2672 2672 color = convertcol(string); 2673 } 2673 } 2674 2674 2675 2675 transparent = (transparent - 255) * -1; … … 2748 2748 if(lastposx != NULL) *lastposx = posx; 2749 2749 if(lastposy != NULL) *lastposy = posy + fontsize; 2750 2750 2751 2751 if(flag == 1) free(tmpstr); 2752 2752 return ret; … … 2964 2964 b3 = (b1 * p + b2 * i) / steps; 2965 2965 col = (transparent << 24) | (r3 << 16) | (g3 << 8) | b3; 2966 2966 2967 2967 r = 0; 2968 2968 for(y = posy; y < yend; y += skinfb->width) … … 2984 2984 xend = posx + xstep; 2985 2985 } 2986 else 2986 else 2987 2987 { 2988 2988 tmp = ystep * skinfb->width; … … 3002 3002 b3 = (b2 * p + b1 * i) / steps; 3003 3003 col = (transparent << 24) | (r3 << 16) | (g3 << 8) | b3; 3004 3004 3005 3005 r = 0; 3006 3006 for(y = posy; y < yend; y += skinfb->width) … … 3015 3015 memcpy(skinfb->fb + (y + posx) * skinfb->colbytes, skinfb->fb + (posy + posx) * skinfb->colbytes, (xend - posx) * skinfb->colbytes); 3016 3016 } 3017 3017 3018 3018 if(flag == LEFTMIDDLE) 3019 3019 { … … 3022 3022 xend = posx + xstep; 3023 3023 } 3024 else 3024 else 3025 3025 { 3026 3026 tmp = ystep * skinfb->width; … … 3113 3113 while(epgrecord != NULL) 3114 3114 { 3115 3115 3116 3116 if(epgrecord->posx > 100) epgrecord->posx = 100; 3117 3117 val1 = (((node->iwidth * 100) / 100) * epgrecord->posx) / 100; … … 3263 3263 int len = 0; 3264 3264 char* bglt = NULL, *bglb = NULL, *bgrt = NULL, *bgrb = NULL; 3265 3265 3266 3266 node->flag = setbit(node->flag, 0); 3267 3267 … … 3507 3507 child = child->next; 3508 3508 continue; 3509 } 3509 } 3510 3510 3511 3511 calcrheight(child, node); … … 3559 3559 node->aktline = node->linecount; 3560 3560 } 3561 3561 3562 3562 if(found != NULL) 3563 3563 { … … 3777 3777 if(node->child != NULL && status.picbordersize > 0) 3778 3778 node->bordersize = status.picbordersize; 3779 3779 3780 3780 if(node->nodestyle != 0) 3781 3781 { … … 3787 3787 setblink(node); 3788 3788 } 3789 3789 3790 3790 if(node->skinfunc != NULL) 3791 3791 { … … 3799 3799 tmpstr = node->skinfunc(node, node->param1, node->param2); 3800 3800 if(tmpstr != NULL) 3801 changepic(node, tmpstr); 3801 changepic(node, tmpstr); 3802 3802 } 3803 3803 else if(node->funcrettype == FUNCPROGRESS) … … 3990 3990 int i, ret = 0; 3991 3991 int tmp = sizeof(status.drawallways) / sizeof(skin); 3992 3992 3993 3993 m_lock(&status.oledmutex, 25); 3994 3994 for(i = 0; i < tmp; i++) … … 4006 4006 } 4007 4007 m_unlock(&status.oledmutex, 25); 4008 4008 4009 4009 return ret; 4010 4010 } … … 4083 4083 m_lock(&status.oledmutex, 25); 4084 4084 if(lcdskinfb == NULL) { 4085 #ifndef MIPSEL 4085 #ifndef MIPSEL 4086 4086 if(node->name != NULL && ostrstr(node->name, "LCD_spf87") != NULL) { 4087 4087 unsigned char *newskinfb = calloc(1, 4 * 800 * 480); … … 4172 4172 lcdskinfb = addfb("lcdskinfb", 999, 320, 240, 4, -1, newskinfb, 4 * 320 * 240, 0); 4173 4173 } 4174 #else 4175 if(node->name != NULL && ostrstr(node->name, "LCD_spf87") != NULL) 4174 #else 4175 if(node->name != NULL && ostrstr(node->name, "LCD_spf87") != NULL) 4176 4176 lcdskinfb = oledaddfb(800, 480); 4177 else if(node->name != NULL && ostrstr(node->name, "LCD_spf72") != NULL) 4177 else if(node->name != NULL && ostrstr(node->name, "LCD_spf72") != NULL) 4178 4178 lcdskinfb = oledaddfb(800, 480); 4179 else if(node->name != NULL && ostrstr(node->name, "LCD_spf83") != NULL) 4179 else if(node->name != NULL && ostrstr(node->name, "LCD_spf83") != NULL) 4180 4180 lcdskinfb = oledaddfb(800, 600); 4181 else if(node->name != NULL && ostrstr(node->name, "LCD_spf85") != NULL) 4181 else if(node->name != NULL && ostrstr(node->name, "LCD_spf85") != NULL) 4182 4182 lcdskinfb = oledaddfb(800, 600); 4183 else if(node->name != NULL && ostrstr(node->name, "LCD_spf75") != NULL) 4183 else if(node->name != NULL && ostrstr(node->name, "LCD_spf75") != NULL) 4184 4184 lcdskinfb = oledaddfb(800, 480); 4185 else if(node->name != NULL && ostrstr(node->name, "LCD_spf107") != NULL) 4185 else if(node->name != NULL && ostrstr(node->name, "LCD_spf107") != NULL) 4186 4186 lcdskinfb = oledaddfb(1024, 600); 4187 else if(node->name != NULL && ostrstr(node->name, "LCD_spf105") != NULL) 4187 else if(node->name != NULL && ostrstr(node->name, "LCD_spf105") != NULL) 4188 4188 lcdskinfb = oledaddfb(1024, 600); 4189 4189 else … … 4261 4261 if(screencalc == 0) 4262 4262 { 4263 if(merkskinfb != NULL) 4264 { 4265 if(node->name != NULL && ostrstr(node->name, "LCD_spf") != NULL) 4263 if(merkskinfb != NULL) 4264 { 4265 if(node->name != NULL && ostrstr(node->name, "LCD_spf") != NULL) 4266 4266 write_FB_to_JPEG_file(skinfb->fb, skinfb->width, skinfb->height, "/tmp/titanlcd.jpg", 75); 4267 4267 else if(node->name != NULL && ostrstr(node->name, "OLED_") != NULL) 4268 4268 write2oled(skinfb->fb, skinfb->width, skinfb->height); 4269 else 4269 else 4270 4270 pngforlcd(skinfb->fb, skinfb->width, skinfb->height); 4271 4271 } 4272 else 4272 else 4273 4273 { 4274 4274 status.drawscreencount++; … … 4298 4298 { 4299 4299 debug(100, "free lcdskinfb"); 4300 free(skinfb->fb); skinfb->fb = NULL; 4300 free(skinfb->fb); skinfb->fb = NULL; 4301 4301 skinfb = merkskinfb; 4302 4302 merkskinfb = NULL; … … 4643 4643 unsigned char * cr; 4644 4644 4645 if(dst == NULL) 4645 if(dst == NULL) 4646 4646 { 4647 4647 cr = (unsigned char*) malloc(dx*dy*3); … … 4652 4652 return(origin); 4653 4653 } 4654 } 4654 } 4655 4655 else 4656 4656 cr = dst; 4657 4657 4658 if(type == 1) 4658 if(type == 1) 4659 4659 { 4660 4660 unsigned char *p,*l; … … 4671 4671 } 4672 4672 } 4673 } 4674 else 4673 } 4674 else 4675 4675 { 4676 4676 unsigned char *p,*q; … … 4684 4684 xa_v[i] = i*ox/dx; 4685 4685 int xb_v[dx+1]; 4686 4686 4687 4687 for(i=0;i<dx;i++) 4688 4688 { … … 4691 4691 xb_v[i]=ox-1; 4692 4692 } 4693 4693 4694 4694 for(j=0;j<dy;j++) 4695 4695 { … … 4710 4710 } 4711 4711 } 4712 4712 4713 4713 if(flag == 1) 4714 4714 free(origin); 4715 4715 4716 4716 return(cr); 4717 4717 }
Note: See TracChangeset
for help on using the changeset viewer.