Segoe UI Image video decoding Fonts text analysis

  • Slides: 58
Download presentation

Segoe UI Image & video decoding Fonts, text analysis, layout 2 D graphics 3

Segoe UI Image & video decoding Fonts, text analysis, layout 2 D graphics 3 D graphics GPGPU Too

Segoe UI HTML 5, CSS 3 & Direct. Write HTML 5, Direct 2 D

Segoe UI HTML 5, CSS 3 & Direct. Write HTML 5, Direct 2 D effects, WIC & Media Foundation HTML 5, CSS 3 & Direct 2 D Direct. Compute & C++AMP Direct 3 D

Javascript // get the canvas and the 2 D context for it var canvas.

Javascript // get the canvas and the 2 D context for it var canvas. Element = document. get. Element. By. Id("my. Canvas"); var context = canvas. Element. get. Context("2 d"); // set the font and size context. font = "20 px Georgia"; // clear an area and render hello world at position (10, 50) context. clear. Rect(0. 0. 300, 150); context. fill. Text("Hello World!", 10, 50); HTML // define the canvas size with the tag in the HTML doc <canvas id="my. Canvas" width ="720" height ="486"></canvas>

XAML // Set rendering location and text style <Stack. Panel Grid. Row="1" Margin="120, 30,

XAML // Set rendering location and text style <Stack. Panel Grid. Row="1" Margin="120, 30, 0, 0"> <Text. Block x: Name="greeting. Output" Style="{Static. Resource Shy. Text. Style}"/> </Stack. Panel> C# // Set text private void Your. Function(object sender, Windows. UI. Xaml. Routed. Event. Args e) { greeting. Output. Text = "Hello World!"; }

void // Create the text string Hello World! // Create a Direct. Write Text

void // Create the text string Hello World! // Create a Direct. Write Text Layout object // Text to be displayed // Length of the text // Direct. Write Text Format object // Width of the Text Layout // Height of the Text Layout

void // Clear the buffer and set up m_d 2 d. Context->Begin. Draw(); m_d

void // Clear the buffer and set up m_d 2 d. Context->Begin. Draw(); m_d 2 d. Context->Clear(D 2 D 1: : Color. F: : Cornflower. Blue)); m_d 2 d. Context->Set. Transform(D 2 D 1: : Matrix 3 x 2 F: : Identity()); // Update text position and style m_d 2 d. Context->Draw. Text. Layout( D 2 D 1: : Point 2 F(0. 0 f, 0. 0 f), m_text. Layout. Get(), m_black. Brush. Get() ); m_d 2 d. Context->End. Draw(); }

D s ’ e r e h W c ri e ? ? t.

D s ’ e r e h W c ri e ? ? t. X

Migrating a web app using Java. Script and HTML

Migrating a web app using Java. Script and HTML

//The incoming vertex' position attribute vec 4 position; //And its color attribute vec 3

//The incoming vertex' position attribute vec 4 position; //And its color attribute vec 3 color; //The varying statement tells the shader pipeline that this variable //has to be passed on to the next stage (to the fragment shader) varying vec 3 color. Varying; //The shader entry point is the main method void main() { color. Varying = color; //Pass the color to the fragment shader gl_Position = position; //Copy the position }

// Define the vertex and pixel shader structs struct Vertex. Shader. Input { float

// Define the vertex and pixel shader structs struct Vertex. Shader. Input { float 3 pos : POSITION; float 4 color : COLOR; }; struct Pixel. Shader. Input { float 4 pos : SV_POSITION; float 4 color : COLOR; }; // Pass position and color values from Vert struct to Pixel struct (adding W and Alpha) Pixel. Shader. Input Simple. Vertex. Shader(Vertex. Shader. Input input) { Pixel. Shader. Input vertex. Shader. Output; vertex. Shader. Output. pos = float 4(input. pos, 1. 0 f); vertex. Shader. Output. color = float 4(input. color, 1. 0 f); return vertex. Shader. Output; }

varying vec 3 color. Varying; void main() { //Create a vec 4 from the

varying vec 3 color. Varying; void main() { //Create a vec 4 from the vec 3 by padding a 1. 0 for alpha //and assign that color to be this fragment's color gl_Frag. Color = vec 4(color. Varying, 1. 0); }

// Collect input from vertex shader struct Pixel. Shader. Input { float 4 pos

// Collect input from vertex shader struct Pixel. Shader. Input { float 4 pos : SV_POSITION; float 4 color : COLOR; }; // Set the pixel color value for the specified Renter Target float 4 Simple. Pixel. Shader(Pixel. Shader. Input input) : SV_TARGET { return input. color; }

// Bind shaders to pipeline (both VS and FS are in a program) gl.

// Bind shaders to pipeline (both VS and FS are in a program) gl. Use. Program(m_shader->get. Program()); // (Input Assembly) Get attachment point for position and color attributes m_position. Location = gl. Get. Attrib. Location(m_shader->get. Program(), "position“); gl. Enable. Vertex. Attrib. Array(m_position. Location); m_color. Location = gl. Get. Attrib. Color(m_shader->get. Program(), “color“); gl. Enable. Vertex. Attrib. Array(m_color. Location); // Bind the vertex buffer object gl. Bind. Buffer(GL_ARRAY_BUFFER, m_geometry. Buffer); gl. Vertex. Attrib. Pointer(m_position. Location, 4, GL_FLOAT, GL_FALSE, 0, NULL); gl. Bind. Buffer(GL_ARRAY_BUFFER, m_color. Buffer); gl. Vertex. Attrib. Pointer(m_color. Location, 3, GL_FLOAT, GL_FALSE, 0, NULL); // Draw a triangle of 3 vertices! gl. Draw. Array(GL_TRIANGLES, 0, 3);

// Binding Shaders to pipeline (VS and PS) m_d 3 d. Device. Context->VSSet. Shader(vertex.

// Binding Shaders to pipeline (VS and PS) m_d 3 d. Device. Context->VSSet. Shader(vertex. Shader. Get(), nullptr, 0); m_d 3 d. Device. Context->PSSet. Shader(pixel. Shader. Get(), nullptr, 0); // Declaring the expected inputs to the shaders m_d 3 d. Device. Context->IASet. Input. Layout(input. Layout. Get()); m_d 3 d. Device. Context->IASet. Vertex. Buffers(0, 1, vertex. Buffer. Get. Address. Of(), &stride, &offset); // Set primitive’s topology m_d 3 d. Device. Context->IASet. Primitive. Topology(D 3 D 11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); // Draw a triangle of 3 vertices! m_d 3 d. Device. Context->Draw(ARRAYSIZE(triangle. Vertices), 0);

Oceanhouse Media book titles Dr. Seuss Collection Little Critter Collection Smithsonian 5 Little Monkeys

Oceanhouse Media book titles Dr. Seuss Collection Little Critter Collection Smithsonian 5 Little Monkeys Berenstain Bears

// Get the user application data folder Windows: : Storage. Folder^ local. Folder =

// Get the user application data folder Windows: : Storage. Folder^ local. Folder = Application. Data: : Current>Local. Folder; // Create an asynch task to open the file concurrency: : task<Storage. File^> get. File. Operation(local. Folder>Get. File. Async(file. Name)); // Read the contents of the file asynchronously get. File. Operation. then([this, m_d 2 d. Context](Storage. File^ file){ return File. IO: : Read. Buffer. Async(file); }). then([this, m_d 2 d. Context](concurrency: : task<IBuffer^> previous. Operation) {. . . }

// In Direct 2 D/Direct. Write, manipulating text is // equivalent to manipulating bitmaps

// In Direct 2 D/Direct. Write, manipulating text is // equivalent to manipulating bitmaps // Set up scale, rotation & translation transforms // These can be animated each frame D 2 D 1: : Matrix 3 x 2 F r = D 2 D 1: : Matrix 3 x 2 F: : Rotation(angle); D 2 D 1: : Matrix 3 x 2 F s = D 2 D 1: : Matrix 3 x 2 F: : Scale(scale. x, scale. y); D 2 D 1: : Matrix 3 X 2 F t = D 2 D 1: : Matrix 3 X 2 F: : Translate(x, y); m_d 2 d. Context. Set. Transform(s*r*t); // If bitmap m_d 2 d. Context->Draw. Bitmap(bitmap. Get(), args); // If text m_text. Layout. Get()->Draw(m_d 2 d. Context, args);

www. dev. windows. com

www. dev. windows. com

http: //msdn. microsoft. com/en. US/windows/apps/br 229512 http: //design. windows. com/ http: //code. msdn. microsoft.

http: //msdn. microsoft. com/en. US/windows/apps/br 229512 http: //design. windows. com/ http: //code. msdn. microsoft. com/windows apps/Windows-8 -Modern-Style-App. Samples http: //channel 9. msdn. com/Windows http: //aka. ms/Build. Sessions