Exemple #1
0
    public override Color GetPixelRaw2(buffer_class buffer, long x, long y)
    {
        x = (long)((float)x + buffer.outerRect.x);
        y = (long)((float)y + buffer.outerRect.y);
        if (x < 0L)
        {
            x = -x;
        }
        else if ((float)x > buffer.resolution.x - (float)1)
        {
            x = (long)((float)x - ((float)x - buffer.resolution.x - (float)1));
        }
        if (y < 0L)
        {
            y = -y;
        }
        else if ((float)y > buffer.resolution.y - (float)1)
        {
            y = (long)((float)y - ((float)y - buffer.resolution.y - (float)1));
        }
        ulong num = (ulong)((long)buffer.row * y + x * 3L);

        buffer.file.Seek((long)num, SeekOrigin.Begin);
        byte[] array = new byte[3];
        buffer.file.Read(array, 0, 3);
        return(new Color((float)array[0] * 1f / (float)255, (float)array[1] * 1f / (float)255, (float)array[2] * 1f / (float)255));
    }
Exemple #2
0
    public override Color GetPixelRaw(buffer_class buffer, long x, long y)
    {
        Color arg_154_0;

        if (this.mode == 1)
        {
            if (x < 0L)
            {
                x = 0L - x;
            }
            else if ((float)x > buffer.outerRect.width - (float)1)
            {
                x = (long)((float)x - ((float)x - (buffer.outerRect.width - (float)1)));
            }
            if (y < 0L)
            {
                y = 0L - y;
            }
            else if ((float)y > buffer.outerRect.height - (float)1)
            {
                y = (long)((float)y - ((float)y - (buffer.outerRect.height - (float)1)));
            }
        }
        else if (x < 0L || (float)x > buffer.outerRect.width - (float)1 || y < 0L || (float)y > buffer.outerRect.height - (float)1)
        {
            arg_154_0 = this.GetPixelRaw2(buffer, x, y);
            return(arg_154_0);
        }
        ulong num = (ulong)(buffer.outerRect.width * (float)3 * (float)y + (float)(x * 3L));

        arg_154_0 = new Color((float)buffer.bytes[(int)num] * 1f / (float)255, (float)buffer.bytes[(int)((long)num + (long)((ulong)1))] * 1f / (float)255, (float)buffer.bytes[(int)((long)num + (long)((ulong)2))] * 1f / (float)255);
        return(arg_154_0);
    }
Exemple #3
0
 public preimage_edit_class()
 {
     this.edit_color   = new List <image_edit_class>();
     this.target_frame = (float)30;
     this.active       = true;
     this.loop_active  = true;
     this.byte1        = new byte[3];
     this.xx           = 3;
     this.position     = new Vector2((float)(this.x - 1), (float)(this.y - 1));
     this.direction    = new Vector2((float)1, (float)0);
     this.dir          = 1;
     this.inputBuffer  = new buffer_class();
     this.outputBuffer = new buffer_class();
     this.radius       = 300;
     this.radiusSelect = 300;
     this.mode         = 1;
     this.tile         = new tile_class();
     this.repeatAmount = 3;
     this.content      = true;
 }
Exemple #4
0
    public override void SetPixelRaw(buffer_class buffer, long x, long y, Color color)
    {
        if (x < 0L)
        {
            x = 0L - x;
        }
        else if ((float)x > buffer.outerRect.width - (float)1)
        {
            x = (long)((float)x - ((float)x - (buffer.outerRect.width - (float)1)));
        }
        if (y < 0L)
        {
            y = 0L - y;
        }
        else if ((float)y > buffer.outerRect.height - (float)1)
        {
            y = (long)((float)y - ((float)y - (buffer.outerRect.height - (float)1)));
        }
        ulong num = (ulong)(buffer.outerRect.width * (float)3 * (float)y + (float)(x * 3L));

        buffer.bytes[(int)num] = (byte)(color[0] * (float)255);
        buffer.bytes[(int)((long)num + (long)((ulong)1))] = (byte)(color[1] * (float)255);
        buffer.bytes[(int)((long)num + (long)((ulong)2))] = (byte)(color[2] * (float)255);
    }