string ofxRPiCameraVideoGrabber::currentStateToString()
{
    stringstream info;
    info << "sharpness " << getSharpness() << endl;
    info << "contrast " << getContrast() << endl;
    info << "brightness " << getBrightness() << endl;
    info << "saturation " << getSaturation() << endl;

    info << "ISO " << getISO() << endl;
    info << "AutoISO " << getAutoISO() << endl;

    info << "DRE " << getDRE() << endl;
    info << "cropRectangle " << getCropRectangle() << endl;
    info << "zoomLevelNormalized " << getZoomLevelNormalized() << endl;
    info << "mirror " << getMirror() << endl;
    info << "rotation " << getRotation() << endl;
    info << "imageFilter " << getImageFilter() << endl;
    info << "exposurePreset " << getExposurePreset() << endl;
    info << "evCompensation " << getEvCompensation() << endl;
    info << "autoShutter " << getAutoShutter() << endl;
    info << "shutterSpeed " << getShutterSpeed() << endl;
    info << "meteringType " << getMeteringType() << endl;
    info << "SoftwareSaturationEnabled " << isSoftwareSaturationEnabled() << endl;
    info << "SoftwareSharpeningEnabled " << isSoftwareSharpeningEnabled() << endl;

    //OMXCameraSettings
    info << omxCameraSettings.toString() << endl;
    return info.str();
}
Example #2
0
U_CFUNC UChar32
ubidi_getPairedBracket(const UBiDiProps *bdp, UChar32 c) {
    uint16_t props=UTRIE2_GET16(&bdp->trie, c);
    if((props&UBIDI_BPT_MASK)==0) {
        return c;
    } else {
        return getMirror(bdp, c, props);
    }
}
Example #3
0
OVR_PUBLIC_FUNCTION(void) ovr_DestroyMirrorTexture(ovrSession session, ovrTexture* mirrorTexture) {
	ovrMirrorTexture1_3* mirror = getMirror();

	ovr_DestroyMirrorTexture1_3((ovrSession1_3)session, *mirror);

	setMirror(NULL);

	if (mirrorTexture->Header.API == ovrRenderAPI_D3D11) {
		union ovrD3D11Texture* ovrtext = (union ovrD3D11Texture*)mirrorTexture;

		ovrtext->D3D11.pTexture->Release();
	}
}
int main(int argc, char **argv) {
	if (argc != 5) {
		printf("Invalid arguments\n");
		printf("\tprogram height width ix iy\n");
		exit(EXIT_FAILURE);	
	}

	int height = atoi(argv[1]),
		width = atoi(argv[2]);
	float ix = atof(argv[3]), //zoom en x
		  iy = atof(argv[4]); //zoom en y
	int delay = 2;

	struct timeval t0, t1, t;	
	
	int **originalImage = getImage(height, width);	
	assert (gettimeofday (&t0, NULL) == 0);
//	El mirrorImage se cuenta como entrada del procesamiento, asi no contamos el tiempo que se tarda crearlo
	int **mirrorImage   = getMirror(originalImage, height, width, delay);
	int **scaleImage    = getScale(mirrorImage, height, width, delay, ix, iy);
	
	assert (gettimeofday (&t1, NULL) == 0);
	timersub(&t1, &t0, &t);
	
//	printf("Original\n");
//	print_image(originalImage, height, width);

//	printf("Espejo\n");
//	print_image(mirrorImage, height+4, width+4);

//	printf("Resultado\n");
//	print_image(scaleImage, height*iy, width*ix);
	
	printf ("Tiempo      = %ld:%ld(seg:mseg)\n", t.tv_sec, t.tv_usec/1000);

	exit(0);

}
int main(int argc, char **argv) {
//	_MM_ROUND_NEAREST
//	_MM_ROUND_DOWN
//	_MM_ROUND_UP
//	_MM_ROUND_TOWARD_ZERO
//	_MM_SET_ROUNDING_MODE(_MM_ROUND_NEAREST);
	
	if (argc != 5) {
		printf("Invalid arguments\n");
		printf("\tprogram height width ix iy\n");
		exit(EXIT_FAILURE);	
	}

	struct timeval t, t2;
	int height = atoi(argv[1]),
		width = atoi(argv[2]);
	float ix = atof(argv[3]), //zoom en x
		  iy = atof(argv[4]); //zoom en y
	int delay = 2;
	
	short *mirror = NULL; //donde dira el padre que empieza el espejo global
	short *scale = NULL; //donde dira el padre que hay que guardar las cosas
	
	//Las dos siguientes las modifica MPI
	int nprocs, myid;

	MPI_Init(&argc, &argv);//inicializamos mpi
	
	MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
	MPI_Comm_rank(MPI_COMM_WORLD, &myid);

	int aux_rows[nprocs];//Las filas con las que trabajara cada proceso
	int size_send_child[nprocs];//El numero de elementos a enviar a cada hijo
	int aux_split[nprocs];//Es para saber donde empezar a contar (este es para enviar a los hijos)
	int size_send_dad[nprocs]; //para saber el tamano que se le va a enviar al padre
	int aux_begin[nprocs]; //Es el para saber donde empezar a contar (este es para enviar al padre)
	
	//Con esto indicamos que todos saben lo que tienen todos
	fill_aux_rows(aux_rows, nprocs, height, delay);
	fill_size_send_child(size_send_child, nprocs, aux_rows, width, delay);
	fill_aux_split(aux_split, nprocs, size_send_child[0], width, delay);
	fill_size_send_dady(size_send_dad, nprocs, aux_rows, width, ix, iy, delay);
	fill_aux_begin(aux_begin, nprocs, size_send_dad[0]);

	if (myid == 0) {//Parent process
		short *originalImage = malloc(sizeof(short) * height * width); //Imagen original
		mirror = malloc(sizeof(short) * (height+delay*2) * (width+delay*2)); //Imagen en espejo
		if (originalImage == NULL || mirror == NULL) {
			exit_msg("main: cannot allocate memory", myid);	
		}
		
		getImage(originalImage, height, width);
		getMirror(originalImage, mirror, height, width, delay);
		free(originalImage);
		
		gettimeofday(&t, NULL);//Empezamos a contar el tiempo
	}

	short *work = malloc(sizeof(short) * (aux_rows[myid]) * (width+2*delay) ); //con la que trabajara cada proceso
	if (work == NULL)
		exit_msg("main: cannot allocate memory (for work)", myid);

	//Enviamos a los procesos la informacion
	if (0 != MPI_Scatterv(mirror, size_send_child, aux_split, MPI_SHORT,
			work, size_send_child[myid], MPI_SHORT,
			0, MPI_COMM_WORLD))
		exit_msg("main: MPI_Scatterv", myid);

	short *result = malloc(sizeof(short) * ((int) ((aux_rows[myid]-2*delay)*iy)) * (int) (width*ix));
	if (result == NULL)
		exit_msg("main: cannot allocate memory (for result)", myid);

	getScale(work, result, aux_rows[myid]-2*delay, width, delay, ix, iy);


	free(work);
	if (myid == 0) {
		free(mirror);
		scale  = malloc(sizeof(short) * ((int) (height*iy)) * ((int) (width*ix))); // donde se guardara el resultado final
	}

	//Los procesos envian la informacion al padre
	if (0 != MPI_Gatherv(result, size_send_dad[myid], MPI_SHORT,
 				scale, size_send_dad, aux_begin,
 				MPI_SHORT, 0, MPI_COMM_WORLD))
		exit_msg("main: MPI_Gatherv", myid);
	
	if (myid == 0) {
		gettimeofday(&t2, NULL);

		struct timeval diff;
		diff_time(&diff, &t2, &t);
		print_image(scale, height*iy, width*ix);
		printf("Tiempo      = %ld:%ld(seg:mseg)\n\n", diff.tv_sec, diff.tv_usec/1000 );
	}

	MPI_Finalize(); //Clean UP for MPI

	exit(EXIT_SUCCESS);

}
Example #6
0
U_CFUNC UChar32
ubidi_getMirror(const UBiDiProps *bdp, UChar32 c) {
    uint16_t props=UTRIE2_GET16(&bdp->trie, c);
    return getMirror(bdp, c, props);
}