예제 #1
0
    public IndexedFlowGraphicsCodec(FlowGraphicsFormat format)
    {
        Format = format;
        Name   = format.Name;
        AllocateBuffers();

        // Consider implementing resize increment with more accurate LCM approach
        // https://stackoverflow.com/questions/147515/least-common-multiple-for-3-or-more-numbers
        WidthResizeIncrement = format.ImageProperties.Max(x => x.RowPixelPattern.Count);
    }
예제 #2
0
    public IGraphicsFormat Clone()
    {
        var clone = new FlowGraphicsFormat(Name, ColorType, ColorDepth, Layout, DefaultWidth, DefaultHeight)
        {
            FixedSize          = FixedSize,
            MergePlanePriority = MergePlanePriority.ToArray(),
            ImageProperties    = new List <ImageProperty>()
        };

        foreach (var prop in ImageProperties)
        {
            var propclone = new ImageProperty(prop.ColorDepth, prop.RowInterlace, prop.RowPixelPattern);
            clone.ImageProperties.Add(propclone);
        }

        return(clone);
    }