Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. uint16_t t1=0,t2=0,t3=0;
  2. float a,b,c;
  3. uint16_t value=0;
  4. for (int j = 0; j < count; j++) {
  5. t1 = ceil(rgbLeft->r +(floor((rgbRight->r - rgbLeft->r) * j) / (count-1)));
  6. t2 = ceil(rgbLeft->g +(floor((rgbRight->g - rgbLeft->g) * j) / (count-1)));
  7. t3 = ceil(rgbLeft->b + (floor(rgbRight->b - rgbLeft->b) * j) / (count-1));
  8.  
  9. value = (t1 << 11) | (t2 << 5) | (t3);
  10. vec.push_back(value);
  11. }
  12.  
  13. typedef struct{
  14. unsigned int r:5;
  15. unsigned int g:6;
  16. unsigned int b:5;
  17. }RGB;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement