Lines Matching refs:to
107 static void CreateColorMapTexture ( MyTextureObj* to, MyColorMapObj* cmo );
108 static void CreateSampleImgTexture ( MyTextureObj* to, MyColorMapObj* cmo );
112 static void PlotOnTexture ( MyTextureObj* to, u32 x, u32 y, u32 val );
526 static void CreateColorMapTexture(MyTextureObj* to, MyColorMapObj* cmo) in CreateColorMapTexture() argument
533 to->width = to->height = 1; in CreateColorMapTexture()
536 to->width *= 2; in CreateColorMapTexture()
537 if ( to->width * to->height >= ciSize ) in CreateColorMapTexture()
540 to->height *= 2; in CreateColorMapTexture()
541 if ( to->width * to->height >= ciSize ) in CreateColorMapTexture()
546 to->format = ( ciSize <= 16 ) ? GX_TF_C4 in CreateColorMapTexture()
551 if ( to->data != NULL ) in CreateColorMapTexture()
553 MEMFreeToAllocator(&DemoAllocator1, to->data); in CreateColorMapTexture()
556 to->width, in CreateColorMapTexture()
557 to->height, in CreateColorMapTexture()
558 to->format, in CreateColorMapTexture()
561 to->data = MEMAllocFromAllocator(&DemoAllocator1, bufferSize); in CreateColorMapTexture()
565 for ( ih = 0 ; ih < to->height ; ++ih ) in CreateColorMapTexture()
567 for ( iw = 0 ; iw < to->width ; ++iw ) in CreateColorMapTexture()
569 PlotOnTexture(to, iw, ih, ic); in CreateColorMapTexture()
576 &to->tobj, in CreateColorMapTexture()
577 to->data, in CreateColorMapTexture()
578 to->width, in CreateColorMapTexture()
579 to->height, in CreateColorMapTexture()
580 to->format, in CreateColorMapTexture()
586 &to->tobj, in CreateColorMapTexture()
597 DCFlushRange(to->data, bufferSize); in CreateColorMapTexture()
613 static void CreateSampleImgTexture(MyTextureObj* to, MyColorMapObj* cmo) in CreateSampleImgTexture() argument
622 to->width = SAMPLE_IMG_WIDTH; in CreateSampleImgTexture()
623 to->height = SAMPLE_IMG_HEIGHT; in CreateSampleImgTexture()
627 to->format = ( ciSize <= 16 ) ? GX_TF_C4 in CreateSampleImgTexture()
632 if ( to->data != NULL ) in CreateSampleImgTexture()
634 MEMFreeToAllocator(&DemoAllocator1, to->data); in CreateSampleImgTexture()
637 to->width, in CreateSampleImgTexture()
638 to->height, in CreateSampleImgTexture()
639 to->format, in CreateSampleImgTexture()
642 to->data = MEMAllocFromAllocator(&DemoAllocator1, bufferSize); in CreateSampleImgTexture()
646 for ( ih = 0 ; ih < to->height ; ++ih ) in CreateSampleImgTexture()
648 for ( iw = 0 ; iw < to->width ; ++iw ) in CreateSampleImgTexture()
699 PlotOnTexture( to, iw, ih, ic ); in CreateSampleImgTexture()
705 &to->tobj, in CreateSampleImgTexture()
706 to->data, in CreateSampleImgTexture()
707 to->width, in CreateSampleImgTexture()
708 to->height, in CreateSampleImgTexture()
709 to->format, in CreateSampleImgTexture()
715 &to->tobj, in CreateSampleImgTexture()
726 DCFlushRange(to->data, bufferSize); in CreateSampleImgTexture()
932 static void PlotOnTexture(MyTextureObj* to, u32 x, u32 y, u32 val) in PlotOnTexture() argument
936 if ( x >= to->width || y >= to->height ) in PlotOnTexture()
941 switch(to->format) in PlotOnTexture()
947 aw = ( to->width + 7 ) / 8u; in PlotOnTexture()
956 u8 m = (u8)( *(to->data + offset) & 0x0F ); in PlotOnTexture()
957 *(to->data + offset) = (u8)( m | ( d * 0x10) ); in PlotOnTexture()
961 u8 m = (u8)( *(to->data + offset) & 0xF0 ); in PlotOnTexture()
962 *(to->data + offset) = (u8)( m | d ); in PlotOnTexture()
970 aw = ( to->width + 7 ) / 8u; in PlotOnTexture()
976 *(to->data + offset) = d; in PlotOnTexture()
982 aw = ( to->width + 3 ) / 4u; in PlotOnTexture()
988 *(u16*)(to->data + offset) = d; in PlotOnTexture()