コード例 #1
0
void ac::FlipMirrorAlphaBlend(cv::Mat &frame) {
    cv::Mat copies[2];
    copies[0] = frame.clone();
    copies[1] = frame.clone();
    FlipHorizontal(copies[0]);
    FlipVertical(copies[1]);
    cv::Mat output[2];
    AlphaBlendDouble(copies[0], frame, output[0], 0.5, 0.5);
    AlphaBlendDouble(copies[1], frame, output[1], 0.5, 0.5);
    AlphaBlend(output[0], output[1], frame, 0.5);
    AddInvert(frame);
}
コード例 #2
0
ファイル: Image.cpp プロジェクト: galek/dava.framework
void Image::FlipHorizontal()
{
	switch(format)
	{
	case FORMAT_A8:
		FlipHorizontal((uint8 *)data, width, height);
		break;

	case FORMAT_A16:
	case FORMAT_RGBA5551:
	case FORMAT_RGBA4444:
	case FORMAT_RGB565:
		FlipHorizontal((uint16 *)data, width, height);
		break;

	case FORMAT_RGBA8888:
		FlipHorizontal((uint32 *)data, width, height);
		break;

	default:
		DVASSERT(false && "Not implemented");
		break;
	}
}
コード例 #3
0
ファイル: hdrtexturecube.cpp プロジェクト: UIKit0/hdreffects
void HDRTextureCube::LoadFaces() {
	faces = new Face*[6];
	
	int faceWidth = width / 3;
	int faceHeight = height / 4;
	
	for(int i = 0; i < 6; ++i) {
		faces[i] = new Face();
		faces[i]->data = new float[3 * faceWidth * faceHeight];
		faces[i]->width = faceWidth;
		faces[i]->height = faceHeight;
		faces[i]->currentOffset = 0;
	}
	
	for(int l = 0; l < height; ++l) {
		int jFace = (l - (l % faceHeight)) / faceHeight;
		
		for(int iFace = 0; iFace < 3; ++iFace) {
			Face *face = NULL;			
			int offset = 3 * (faceWidth * iFace + l * width);

			if(iFace == 2 && jFace == 1) face = faces[0]; // POS_Y
			if(iFace == 0 && jFace == 1) face = faces[1]; // NEG_Y
			if(iFace == 1 && jFace == 0) face = faces[2]; // POS_X
			if(iFace == 1 && jFace == 2) face = faces[3]; // NEG_X
			if(iFace == 1 && jFace == 1) face = faces[4]; // POS_Z
			if(iFace == 1 && jFace == 3) face = faces[5]; // NEG_Z
            
			if(face) {
				// the number of components to copy
				int n = sizeof(float) * faceWidth * 3;
				
				memcpy(face->data + face->currentOffset, data + offset, n); 	
				face->currentOffset += (3 * faceWidth);
			}
		}
	}

    // adjust NEG_Z face
    FlipHorizontal(faces[5]); 
    FlipVertical(faces[5]);   
}