/usr/share/gtk-doc/html/cogl/cogl-Textures.html is in libcogl-doc 1.22.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Textures: Cogl Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Cogl Reference Manual">
<link rel="up" href="ch01.html" title="Cogl - a modern 3D graphics API">
<link rel="prev" href="cogl-Color-Type.html" title="Color Type">
<link rel="next" href="cogl-Blend-Strings.html" title="Material Blend Strings">
<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#cogl-Textures.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="cogl-Color-Type.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="cogl-Blend-Strings.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="cogl-Textures"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cogl-Textures.top_of_page"></a>Textures</span></h2>
<p>Textures — Functions for creating and manipulating textures</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="cogl-Textures.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">CoglTexture</span> *
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-new-with-size" title="cogl_texture_new_with_size ()">cogl_texture_new_with_size</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CoglTexture</span> *
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-new-from-file" title="cogl_texture_new_from_file ()">cogl_texture_new_from_file</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CoglTexture</span> *
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-new-from-data" title="cogl_texture_new_from_data ()">cogl_texture_new_from_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CoglTexture</span> *
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-new-from-foreign" title="cogl_texture_new_from_foreign ()">cogl_texture_new_from_foreign</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CoglTexture</span> *
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-new-from-bitmap" title="cogl_texture_new_from_bitmap ()">cogl_texture_new_from_bitmap</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CoglTexture</span> *
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-new-from-sub-texture" title="cogl_texture_new_from_sub_texture ()">cogl_texture_new_from_sub_texture</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CoglBool</span>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-is-texture" title="cogl_is_texture ()">cogl_is_texture</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">unsigned <span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-get-width" title="cogl_texture_get_width ()">cogl_texture_get_width</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">unsigned <span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-get-height" title="cogl_texture_get_height ()">cogl_texture_get_height</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-get-format" title="cogl_texture_get_format ()">cogl_texture_get_format</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">unsigned <span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-get-rowstride" title="cogl_texture_get_rowstride ()">cogl_texture_get_rowstride</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-get-max-waste" title="cogl_texture_get_max_waste ()">cogl_texture_get_max_waste</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CoglBool</span>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-is-sliced" title="cogl_texture_is_sliced ()">cogl_texture_is_sliced</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CoglBool</span>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-get-gl-texture" title="cogl_texture_get_gl_texture ()">cogl_texture_get_gl_texture</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-get-data" title="cogl_texture_get_data ()">cogl_texture_get_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">CoglBool</span>
</td>
<td class="function_name">
<a class="link" href="cogl-Textures.html#cogl-texture-set-region" title="cogl_texture_set_region ()">cogl_texture_set_region</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="cogl-Textures.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="cogl-Textures.html#CoglTextureVertex" title="struct CoglTextureVertex">CoglTextureVertex</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags">CoglTextureFlags</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="cogl-Textures.description"></a><h2>Description</h2>
<p>Cogl allows creating and manipulating textures using a uniform
API that tries to hide all the various complexities of creating,
loading and manipulating textures.</p>
</div>
<div class="refsect1">
<a name="cogl-Textures.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="cogl-texture-new-with-size"></a><h3>cogl_texture_new_with_size ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglTexture</span> *
cogl_texture_new_with_size (<em class="parameter"><code>unsigned <span class="type">int</span> width</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> height</code></em>,
<em class="parameter"><code><a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags"><span class="type">CoglTextureFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> internal_format</code></em>);</pre>
<div class="warning">
<p><code class="literal">cogl_texture_new_with_size</code> has been deprecated since version 1.18 and should not be used in newly-written code.</p>
<p>Use specific constructors such as
<code class="function">cogl_texture_2d_new_with_size()</code></p>
</div>
<p>Creates a new <span class="type">CoglTexture</span> with the specified dimensions and pixel format.</p>
<div class="refsect3">
<a name="id-1.2.5.6.2.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>width</p></td>
<td class="parameter_description"><p>width of texture in pixels.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>height</p></td>
<td class="parameter_description"><p>height of texture in pixels.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>Optional flags for the texture, or <a class="link" href="cogl-Textures.html#COGL-TEXTURE-NONE:CAPS"><code class="literal">COGL_TEXTURE_NONE</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>internal_format</p></td>
<td class="parameter_description"><p>the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> to use for the GPU storage of the
texture.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.2.8"></a><h4>Returns</h4>
<p> A newly created <span class="type">CoglTexture</span> or <code class="literal">NULL</code> on failure. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-0.8">0.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-new-from-file"></a><h3>cogl_texture_new_from_file ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglTexture</span> *
cogl_texture_new_from_file (<em class="parameter"><code>const <span class="type">char</span> *filename</code></em>,
<em class="parameter"><code><a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags"><span class="type">CoglTextureFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> internal_format</code></em>,
<em class="parameter"><code><span class="type">CoglError</span> **error</code></em>);</pre>
<div class="warning">
<p><code class="literal">cogl_texture_new_from_file</code> has been deprecated since version 1.18 and should not be used in newly-written code.</p>
<p>Use specific constructors such as
<code class="function">cogl_texture_2d_new_from_file()</code></p>
</div>
<p>Creates a <span class="type">CoglTexture</span> from an image file.</p>
<div class="refsect3">
<a name="id-1.2.5.6.3.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description"><p>the file to load</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>Optional flags for the texture, or <a class="link" href="cogl-Textures.html#COGL-TEXTURE-NONE:CAPS"><code class="literal">COGL_TEXTURE_NONE</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>internal_format</p></td>
<td class="parameter_description"><p>the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> to use for the GPU storage of the
texture. If <a class="link" href="cogl-General-API.html#COGL-PIXEL-FORMAT-ANY:CAPS"><code class="literal">COGL_PIXEL_FORMAT_ANY</code></a> is given then a premultiplied
format similar to the format of the source data will be used. The
default blending equations of Cogl expect premultiplied color data;
the main use of passing a non-premultiplied format here is if you
have non-premultiplied source data and are going to adjust the blend
mode (see <a class="link" href="cogl-Materials.html#cogl-material-set-blend" title="cogl_material_set_blend ()"><code class="function">cogl_material_set_blend()</code></a>) or use the data for something
other than straight blending.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>return location for a <span class="type">CoglError</span> or <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.3.8"></a><h4>Returns</h4>
<p> A newly created <span class="type">CoglTexture</span> or
<code class="literal">NULL</code> on failure. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-0.8">0.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-new-from-data"></a><h3>cogl_texture_new_from_data ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglTexture</span> *
cogl_texture_new_from_data (<em class="parameter"><code><span class="type">int</span> width</code></em>,
<em class="parameter"><code><span class="type">int</span> height</code></em>,
<em class="parameter"><code><a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags"><span class="type">CoglTextureFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> format</code></em>,
<em class="parameter"><code><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> internal_format</code></em>,
<em class="parameter"><code><span class="type">int</span> rowstride</code></em>,
<em class="parameter"><code>const <span class="type">uint8_t</span> *data</code></em>);</pre>
<div class="warning">
<p><code class="literal">cogl_texture_new_from_data</code> has been deprecated since version 1.18 and should not be used in newly-written code.</p>
<p>Use specific constructors such as
<code class="function">cogl_texture_2d_new_from_data()</code></p>
</div>
<p>Creates a new <span class="type">CoglTexture</span> based on data residing in memory.</p>
<div class="refsect3">
<a name="id-1.2.5.6.4.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>width</p></td>
<td class="parameter_description"><p>width of texture in pixels</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>height</p></td>
<td class="parameter_description"><p>height of texture in pixels</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>Optional flags for the texture, or <a class="link" href="cogl-Textures.html#COGL-TEXTURE-NONE:CAPS"><code class="literal">COGL_TEXTURE_NONE</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> the buffer is stored in in RAM</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>internal_format</p></td>
<td class="parameter_description"><p>the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> that will be used for storing
the buffer on the GPU. If COGL_PIXEL_FORMAT_ANY is given then a
premultiplied format similar to the format of the source data will
be used. The default blending equations of Cogl expect premultiplied
color data; the main use of passing a non-premultiplied format here
is if you have non-premultiplied source data and are going to adjust
the blend mode (see <a class="link" href="cogl-Materials.html#cogl-material-set-blend" title="cogl_material_set_blend ()"><code class="function">cogl_material_set_blend()</code></a>) or use the data for
something other than straight blending.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rowstride</p></td>
<td class="parameter_description"><p>the memory offset in bytes between the starts of
scanlines in <em class="parameter"><code>data</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>pointer the memory region where the source buffer resides</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.4.8"></a><h4>Returns</h4>
<p> A newly created <span class="type">CoglTexture</span> or
<code class="literal">NULL</code> on failure. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-0.8">0.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-new-from-foreign"></a><h3>cogl_texture_new_from_foreign ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglTexture</span> *
cogl_texture_new_from_foreign (<em class="parameter"><code>unsigned <span class="type">int</span> gl_handle</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> gl_target</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> width</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> height</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> x_pot_waste</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> y_pot_waste</code></em>,
<em class="parameter"><code><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> format</code></em>);</pre>
<div class="warning">
<p><code class="literal">cogl_texture_new_from_foreign</code> has been deprecated since version 1.18 and should not be used in newly-written code.</p>
<p>Use specific constructors such as
<code class="function">cogl_texture_2d_new_from_foreign()</code></p>
</div>
<p>Creates a <span class="type">CoglTexture</span> based on an existing OpenGL texture; the
width, height and format are passed along since it is not always
possible to query these from OpenGL.</p>
<p>The waste arguments allow you to create a Cogl texture that maps to
a region smaller than the real OpenGL texture. For instance if your
hardware only supports power-of-two textures you may load a
non-power-of-two image into a larger power-of-two texture and use
the waste arguments to tell Cogl which region should be mapped to
the texture coordinate range [0:1].</p>
<div class="refsect3">
<a name="id-1.2.5.6.5.8"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>gl_handle</p></td>
<td class="parameter_description"><p>opengl handle of foreign texture.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>gl_target</p></td>
<td class="parameter_description"><p>opengl target type of foreign texture</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>width</p></td>
<td class="parameter_description"><p>width of foreign texture</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>height</p></td>
<td class="parameter_description"><p>height of foreign texture.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>x_pot_waste</p></td>
<td class="parameter_description"><p>horizontal waste on the right hand edge of the texture.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>y_pot_waste</p></td>
<td class="parameter_description"><p>vertical waste on the bottom edge of the texture.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>format of the foreign texture.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.5.9"></a><h4>Returns</h4>
<p> A newly created <span class="type">CoglTexture</span> or
<code class="literal">NULL</code> on failure. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-0.8">0.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-new-from-bitmap"></a><h3>cogl_texture_new_from_bitmap ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglTexture</span> *
cogl_texture_new_from_bitmap (<em class="parameter"><code><a class="link" href="cogl-Bitmaps.html#CoglBitmap" title="CoglBitmap"><span class="type">CoglBitmap</span></a> *bitmap</code></em>,
<em class="parameter"><code><a class="link" href="cogl-Textures.html#CoglTextureFlags" title="enum CoglTextureFlags"><span class="type">CoglTextureFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> internal_format</code></em>);</pre>
<div class="warning">
<p><code class="literal">cogl_texture_new_from_bitmap</code> has been deprecated since version 1.18 and should not be used in newly-written code.</p>
<p>Use specific constructors such as
<code class="function">cogl_texture_2d_new_from_bitmap()</code></p>
</div>
<p>Creates a <span class="type">CoglTexture</span> from a <a class="link" href="cogl-Bitmaps.html#CoglBitmap" title="CoglBitmap"><span class="type">CoglBitmap</span></a>.</p>
<div class="refsect3">
<a name="id-1.2.5.6.6.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>bitmap</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-Bitmaps.html#CoglBitmap" title="CoglBitmap"><span class="type">CoglBitmap</span></a> pointer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>Optional flags for the texture, or <a class="link" href="cogl-Textures.html#COGL-TEXTURE-NONE:CAPS"><code class="literal">COGL_TEXTURE_NONE</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>internal_format</p></td>
<td class="parameter_description"><p>the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> to use for the GPU storage of the
texture</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.6.8"></a><h4>Returns</h4>
<p> A newly created <span class="type">CoglTexture</span> or
<code class="literal">NULL</code> on failure. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix04.html#api-index-1.0">1.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-new-from-sub-texture"></a><h3>cogl_texture_new_from_sub_texture ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglTexture</span> *
cogl_texture_new_from_sub_texture (<em class="parameter"><code><span class="type">CoglTexture</span> *full_texture</code></em>,
<em class="parameter"><code><span class="type">int</span> sub_x</code></em>,
<em class="parameter"><code><span class="type">int</span> sub_y</code></em>,
<em class="parameter"><code><span class="type">int</span> sub_width</code></em>,
<em class="parameter"><code><span class="type">int</span> sub_height</code></em>);</pre>
<div class="warning">
<p><code class="literal">cogl_texture_new_from_sub_texture</code> has been deprecated since version 1.18 and should not be used in newly-written code.</p>
<p>Use <code class="function">cogl_sub_texture_new()</code></p>
</div>
<p>Creates a new texture which represents a subregion of another
texture. The GL resources will be shared so that no new texture
data is actually allocated.</p>
<p>Sub textures have undefined behaviour texture coordinates outside
of the range [0,1] are used. They also do not work with
CoglVertexBuffers.</p>
<p>The sub texture will keep a reference to the full texture so you do
not need to keep one separately if you only want to use the sub
texture.</p>
<div class="refsect3">
<a name="id-1.2.5.6.7.9"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>full_texture</p></td>
<td class="parameter_description"><p>a <span class="type">CoglTexture</span> pointer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>sub_x</p></td>
<td class="parameter_description"><p>X coordinate of the top-left of the subregion</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>sub_y</p></td>
<td class="parameter_description"><p>Y coordinate of the top-left of the subregion</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>sub_width</p></td>
<td class="parameter_description"><p>Width in pixels of the subregion</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>sub_height</p></td>
<td class="parameter_description"><p>Height in pixels of the subregion</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.7.10"></a><h4>Returns</h4>
<p> A newly created <span class="type">CoglTexture</span> or
<code class="literal">NULL</code> on failure. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix05.html#api-index-1.2">1.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-is-texture"></a><h3>cogl_is_texture ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglBool</span>
cogl_is_texture (<em class="parameter"><code><span class="type">void</span> *object</code></em>);</pre>
<p>Gets whether the given object references a texture object.</p>
<div class="refsect3">
<a name="id-1.2.5.6.8.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>object</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-General-API.html#CoglObject" title="CoglObject"><span class="type">CoglObject</span></a> pointer</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.8.6"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the <em class="parameter"><code>object</code></em>
references a texture, and
<code class="literal">FALSE</code> otherwise</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-get-width"></a><h3>cogl_texture_get_width ()</h3>
<pre class="programlisting">unsigned <span class="returnvalue">int</span>
cogl_texture_get_width (<em class="parameter"><code><span class="type">CoglTexture</span> *texture</code></em>);</pre>
<p>Queries the width of a cogl texture.</p>
<div class="refsect3">
<a name="id-1.2.5.6.9.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>texture</p></td>
<td class="parameter_description"><p>a <span class="type">CoglTexture</span> pointer.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.9.6"></a><h4>Returns</h4>
<p> the width of the GPU side texture in pixels</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-get-height"></a><h3>cogl_texture_get_height ()</h3>
<pre class="programlisting">unsigned <span class="returnvalue">int</span>
cogl_texture_get_height (<em class="parameter"><code><span class="type">CoglTexture</span> *texture</code></em>);</pre>
<p>Queries the height of a cogl texture.</p>
<div class="refsect3">
<a name="id-1.2.5.6.10.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>texture</p></td>
<td class="parameter_description"><p>a <span class="type">CoglTexture</span> pointer.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.10.6"></a><h4>Returns</h4>
<p> the height of the GPU side texture in pixels</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-get-format"></a><h3>cogl_texture_get_format ()</h3>
<pre class="programlisting"><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="returnvalue">CoglPixelFormat</span></a>
cogl_texture_get_format (<em class="parameter"><code><span class="type">CoglTexture</span> *texture</code></em>);</pre>
<div class="warning">
<p><code class="literal">cogl_texture_get_format</code> has been deprecated since version 1.18 and should not be used in newly-written code.</p>
<p>This api is misleading</p>
</div>
<p>Queries the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> of a cogl texture.</p>
<div class="refsect3">
<a name="id-1.2.5.6.11.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>texture</p></td>
<td class="parameter_description"><p>a <span class="type">CoglTexture</span> pointer.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.11.7"></a><h4>Returns</h4>
<p> the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> of the GPU side texture</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-get-rowstride"></a><h3>cogl_texture_get_rowstride ()</h3>
<pre class="programlisting">unsigned <span class="returnvalue">int</span>
cogl_texture_get_rowstride (<em class="parameter"><code><span class="type">CoglTexture</span> *texture</code></em>);</pre>
<div class="warning">
<p><code class="literal">cogl_texture_get_rowstride</code> has been deprecated since version 1.10 and should not be used in newly-written code.</p>
<p>There's no replacement for the API but there's
also no known need for API either. It was just
a mistake that it was ever published.</p>
</div>
<p>Determines the bytes-per-pixel for the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> retrieved
from <a class="link" href="cogl-Textures.html#cogl-texture-get-format" title="cogl_texture_get_format ()"><code class="function">cogl_texture_get_format()</code></a> and multiplies that by the texture's
width.</p>
<div class="note">It's very unlikely that anyone would need to use this API to
query the internal rowstride of a <span class="type">CoglTexture</span> which can just be
considered an implementation detail. Actually it's not even useful
internally since underlying drivers are free to use a different
format</div>
<div class="note">This API is only here for backwards compatibility and
shouldn't be used in new code. In particular please don't be
mislead to pass the returned value to <a class="link" href="cogl-Textures.html#cogl-texture-get-data" title="cogl_texture_get_data ()"><code class="function">cogl_texture_get_data()</code></a> for
the rowstride, since you should be passing the rowstride you desire
for your destination buffer not the rowstride of the source
texture.</div>
<div class="refsect3">
<a name="id-1.2.5.6.12.8"></a><h4>Returns</h4>
<p> The bytes-per-pixel for the current format
multiplied by the texture's width</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-get-max-waste"></a><h3>cogl_texture_get_max_waste ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
cogl_texture_get_max_waste (<em class="parameter"><code><span class="type">CoglTexture</span> *texture</code></em>);</pre>
<p>Queries the maximum wasted (unused) pixels in one dimension of a GPU side
texture.</p>
<div class="refsect3">
<a name="id-1.2.5.6.13.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>texture</p></td>
<td class="parameter_description"><p>a <span class="type">CoglTexture</span> pointer.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.13.6"></a><h4>Returns</h4>
<p> the maximum waste</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-is-sliced"></a><h3>cogl_texture_is_sliced ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglBool</span>
cogl_texture_is_sliced (<em class="parameter"><code><span class="type">CoglTexture</span> *texture</code></em>);</pre>
<p>Queries if a texture is sliced (stored as multiple GPU side tecture
objects).</p>
<div class="refsect3">
<a name="id-1.2.5.6.14.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>texture</p></td>
<td class="parameter_description"><p>a <span class="type">CoglTexture</span> pointer.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.14.6"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the texture is sliced, <code class="literal">FALSE</code> if the texture
is stored as a single GPU texture</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-get-gl-texture"></a><h3>cogl_texture_get_gl_texture ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglBool</span>
cogl_texture_get_gl_texture (<em class="parameter"><code><span class="type">CoglTexture</span> *texture</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> *out_gl_handle</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> *out_gl_target</code></em>);</pre>
<p>Queries the GL handles for a GPU side texture through its <span class="type">CoglTexture</span>.</p>
<p>If the texture is spliced the data for the first sub texture will be
queried.</p>
<div class="refsect3">
<a name="id-1.2.5.6.15.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>texture</p></td>
<td class="parameter_description"><p>a <span class="type">CoglTexture</span> pointer.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_gl_handle</p></td>
<td class="parameter_description"><p> pointer to return location for the
textures GL handle, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>out_gl_target</p></td>
<td class="parameter_description"><p> pointer to return location for the
GL target type, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.15.7"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the handle was successfully retrieved, <code class="literal">FALSE</code>
if the handle was invalid</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-get-data"></a><h3>cogl_texture_get_data ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
cogl_texture_get_data (<em class="parameter"><code><span class="type">CoglTexture</span> *texture</code></em>,
<em class="parameter"><code><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> format</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> rowstride</code></em>,
<em class="parameter"><code><span class="type">uint8_t</span> *data</code></em>);</pre>
<p>Copies the pixel data from a cogl texture to system memory.</p>
<div class="note">Don't pass the value of <a class="link" href="cogl-Textures.html#cogl-texture-get-rowstride" title="cogl_texture_get_rowstride ()"><code class="function">cogl_texture_get_rowstride()</code></a> as the
<em class="parameter"><code>rowstride</code></em> argument, the rowstride should be the rowstride you
want for the destination <em class="parameter"><code>data</code></em> buffer not the rowstride of the
source texture</div>
<div class="refsect3">
<a name="id-1.2.5.6.16.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>texture</p></td>
<td class="parameter_description"><p>a <span class="type">CoglTexture</span> pointer.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> to store the texture as.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rowstride</p></td>
<td class="parameter_description"><p>the rowstride of <em class="parameter"><code>data</code></em>
in bytes or pass 0 to calculate
from the bytes-per-pixel of <em class="parameter"><code>format</code></em>
multiplied by the
<em class="parameter"><code>texture</code></em>
width.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>memory location to write the <em class="parameter"><code>texture</code></em>
's contents, or <code class="literal">NULL</code>
to only query the data size through the return value.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.16.7"></a><h4>Returns</h4>
<p> the size of the texture data in bytes</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cogl-texture-set-region"></a><h3>cogl_texture_set_region ()</h3>
<pre class="programlisting"><span class="returnvalue">CoglBool</span>
cogl_texture_set_region (<em class="parameter"><code><span class="type">CoglTexture</span> *texture</code></em>,
<em class="parameter"><code><span class="type">int</span> src_x</code></em>,
<em class="parameter"><code><span class="type">int</span> src_y</code></em>,
<em class="parameter"><code><span class="type">int</span> dst_x</code></em>,
<em class="parameter"><code><span class="type">int</span> dst_y</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> dst_width</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> dst_height</code></em>,
<em class="parameter"><code><span class="type">int</span> width</code></em>,
<em class="parameter"><code><span class="type">int</span> height</code></em>,
<em class="parameter"><code><a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> format</code></em>,
<em class="parameter"><code>unsigned <span class="type">int</span> rowstride</code></em>,
<em class="parameter"><code>const <span class="type">uint8_t</span> *data</code></em>);</pre>
<p>Sets the pixels in a rectangular subregion of <em class="parameter"><code>texture</code></em>
from an in-memory
buffer containing pixel data.</p>
<div class="note">The region set can't be larger than the source <em class="parameter"><code>data</code></em>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.17.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>texture</p></td>
<td class="parameter_description"><p>a <span class="type">CoglTexture</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src_x</p></td>
<td class="parameter_description"><p>upper left coordinate to use from source data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src_y</p></td>
<td class="parameter_description"><p>upper left coordinate to use from source data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dst_x</p></td>
<td class="parameter_description"><p>upper left destination horizontal coordinate.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dst_y</p></td>
<td class="parameter_description"><p>upper left destination vertical coordinate.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dst_width</p></td>
<td class="parameter_description"><p>width of destination region to write. (Must be less
than or equal to <em class="parameter"><code>width</code></em>
)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dst_height</p></td>
<td class="parameter_description"><p>height of destination region to write. (Must be less
than or equal to <em class="parameter"><code>height</code></em>
)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>width</p></td>
<td class="parameter_description"><p>width of source data buffer.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>height</p></td>
<td class="parameter_description"><p>height of source data buffer.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the <a class="link" href="cogl-General-API.html#CoglPixelFormat" title="enum CoglPixelFormat"><span class="type">CoglPixelFormat</span></a> used in the source buffer.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>rowstride</p></td>
<td class="parameter_description"><p>rowstride of source buffer (computed from width if none
specified)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>the actual pixel data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.5.6.17.7"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the subregion upload was successful, and
<code class="literal">FALSE</code> otherwise</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="cogl-Textures.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="CoglTextureVertex"></a><h3>struct CoglTextureVertex</h3>
<pre class="programlisting">struct CoglTextureVertex {
float x, y, z;
float tx, ty;
CoglColor color;
};
</pre>
<p>Used to specify vertex information when calling <a class="link" href="cogl-Primitives.html#cogl-polygon" title="cogl_polygon ()"><code class="function">cogl_polygon()</code></a></p>
<div class="refsect3">
<a name="id-1.2.5.7.2.5"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><span class="type">float</span> <em class="structfield"><code><a name="CoglTextureVertex.x"></a>x</code></em>;</p></td>
<td class="struct_member_description"><p>Model x-coordinate</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">float</span> <em class="structfield"><code><a name="CoglTextureVertex.y"></a>y</code></em>;</p></td>
<td class="struct_member_description"><p>Model y-coordinate</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">float</span> <em class="structfield"><code><a name="CoglTextureVertex.z"></a>z</code></em>;</p></td>
<td class="struct_member_description"><p>Model z-coordinate</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">float</span> <em class="structfield"><code><a name="CoglTextureVertex.tx"></a>tx</code></em>;</p></td>
<td class="struct_member_description"><p>Texture x-coordinate</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">float</span> <em class="structfield"><code><a name="CoglTextureVertex.ty"></a>ty</code></em>;</p></td>
<td class="struct_member_description"><p>Texture y-coordinate</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="cogl-Color-Type.html#CoglColor" title="struct CoglColor"><span class="type">CoglColor</span></a> <em class="structfield"><code><a name="CoglTextureVertex.color"></a>color</code></em>;</p></td>
<td class="struct_member_description"><p>The color to use at this vertex. This is ignored if
use_color is <code class="literal">FALSE</code> when calling <a class="link" href="cogl-Primitives.html#cogl-polygon" title="cogl_polygon ()"><code class="function">cogl_polygon()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="CoglTextureFlags"></a><h3>enum CoglTextureFlags</h3>
<p>Flags to pass to the cogl_texture_new_* family of functions.</p>
<div class="refsect3">
<a name="id-1.2.5.7.3.4"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="COGL-TEXTURE-NONE:CAPS"></a>COGL_TEXTURE_NONE</p></td>
<td class="enum_member_description">
<p>No flags specified</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="COGL-TEXTURE-NO-AUTO-MIPMAP:CAPS"></a>COGL_TEXTURE_NO_AUTO_MIPMAP</p></td>
<td class="enum_member_description">
<p>Disables the automatic generation of
the mipmap pyramid from the base level image whenever it is
updated. The mipmaps are only generated when the texture is
rendered with a mipmap filter so it should be free to leave out
this flag when using other filtering modes</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="COGL-TEXTURE-NO-SLICING:CAPS"></a>COGL_TEXTURE_NO_SLICING</p></td>
<td class="enum_member_description">
<p>Disables the slicing of the texture</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="COGL-TEXTURE-NO-ATLAS:CAPS"></a>COGL_TEXTURE_NO_ATLAS</p></td>
<td class="enum_member_description">
<p>Disables the insertion of the texture inside
the texture atlas used by Cogl</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix04.html#api-index-1.0">1.0</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.24</div>
</body>
</html>
|