123456789101112131415161718192021222324252627 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace bbiwarg.Utility
- {
- public class ImageSize
- {
- public int Width {get; private set;}
- public int Height {get; private set;}
- public Vector2D MaxPixel {get; private set;}
- public float DiagonalLength { get { return MaxPixel.Length; } }
- public int NumPixels { get { return Width * Height; } }
- public ImageSize(int width, int height) {
- Width = width;
- Height = height;
- MaxPixel = new Vector2D(width - 1, height - 1);
- }
- public Vector2D getAbsolutePoint(Vector2D relativePoint) {
- return relativePoint.scale(MaxPixel);
- }
- }
- }
|