inline void PremultiplyFilter(D3DCOLOR& filter) { // Premultiply filter int a, r, g, b; float af; a = D3D_A(filter); af = (float)a / 255.0f; r = (float)D3D_R(filter) * af; g = (float)D3D_G(filter) * af; b = (float)D3D_B(filter) * af; filter = D3D_ARGB(a, r, g, b); }
// When the object is inserted to the frame editor by the user. void EditExt::OnPut() { imgTexture = pEditTime->AddImage(100,100); iTexture = -1; pEditTime->EditImage(imgTexture); iTexture = pEditTime->AddImageAsTexture(imgTexture); rgbStr = "255,255,255"; opacity = 255; filter = D3D_ARGB(255,255,255,255); angle = 0; pInfo->objectWidth = 100; pInfo->objectHeight = 100; }
void EditExt::OnPropertiesUpdate() { // Parse string in r,g,b format and save in colorref CString r; CString g; CString b; ExtractSubstring(r, rgbStr, ',', 0); ExtractSubstring(g, rgbStr, ',', 1); ExtractSubstring(b, rgbStr, ',', 2); int red = atoi(r); int green = atoi(g); int blue = atoi(b); filter = D3D_ARGB(opacity, red, green, blue); }