unsafe fn pdf_dev__rectshape(r: &Rect, M: Option<&TMatrix>, opchr: u8) -> i32 {
    let mut buf = Vec::new();
    assert!(b"fFsSbBW ".contains(&(opchr as u8)));
    let isclip = if opchr == b'W' || opchr == b' ' { 1 } else { 0 };
    /* disallow matrix for clipping.
     * q ... clip Q does nothing and
     * n M cm ... clip n alter CTM.
     */
    if M.is_some() && (isclip != 0 || INVERTIBLE_MATRIX(M.unwrap()) == 0) {
        return -1;
    } /* op: q cm n re Q */
    graphics_mode();
    buf.push(b' ');
    if isclip == 0 {
        buf.push(b'q');
        if let Some(m) = M {
            buf.push(b' ');
            pdf_sprint_matrix(&mut buf, m);
            buf.push(b' ');
            buf.push(b'c');
            buf.push(b'm');
        }
        buf.push(b' ');
    }
    buf.push(b'n');
    let p = r.min;
    let wd = r.size().width;
    let ht = r.size().height;
    buf.push(b' ');
    pdf_sprint_coord(&mut buf, &p);
    buf.push(b' ');
    pdf_sprint_length(&mut buf, wd);
    buf.push(b' ');
    pdf_sprint_length(&mut buf, ht);
    buf.push(b' ');
    buf.push(b'r');
    buf.push(b'e');
    if opchr != b' ' {
        buf.push(b' ');
        buf.push(opchr);
        buf.push(b' ');
        buf.push(if isclip != 0 { b'n' } else { b'Q' });
    }
    pdf_doc_mut().add_page_content(&buf);
    0
}
/* rectfill, rectstroke, rectclip, recteoclip
 *
 * Draw isolated rectangle without actually doing
 * gsave/grestore operation.
 *
 * TODO:
 *  linestyle, fill-opacity, stroke-opacity,....
 *  As this routine draw a single graphics object
 *  each time, there should be options for specifying
 *  various drawing styles, which might inherite
 *  current graphcs state parameter.
 */
rectfill, rectstroke, rectclip, recteoclip
Draw isolated rectangle without actually doing
gsave/grestore operation.

linestyle, fill-opacity, stroke-opacity,
As this routine draw a single graphics object
each time, there should be options for specifying
various drawing styles, which might inherite
current graphcs state parameter.
rectfill rectstroke rectclip recteoclip Draw isolated rectangle without actually doing gsave / grestore operation . linestyle fill - opacity stroke - opacity As this routine draw a single graphics object each time there should be options for specifying various drawing styles which might inherite current graphcs state parameter .
unsafe fn pdf_dev__rectshape(r: &Rect, M: Option<&TMatrix>, opchr: u8) -> i32 {
    let mut buf = Vec::new();
    assert!(b"fFsSbBW ".contains(&(opchr as u8)));
    let isclip = if opchr == b'W' || opchr == b' ' { 1 } else { 0 };
    /* disallow matrix for clipping.
     * q ... clip Q does nothing and
     * n M cm ... clip n alter CTM.
     */
    if M.is_some() && (isclip != 0 || INVERTIBLE_MATRIX(M.unwrap()) == 0) {
        return -1;
    } /* op: q cm n re Q */
    graphics_mode();
    buf.push(b' ');
    if isclip == 0 {
        buf.push(b'q');
        if let Some(m) = M {
            buf.push(b' ');
            pdf_sprint_matrix(&mut buf, m);
            buf.push(b' ');
            buf.push(b'c');
            buf.push(b'm');
        }
        buf.push(b' ');
    }
    buf.push(b'n');
    let p = r.min;
    let wd = r.size().width;
    let ht = r.size().height;
    buf.push(b' ');
    pdf_sprint_coord(&mut buf, &p);
    buf.push(b' ');
    pdf_sprint_length(&mut buf, wd);
    buf.push(b' ');
    pdf_sprint_length(&mut buf, ht);
    buf.push(b' ');
    buf.push(b'r');
    buf.push(b'e');
    if opchr != b' ' {
        buf.push(b' ');
        buf.push(opchr);
        buf.push(b' ');
        buf.push(if isclip != 0 { b'n' } else { b'Q' });
    }
    pdf_doc_mut().add_page_content(&buf);
    0
}
unsafe fn pdf_dev__rectshape ( r : & Rect , M : Option < & TMatrix > , opchr : u8 ) -> i32 { let mut buf = Vec :: new ( ) ; assert ! ( b" " contains ( ( opchr as u8 ) ) ) ; let isclip = if opchr == b'W' || opchr == b' ' { 1 } else { 0 } ; /* disallow matrix for clipping.
     * q ... clip Q does nothing and
     * n M cm ... clip n alter CTM.
     */ if M . is_some ( ) && ( isclip != 0 || INVERTIBLE_MATRIX ( M . unwrap ( ) ) == 0 ) { return - 1 ; } /* op: q cm n re Q */ graphics_mode ( ) ; buf . push ( b' ' ) ; if isclip == 0 { buf . push ( b'q' ) ; if let Some ( m ) = M { buf . push ( b' ' ) ; pdf_sprint_matrix ( & mut buf , m ) ; buf . push ( b' ' ) ; buf . push ( b'c' ) ; buf . push ( b'm' ) ; } buf . push ( b' ' ) ; } buf . push ( b'n' ) ; let p = r . min ; let wd = r . size ( ) . width ; let ht = r . size ( ) . height ; buf . push ( b' ' ) ; pdf_sprint_coord ( & mut buf , & p ) ; buf . push ( b' ' ) ; pdf_sprint_length ( & mut buf , wd ) ; buf . push ( b' ' ) ; pdf_sprint_length ( & mut buf , ht ) ; buf . push ( b' ' ) ; buf . push ( b'r' ) ; buf . push ( b'e' ) ; if opchr != b' ' { buf . push ( b' ' ) ; buf . push ( opchr ) ; buf . push ( b' ' ) ; buf . push ( if isclip != 0 { b'n' } else { b'Q' } ) ; } pdf_doc_mut ( ) . add_page_content ( & buf ) ; 0 }
rectfill, rectstroke, rectclip, recteoclip
 Draw isolated rectangle without actually doing
 gsave/grestore operation.
rectfill rectstroke rectclip recteoclip Draw isolated rectangle without actually doing gsave / grestore operation .
r
&Rect
M
Option<&TMatrix>
opchr
u8