//-------------------------------------------------------------------- public void transform_all_paths(Transform.Affine trans) { uint idx; uint num_ver = m_vertices.total_vertices(); for (idx = 0; idx < num_ver; idx++) { double x, y; if (Path.IsVertex(m_vertices.vertex(idx, out x, out y))) { trans.Transform(ref x, ref y); m_vertices.modify_vertex(idx, x, y); } } }
//-------------------------------------------------------------------- public void transform_all_paths(Transform.Affine trans) { int index; int num_ver = vertices.total_vertices(); for (index = 0; index < num_ver; index++) { double x, y; if (ShapePath.is_vertex(vertices.vertex(index, out x, out y))) { trans.transform(ref x, ref y); vertices.modify_vertex(index, x, y); } } }
public void transform(Transform.Affine trans, int path_id) { int num_ver = vertices.total_vertices(); for (; path_id < num_ver; path_id++) { double x, y; ShapePath.FlagsAndCommand PathAndFlags = vertices.vertex(path_id, out x, out y); if (ShapePath.is_stop(PathAndFlags)) { break; } if (ShapePath.is_vertex(PathAndFlags)) { trans.transform(ref x, ref y); vertices.modify_vertex(path_id, x, y); } } }
public void transform(Transform.Affine trans, uint path_id) { uint num_ver = m_vertices.total_vertices(); for (; path_id < num_ver; path_id++) { double x, y; uint PathAndFlags = m_vertices.vertex(path_id, out x, out y); if (Path.IsStop(PathAndFlags)) { break; } if (Path.IsVertex(PathAndFlags)) { trans.Transform(ref x, ref y); m_vertices.modify_vertex(path_id, x, y); } } }
//-------------------------------------------------------------------- public void transform(Transform.Affine trans) { transform(trans, 0); }
public void SetTransform(Affine value) { m_Transform = value; }
public void SetTransform(Affine value) { m_Transform = value; }
// Auxiliary functions. TransAffineResizing() modifier sets up the resizing // matrix on the basis of the given Width and Height and the initial // Width and Height of the window. The implementation should simply // call this function every time when it catches the resizing event // passing in the new values of Width and Height of the window. // Nothing prevents you from "cheating" the scaling matrix if you // call this function from somewhere with wrong arguments. // TransAffineResizing() accessor simply returns current resizing matrix // which can be used to apply additional scaling of any of your // stuff when the window is being resized. // Width(), Height(), InitialWidth(), and InitialHeight() must be // clear to understand with no comments :-) public void TransAffineResizing(int width, int height) { if ((m_window_flags & (uint)EWindowFlags.KeepAspectRatio) != 0) { double sx = (double)(width) / (double)(m_initial_width); double sy = (double)(height) / (double)(m_initial_height); if (sy < sx) sx = sy; m_resize_mtx = Affine.NewScaling(sx, sx); Transform.Viewport vp = new Transform.Viewport(); vp.PreserveAspectRatio(0.5, 0.5, Pictor.Transform.Viewport.EAspectRatio.Meet); vp.DeviceViewport(0, 0, width, height); vp.WorldViewport(0, 0, m_initial_width, m_initial_height); m_resize_mtx = vp.ToAffine(); } else { m_resize_mtx = Affine.NewScaling( (double)(width) / (double)(m_initial_width), (double)(height) / (double)(m_initial_height)); } }
// Format - see enum e {}; // FlipY - true if you want to have the Y-axis flipped vertically. public PlatformSupportAbstract(PixelFormats format, PlatformSupportAbstract.ERenderOrigin RenderOrigin) { m_format = format; m_bpp = GetBitDepthForPixelFormat(format); m_RenderOrigin = RenderOrigin; m_initial_width = 10; m_initial_height = 10; m_resize_mtx = Affine.NewIdentity(); m_rbuf_img = new List<RasterBuffer>(); }